T - type of data model classpublic class DefaultDataModelDefinition<T> extends Object implements DataModelDefinition<T>
DataModelDefinition.DefaultDataModelAdapterDataModelDefinition.Builder<T>| Constructor and Description |
|---|
DefaultDataModelDefinition(Class<T> modelClass)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
<A extends Annotation> |
getAnnotation(Class<A> annotationType)
Returns this element's annotation for the specified annotation type.
|
<A extends Annotation> |
getAnnotation(PropertyName name,
Class<A> annotationType)
Returns the property's annotation for the specified annotation type.
|
Class<T> |
getModelClass()
Returns the corresponded data model class.
|
Collection<PropertyName> |
getProperties()
returns the all public property names.
|
PropertyType |
getType(PropertyName name)
Returns the property type.
|
DataModelDefinition.Builder<T> |
newReflection()
Starts to build a new
DataModelReflection. |
Object |
resolveRawValue(Object value)
Converts the given raw property value into a corresponded property value for
DataModelReflection. |
T |
toObject(DataModelReflection reflection)
Converts a generic reflection model into a target object.
|
DataModelReflection |
toReflection(T object)
Converts a target object into a generic reflection model.
|
public DefaultDataModelDefinition(Class<T> modelClass)
modelClass - the original model classIllegalArgumentException - if some parameters were nullpublic Class<T> getModelClass()
DataModelDefinitiongetModelClass in interface DataModelDefinition<T>public <A extends Annotation> A getAnnotation(Class<A> annotationType)
DataModelDefinitiongetAnnotation in interface DataModelDefinition<T>A - type of annotationannotationType - class of annotationnull if does not presentpublic Collection<PropertyName> getProperties()
DataModelDefinitiongetProperties in interface DataModelDefinition<T>public PropertyType getType(PropertyName name)
DataModelDefinitiongetType in interface DataModelDefinition<T>name - the property namenull if no such property existspublic <A extends Annotation> A getAnnotation(PropertyName name, Class<A> annotationType)
DataModelDefinitiongetAnnotation in interface DataModelDefinition<T>A - type of annotationname - target propertyannotationType - class of annotationnull if neither the property nor its specified annotation do not presentpublic DataModelDefinition.Builder<T> newReflection()
DataModelDefinitionDataModelReflection.newReflection in interface DataModelDefinition<T>public DataModelReflection toReflection(T object)
DataModelDefinitiontoReflection in interface DataModelDefinition<T>object - target objectpublic T toObject(DataModelReflection reflection)
DataModelDefinitiontoObject in interface DataModelDefinition<T>reflection - a reflection modelpublic Object resolveRawValue(Object value)
DataModelDefinitionDataModelReflection.resolveRawValue in interface DataModelDefinition<T>value - the raw property valueCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.