| 1 |
0 |
package org.trails.descriptor.annotation; |
| 2 |
|
|
| 3 |
|
import org.trails.descriptor.CollectionDescriptor; |
| 4 |
|
|
| 5 |
4 |
public class CollectionDescriptorAnnotationHandler implements DescriptorAnnotationHandler<Collection, CollectionDescriptor> |
| 6 |
|
{ |
| 7 |
|
|
| 8 |
|
public CollectionDescriptor decorateFromAnnotation(Collection annotation, CollectionDescriptor descriptor) |
| 9 |
|
{ |
| 10 |
4 |
descriptor.setChildRelationship(annotation.child()); |
| 11 |
4 |
descriptor.setAllowRemove(annotation.allowRemove()); |
| 12 |
|
|
| 13 |
4 |
if (!Collection.DEFAULT_inverse.equals(annotation.inverse())) |
| 14 |
|
{ |
| 15 |
4 |
descriptor.setInverseProperty(annotation.inverse()); |
| 16 |
|
} |
| 17 |
|
|
| 18 |
4 |
if (!Collection.DEFAULT_addExpression.equals(annotation.addExpression())) |
| 19 |
|
{ |
| 20 |
0 |
descriptor.setAddExpression(annotation.addExpression()); |
| 21 |
|
} |
| 22 |
|
|
| 23 |
4 |
if (!Collection.DEFAULT_removeExpression.equals(annotation.removeExpression())) |
| 24 |
|
{ |
| 25 |
0 |
descriptor.setRemoveExpression(annotation.removeExpression()); |
| 26 |
|
} |
| 27 |
|
|
| 28 |
4 |
if (!Collection.DEFAULT_swapExpression.equals(annotation.swapExpression())) |
| 29 |
|
{ |
| 30 |
0 |
descriptor.setSwapExpression(annotation.swapExpression()); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
|
| 34 |
4 |
return descriptor; |
| 35 |
|
} |
| 36 |
|
} |