-
Notifications
You must be signed in to change notification settings - Fork 40
Annotation Details
Alessandro Vurro edited this page Oct 13, 2016
·
20 revisions
Below each annotation described in detail.
##JMap
public @interface JMap {
String value() default Constants.DEFAULT_FIELD_VALUE;
String[] attributes() default {};
Class<?>[] classes() default {};
}-
valuerepresents the target field name. -
attributesallows the definition of more than one target field name. -
classesidentifies the classes of theattributes. The relationship between the attribute and the class is given by the position.
To know how this annotation works visit the wiki page: basic mapping.
##JGlobalMap
public @interface JGlobalMap {
String value() default Constants.DEFAULT_FIELD_VALUE;
Class<?>[] classes() default {};
String[] attributes() default {};
String[] excluded() default {};
}-
valuerepresents the target field name. -
classesidentifies the classes to which the target field belongs. -
attributesallows to define which fields of the current class must be part of the mapping. -
excludedallows to define which fields of the current class must be excluded from mapping.
To know how this annotation works visit the wiki page: global mapping.
##JMapAccessor
public @interface JMapAccessor {
String name() default Constants.DEFAULT_FIELD_VALUE;
String get() default Constants.DEFAULT_ACCESSOR_VALUE;
String set() default Constants.DEFAULT_ACCESSOR_VALUE;
Class<?>[] classes() default {};
}-
nameidentifies the name of the field, if not defined refers to the field on which it is located. -
getget method name, if not defined refers to the standard get method name. -
setset method name, if not defined refers to the standard set method name.
To know how this annotation works visit the wiki page: custom accessors.
##JMapAccessors
public @interface JMapAccessors {
JMapAccessor[] value();
}In case you should need to define more JMapAccessor, JMapAccessors comes in handy.
##JMapConversion
public @interface JMapConversion {
public static final String ALL = "all";
public static enum Type {DYNAMIC, STATIC};
String[] from() default {ALL};
String[] to() default {ALL};
Type type() default Type.STATIC;
boolean avoidSet() default false;
}-
fromsource fields. -
totarget fields. -
typeconversion type (DYNAMIC or STATIC). -
avoidSetthis boolean permits to avoid to use the set method for destination, this is useful with the beans generated by JAXB for example, where setting methods for collections aren't defined.
To know how this annotation works visit the wiki page: explicit conversions.
© 2016 Alessandro Vurro
- Home
- How to map
- Relations
- Conversions
- creation/enrichment
- XML
- Annotation
- API
- Configurations
- Utilities
- Examples
- Articles
- More information
- Performance tests
- Release Notes