public class TypeInfo<T> extends Object
FieldHandlerImpl
.Constructor and Description |
---|
TypeInfo(Class<T> fieldType)
Construct new type information for a field.
|
TypeInfo(Class<T> fieldType,
TypeConvertor convertorTo,
TypeConvertor convertorFrom,
boolean required,
Object defaultValue,
CollectionHandler<T> colHandler)
Construct new type information for the field.
|
TypeInfo(Class<T> fieldType,
TypeConvertor convertorTo,
TypeConvertor convertorFrom,
boolean required,
Object defaultValue,
CollectionHandler<T> colHandler,
boolean checkForCollection)
Construct new type information for the field.
|
Modifier and Type | Method and Description |
---|---|
CollectionHandler<T> |
getCollectionHandler()
Return the collection handler of this field.
|
TypeConvertor |
getConvertorFrom()
Returns the convertor from the field type to an external type.
|
TypeConvertor |
getConvertorTo()
Returns the convertor to the field type from an external type.
|
Object |
getDefaultValue()
Returns the default value for the field.
|
Class<?> |
getFieldType()
Returns the field type.
|
boolean |
isImmutable()
Returns true if field type is immutable.
|
boolean |
isRequired()
Returns true if field type is required.
|
void |
setCollectionHandler(CollectionHandler<T> handler)
Sets the CollectionHandler to use for the field described by this
TypeInfo.
|
void |
setRequired(boolean required)
Sets a flag indictating if the field is required.
|
public TypeInfo(Class<T> fieldType)
fieldType
- The field typepublic TypeInfo(Class<T> fieldType, TypeConvertor convertorTo, TypeConvertor convertorFrom, boolean required, Object defaultValue, CollectionHandler<T> colHandler)
fieldType
- The field typeconvertorTo
- Convertor to the field type from external type, or null if no
conversion is requiredconvertorFrom
- Convertor from the field type to external type, or null if no
conversion is requiredrequired
- True if the field is requireddefaultValue
- The default value of the field, null to use the known Java
defaultscolHandler
- The collection handler for this field, or null if field is
singularpublic TypeInfo(Class<T> fieldType, TypeConvertor convertorTo, TypeConvertor convertorFrom, boolean required, Object defaultValue, CollectionHandler<T> colHandler, boolean checkForCollection)
fieldType
- The field typeconvertorTo
- Convertor to the field type from external type, or null if no
conversion is requiredconvertorFrom
- Convertor from the field type to external type, or null if no
conversion is requiredrequired
- True if the field is requireddefaultValue
- The default value of the field, null to use the known Java
defaultscolHandler
- The collection handler for this field, or null if field is
singularpublic Class<?> getFieldType()
public TypeConvertor getConvertorTo()
public TypeConvertor getConvertorFrom()
public boolean isImmutable()
public boolean isRequired()
public Object getDefaultValue()
public CollectionHandler<T> getCollectionHandler()
public void setRequired(boolean required)
required
- the value of the flag. Should be true if the field is required,
false otherwise.public void setCollectionHandler(CollectionHandler<T> handler)
handler
- the CollectionHandler, or null if no CollectionHandler should be
used.Copyright © 2019. All rights reserved.