@Component(value="cuba_MetaModelLoader")
@Scope(value="prototype")
public class MetaModelLoader
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MetaModelLoader.MetadataObjectInfo<T> |
protected class |
MetaModelLoader.RangeInitTask |
Modifier and Type | Field and Description |
---|---|
protected com.haulmont.chile.core.datatypes.DatatypeRegistry |
datatypes |
static java.lang.String |
NAME |
protected com.haulmont.chile.core.model.Session |
session |
protected static java.lang.String |
VALIDATION_MAX |
protected static java.lang.String |
VALIDATION_MIN |
protected static java.lang.String |
VALIDATION_NOTNULL_MESSAGE |
protected static java.lang.String |
VALIDATION_NOTNULL_UI_COMPONENT |
Constructor and Description |
---|
MetaModelLoader(com.haulmont.chile.core.model.Session session) |
Modifier and Type | Method and Description |
---|---|
protected void |
assignInverse(com.haulmont.chile.core.model.impl.MetaPropertyImpl property,
com.haulmont.chile.core.model.Range range,
java.lang.String inverseField) |
protected void |
assignPropertyType(java.lang.reflect.AnnotatedElement field,
com.haulmont.chile.core.model.MetaProperty property,
com.haulmont.chile.core.model.Range range) |
protected com.haulmont.chile.core.model.impl.MetaClassImpl |
createClass(java.lang.Class<?> javaClass,
java.lang.String packageName) |
protected com.haulmont.chile.core.model.impl.MetaClassImpl |
createClassInModel(java.lang.String modelName,
java.lang.String className) |
protected com.haulmont.chile.core.datatypes.Datatype |
getAdaptiveDatatype(java.lang.reflect.AnnotatedElement annotatedElement) |
protected com.haulmont.chile.core.datatypes.Datatype |
getAdaptiveDatatype(com.haulmont.chile.core.model.MetaProperty metaProperty,
java.lang.Class<?> type) |
protected com.haulmont.chile.core.model.Range.Cardinality |
getCardinality(java.lang.reflect.Field field) |
protected java.lang.Class |
getFieldType(java.lang.reflect.Field field) |
protected java.lang.Class |
getFieldTypeAccordingAnnotations(java.lang.reflect.Field field) |
protected java.lang.String |
getInverseField(java.lang.reflect.Field field) |
protected java.lang.String |
getMetaClassName(java.lang.Class<?> javaClass) |
protected java.lang.Class |
getTypeOverride(java.lang.reflect.AnnotatedElement element) |
protected void |
initProperties(java.lang.Class<?> clazz,
com.haulmont.chile.core.model.impl.MetaClassImpl metaClass,
java.util.Collection<MetaModelLoader.RangeInitTask> tasks) |
protected boolean |
isCollection(java.lang.reflect.Field field) |
protected boolean |
isCollection(java.lang.reflect.Method method) |
protected boolean |
isDefinedForDefaultValidationGroup(java.lang.annotation.Annotation annotation) |
protected boolean |
isDefinedForValidationGroup(java.lang.annotation.Annotation annotation,
java.lang.Class groupClass,
boolean inheritDefault) |
protected boolean |
isEmbedded(java.lang.reflect.Field field) |
protected boolean |
isMandatory(java.lang.reflect.Field field) |
protected boolean |
isMap(java.lang.reflect.Field field) |
protected boolean |
isMap(java.lang.reflect.Method method) |
protected boolean |
isMetaPropertyField(java.lang.reflect.Field field) |
protected boolean |
isMetaPropertyMethod(java.lang.reflect.Method method) |
protected boolean |
isOrdered(java.lang.reflect.Field field) |
protected boolean |
isPersistent(java.lang.reflect.Field field) |
protected boolean |
isPrimaryKey(java.lang.reflect.Field field) |
protected void |
loadBeanValidationAnnotations(com.haulmont.chile.core.model.MetaProperty metaProperty,
java.lang.reflect.AnnotatedElement annotatedElement) |
protected MetaModelLoader.MetadataObjectInfo<com.haulmont.chile.core.model.MetaClass> |
loadClass(java.lang.String packageName,
java.lang.Class<?> javaClass,
boolean persistent) |
protected MetaModelLoader.MetadataObjectInfo<com.haulmont.chile.core.model.MetaProperty> |
loadCollectionProperty(com.haulmont.chile.core.model.impl.MetaClassImpl metaClass,
java.lang.reflect.Field field) |
void |
loadModel(java.lang.String rootPackage,
java.util.List<EntityClassInfo> classInfos) |
protected MetaModelLoader.MetadataObjectInfo<com.haulmont.chile.core.model.MetaProperty> |
loadProperty(com.haulmont.chile.core.model.impl.MetaClassImpl metaClass,
java.lang.reflect.Field field) |
protected MetaModelLoader.MetadataObjectInfo<com.haulmont.chile.core.model.MetaProperty> |
loadProperty(com.haulmont.chile.core.model.impl.MetaClassImpl metaClass,
java.lang.reflect.Method method,
java.lang.String name) |
protected void |
loadPropertyAnnotations(com.haulmont.chile.core.model.MetaProperty metaProperty,
java.lang.reflect.AnnotatedElement annotatedElement) |
protected MetaModelLoader.MetadataObjectInfo<com.haulmont.chile.core.model.Range> |
loadRange(com.haulmont.chile.core.model.MetaProperty metaProperty,
java.lang.Class<?> type,
java.util.Map<java.lang.String,java.lang.Object> map) |
protected void |
onClassLoaded(com.haulmont.chile.core.model.MetaClass metaClass,
java.lang.Class<?> javaClass,
boolean persistent) |
protected void |
onPropertyLoaded(com.haulmont.chile.core.model.MetaProperty metaProperty,
java.lang.reflect.Field field) |
protected void |
onPropertyLoaded(com.haulmont.chile.core.model.MetaProperty metaProperty,
java.lang.reflect.Method method) |
void |
setDatatypeRegistry(com.haulmont.chile.core.datatypes.DatatypeRegistry datatypeRegistry) |
protected boolean |
setterExists(java.lang.reflect.Field field) |
protected boolean |
setterExists(java.lang.reflect.Method getter) |
public static final java.lang.String NAME
protected static final java.lang.String VALIDATION_MIN
protected static final java.lang.String VALIDATION_MAX
protected static final java.lang.String VALIDATION_NOTNULL_MESSAGE
protected static final java.lang.String VALIDATION_NOTNULL_UI_COMPONENT
protected com.haulmont.chile.core.datatypes.DatatypeRegistry datatypes
protected com.haulmont.chile.core.model.Session session
public MetaModelLoader(com.haulmont.chile.core.model.Session session)
@Inject public void setDatatypeRegistry(com.haulmont.chile.core.datatypes.DatatypeRegistry datatypeRegistry)
public void loadModel(java.lang.String rootPackage, java.util.List<EntityClassInfo> classInfos)
@Nullable protected MetaModelLoader.MetadataObjectInfo<com.haulmont.chile.core.model.MetaClass> loadClass(java.lang.String packageName, java.lang.Class<?> javaClass, boolean persistent)
@Nullable protected com.haulmont.chile.core.model.impl.MetaClassImpl createClass(java.lang.Class<?> javaClass, java.lang.String packageName)
protected java.lang.String getMetaClassName(java.lang.Class<?> javaClass)
protected void onClassLoaded(com.haulmont.chile.core.model.MetaClass metaClass, java.lang.Class<?> javaClass, boolean persistent)
protected void initProperties(java.lang.Class<?> clazz, com.haulmont.chile.core.model.impl.MetaClassImpl metaClass, java.util.Collection<MetaModelLoader.RangeInitTask> tasks)
protected boolean isMetaPropertyField(java.lang.reflect.Field field)
protected boolean isMetaPropertyMethod(java.lang.reflect.Method method)
protected MetaModelLoader.MetadataObjectInfo<com.haulmont.chile.core.model.MetaProperty> loadProperty(com.haulmont.chile.core.model.impl.MetaClassImpl metaClass, java.lang.reflect.Field field)
protected MetaModelLoader.MetadataObjectInfo<com.haulmont.chile.core.model.MetaProperty> loadProperty(com.haulmont.chile.core.model.impl.MetaClassImpl metaClass, java.lang.reflect.Method method, java.lang.String name)
protected MetaModelLoader.MetadataObjectInfo<com.haulmont.chile.core.model.MetaProperty> loadCollectionProperty(com.haulmont.chile.core.model.impl.MetaClassImpl metaClass, java.lang.reflect.Field field)
protected void onPropertyLoaded(com.haulmont.chile.core.model.MetaProperty metaProperty, java.lang.reflect.Field field)
protected java.lang.Class getFieldTypeAccordingAnnotations(java.lang.reflect.Field field)
protected java.lang.Class getTypeOverride(java.lang.reflect.AnnotatedElement element)
protected boolean isMandatory(java.lang.reflect.Field field)
protected com.haulmont.chile.core.model.Range.Cardinality getCardinality(java.lang.reflect.Field field)
protected java.lang.String getInverseField(java.lang.reflect.Field field)
protected boolean isPrimaryKey(java.lang.reflect.Field field)
protected boolean isEmbedded(java.lang.reflect.Field field)
protected boolean isPersistent(java.lang.reflect.Field field)
protected com.haulmont.chile.core.model.impl.MetaClassImpl createClassInModel(java.lang.String modelName, java.lang.String className)
protected boolean isCollection(java.lang.reflect.Field field)
protected boolean isMap(java.lang.reflect.Field field)
protected boolean isMap(java.lang.reflect.Method method)
protected boolean isCollection(java.lang.reflect.Method method)
protected void onPropertyLoaded(com.haulmont.chile.core.model.MetaProperty metaProperty, java.lang.reflect.Method method)
protected void loadPropertyAnnotations(com.haulmont.chile.core.model.MetaProperty metaProperty, java.lang.reflect.AnnotatedElement annotatedElement)
protected void loadBeanValidationAnnotations(com.haulmont.chile.core.model.MetaProperty metaProperty, java.lang.reflect.AnnotatedElement annotatedElement)
protected boolean isDefinedForDefaultValidationGroup(java.lang.annotation.Annotation annotation)
protected boolean isDefinedForValidationGroup(java.lang.annotation.Annotation annotation, java.lang.Class groupClass, boolean inheritDefault)
@Nullable protected com.haulmont.chile.core.datatypes.Datatype getAdaptiveDatatype(java.lang.reflect.AnnotatedElement annotatedElement)
protected boolean setterExists(java.lang.reflect.Field field)
protected boolean setterExists(java.lang.reflect.Method getter)
protected void assignPropertyType(java.lang.reflect.AnnotatedElement field, com.haulmont.chile.core.model.MetaProperty property, com.haulmont.chile.core.model.Range range)
protected MetaModelLoader.MetadataObjectInfo<com.haulmont.chile.core.model.Range> loadRange(com.haulmont.chile.core.model.MetaProperty metaProperty, java.lang.Class<?> type, java.util.Map<java.lang.String,java.lang.Object> map)
@Nullable protected com.haulmont.chile.core.datatypes.Datatype getAdaptiveDatatype(com.haulmont.chile.core.model.MetaProperty metaProperty, java.lang.Class<?> type)
protected java.lang.Class getFieldType(java.lang.reflect.Field field)
protected void assignInverse(com.haulmont.chile.core.model.impl.MetaPropertyImpl property, com.haulmont.chile.core.model.Range range, java.lang.String inverseField)
protected boolean isOrdered(java.lang.reflect.Field field)