Package io.jmix.core.impl
Class MetaModelLoader
java.lang.Object
io.jmix.core.impl.MetaModelLoader
INTERNAL.
Loads meta-model from a set of annotated Java classes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DatatypeRegistryprotected FormatStringsRegistryprotected Messagesprotected Storesprotected static final List<Class<? extends Annotation>>protected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
ConstructorsConstructorDescriptionMetaModelLoader(DatatypeRegistry datatypes, Stores stores, FormatStringsRegistry formatStringsRegistry, Messages messages) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassignInverse(MetaPropertyImpl property, Range range, String inverseField) protected voidassignPropertyType(AnnotatedElement field, MetaProperty property, Range range) protected voidassignStore(MetaClass metaClass) protected voidassignStore(MetaProperty metaProperty) buildSetterNames(Field field) Builds a list of possible setter names for the field.protected MetaClassImplcreateClass(Session session, Class<?> javaClass) protected DatatypegetAdaptiveDatatype(MetaProperty metaProperty, Class<?> type) protected DatatypegetAdaptiveDatatype(AnnotatedElement annotatedElement) protected Range.CardinalitygetCardinality(Field field) protected ClassgetFieldType(Field field) protected Classprotected StringgetInverseField(Field field) protected StringgetMetaClassName(Class<?> javaClass) protected ClassgetTypeOverride(AnnotatedElement element) protected booleanhasJpaAnnotation(Class<?> javaClass) protected booleanhasJpaAnnotation(AnnotatedElement annotatedElement) protected voidinitAncestors(Session session, MetaClass metaClass) protected voidinitInheritedProperties(MetaClass metaClass) protected voidinitProperties(Session session, Class<?> clazz, MetaClassImpl metaClass, Collection<MetaModelLoader.RangeInitTask> tasks) protected booleanisCollection(Field field) protected booleanisCollection(Method method) protected booleanisDefinedForDefaultValidationGroup(Annotation annotation) protected booleanisDefinedForValidationGroup(Annotation annotation, Class groupClass, boolean inheritDefault) protected booleanisEmbedded(Field field) protected booleanisJmixProperty(Field field) protected booleanisMandatory(AccessibleObject base) protected booleanprotected booleanprotected booleanisMetaPropertyField(Field field) protected booleanisMetaPropertyMethod(Method method) protected booleanprotected booleanisPrimaryKey(Field field) protected booleanisSystem(Field field, MetaProperty metaProperty) protected booleanisTransientFieldOfJpaEntity(Class clazz, Field field) protected booleanisUuidGeneratedValue(MetaProperty metaProperty, Field field) protected voidloadBeanValidationAnnotations(MetaProperty metaProperty, AnnotatedElement annotatedElement) protected MetaModelLoader.MetadataObjectInfo<MetaClass>protected MetaModelLoader.MetadataObjectInfo<MetaProperty>loadCollectionProperty(Session session, MetaClassImpl metaClass, Field field) voidprotected MetaModelLoader.MetadataObjectInfo<MetaProperty>loadProperty(Session session, MetaClassImpl metaClass, Field field) protected MetaModelLoader.MetadataObjectInfo<MetaProperty>loadProperty(Session session, MetaClassImpl metaClass, Method method, String name) protected voidloadPropertyAnnotations(MetaProperty metaProperty, AnnotatedElement annotatedElement) protected MetaModelLoader.MetadataObjectInfo<Range>protected voidonPropertyLoaded(MetaProperty metaProperty, Field field) protected voidonPropertyLoaded(MetaProperty metaProperty, Method method) protected booleansetterExists(Field field) protected booleansetterExists(Method getter) protected Class
-
Field Details
-
VALIDATION_MIN
- See Also:
-
VALIDATION_MAX
- See Also:
-
VALIDATION_NOTNULL_MESSAGE
- See Also:
-
VALIDATION_NOTNULL_UI_COMPONENT
- See Also:
-
SYSTEM_ANNOTATIONS
-
datatypes
-
stores
-
formatStringsRegistry
-
messages
-
-
Constructor Details
-
MetaModelLoader
@Autowired public MetaModelLoader(DatatypeRegistry datatypes, Stores stores, FormatStringsRegistry formatStringsRegistry, Messages messages)
-
-
Method Details
-
loadModel
-
initAncestors
-
loadClass
@Nullable protected MetaModelLoader.MetadataObjectInfo<MetaClass> loadClass(Session session, Class<?> javaClass) -
assignStore
-
initInheritedProperties
-
createClass
-
getMetaClassName
-
initProperties
protected void initProperties(Session session, Class<?> clazz, MetaClassImpl metaClass, Collection<MetaModelLoader.RangeInitTask> tasks) -
isMetaPropertyField
-
isJmixProperty
-
isTransientFieldOfJpaEntity
-
isMetaPropertyMethod
-
loadProperty
protected MetaModelLoader.MetadataObjectInfo<MetaProperty> loadProperty(Session session, MetaClassImpl metaClass, Field field) -
loadProperty
protected MetaModelLoader.MetadataObjectInfo<MetaProperty> loadProperty(Session session, MetaClassImpl metaClass, Method method, String name) -
loadCollectionProperty
protected MetaModelLoader.MetadataObjectInfo<MetaProperty> loadCollectionProperty(Session session, MetaClassImpl metaClass, Field field) -
onPropertyLoaded
-
assignStore
-
isSystem
-
getFieldTypeAccordingAnnotations
-
getTypeOverride
-
isMandatory
- Parameters:
base- field or method for field-based or property-based access type- Returns:
-
getCardinality
-
getInverseField
-
isPrimaryKey
-
isUuidGeneratedValue
-
isEmbedded
-
hasJpaAnnotation
-
hasJpaAnnotation
-
isCollection
-
isMap
-
isMap
-
isCollection
-
onPropertyLoaded
-
loadPropertyAnnotations
protected void loadPropertyAnnotations(MetaProperty metaProperty, AnnotatedElement annotatedElement) -
loadBeanValidationAnnotations
protected void loadBeanValidationAnnotations(MetaProperty metaProperty, AnnotatedElement annotatedElement) -
isDefinedForDefaultValidationGroup
-
isDefinedForValidationGroup
protected boolean isDefinedForValidationGroup(Annotation annotation, Class groupClass, boolean inheritDefault) -
getAdaptiveDatatype
-
setterExists
-
buildSetterNames
Builds a list of possible setter names for the field. There may be two options:- In most cases the setter name is "set<FieldName>", e.g. "setPrice" for a field "price"
- There may be a special case for Kotlin entity. If the field name starts with "is" (e.g. "isApproved") then a setter name will be "setApproved", not "setIsApproved"
-
setterExists
-
assignPropertyType
-
loadRange
protected MetaModelLoader.MetadataObjectInfo<Range> loadRange(Session session, MetaProperty metaProperty, Class<?> type, Map<String, Object> map) -
getAdaptiveDatatype
-
getFieldType
-
toClass
-
assignInverse
-
isOrdered
-