Package org.cyclopsgroup.caff.conversion
Class AnnotatedConverter<T>
java.lang.Object
org.cyclopsgroup.caff.conversion.AnnotatedConverter<T>
- Type Parameters:
T- Type of value to converter from/to
- All Implemented Interfaces:
Converter<T>
Converter that converts based on rules defined in annotation
- Author:
- Jiaqi Guo
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedConverter(Class<T> type, PropertyDescriptor descriptor) Constructor with a property descriptorAnnotatedConverter(Class<T> type, Annotation annotation) Constructor with given AnnotationAnnotatedConverter(Class<T> type, Iterable<AnnotatedElement> elements) Constructor with an annotated element with annotations.AnnotatedConverter(Class<T> type, AnnotatedElement firstElement, AnnotatedElement... additionalElements) Constructor with an annotated element with annotations. -
Method Summary
-
Constructor Details
-
AnnotatedConverter
public AnnotatedConverter(Class<T> type, AnnotatedElement firstElement, AnnotatedElement... additionalElements) Constructor with an annotated element with annotations.- Parameters:
type- the kind of bean to convert from/to.firstElement- is the first element in array to add.additionalElements- the rest of elements as an array.
-
AnnotatedConverter
Constructor with given Annotation- Parameters:
type- Value type to convert from/toannotation- Annotation that defines conversion rule
-
AnnotatedConverter
Constructor with an annotated element with annotations.- Parameters:
type- Type to convert from/to.elements- Iterable of annotated elements.
-
AnnotatedConverter
Constructor with a property descriptor- Parameters:
type- Type of value to convertdescriptor- Property descriptor
-
-
Method Details
-
fromCharacters
- Specified by:
fromCharactersin interfaceConverter<T>- Parameters:
text- Character sequence form of value- Returns:
- Converted result
-
toCharacters
- Specified by:
toCharactersin interfaceConverter<T>- Parameters:
value- Object instance- Returns:
- Text form of value
-