@Component(value="cuba_MetadataLoader")
@Scope(value="prototype")
public class MetadataLoader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
protected com.haulmont.chile.core.datatypes.DatatypeRegistry |
datatypeRegistry |
protected ExtendedEntities |
extendedEntities |
protected MetadataBuildSupport |
metadataBuildSupport |
static java.lang.String |
NAME |
protected java.util.List<java.lang.String> |
rootPackages |
protected com.haulmont.chile.core.model.Session |
session |
Constructor and Description |
---|
MetadataLoader() |
Modifier and Type | Method and Description |
---|---|
protected void |
addMetaAnnotationsFromXml(java.util.List<MetadataBuildSupport.XmlAnnotations> xmlAnnotations,
com.haulmont.chile.core.model.MetaClass metaClass)
Initialize entity annotations from definition in
metadata.xml . |
protected void |
assignMetaAnnotationValueFromXml(java.lang.String annName,
MetadataBuildSupport.XmlAnnotation xmlAnn,
java.util.Map<java.lang.String,java.lang.Object> metaAnnotations) |
protected MetaModelLoader |
createModelLoader(com.haulmont.chile.core.model.Session session) |
protected void |
findMissingDescendants(com.haulmont.chile.core.model.MetaClass ancestor,
java.util.Collection<com.haulmont.chile.core.model.MetaClass> missingDescendants) |
protected java.lang.String |
getGetDatatypesResourcePath() |
java.util.List<java.lang.String> |
getRootPackages() |
com.haulmont.chile.core.model.Session |
getSession() |
protected java.lang.String |
guessDatatypeId(com.haulmont.chile.core.datatypes.Datatype datatype)
Guesses id for a datatype registered in legacy datatypes.xml file.
|
protected void |
initDatatypes(java.util.List<org.dom4j.Element> datatypeElements) |
protected void |
initExtensionMetaAnnotations()
Initialize connections between extended and base entities.
|
protected void |
initMetaAnnotations(com.haulmont.chile.core.model.MetaClass metaClass) |
protected void |
initRootPackages(java.util.List<MetadataBuildSupport.XmlFile> metadataXmlList) |
protected void |
initStoreMetaAnnotations(java.util.Map<java.lang.String,java.util.List<EntityClassInfo>> entityPackages) |
protected void |
loadDatatypesFromClasspathResource() |
void |
loadMetadata()
Loads metadata session.
|
protected void |
postProcessClass(com.haulmont.chile.core.model.MetaClass metaClass) |
protected void |
postProcessProperty(com.haulmont.chile.core.model.MetaClass metaClass,
com.haulmont.chile.core.model.MetaProperty metaProperty) |
protected void |
replaceExtendedMetaClasses() |
public static final java.lang.String NAME
@Inject protected MetadataBuildSupport metadataBuildSupport
@Inject protected ExtendedEntities extendedEntities
@Inject protected com.haulmont.chile.core.datatypes.DatatypeRegistry datatypeRegistry
@Inject protected org.springframework.context.ApplicationContext applicationContext
protected com.haulmont.chile.core.model.Session session
protected java.util.List<java.lang.String> rootPackages
protected MetaModelLoader createModelLoader(com.haulmont.chile.core.model.Session session)
public void loadMetadata()
public com.haulmont.chile.core.model.Session getSession()
public java.util.List<java.lang.String> getRootPackages()
protected void initRootPackages(java.util.List<MetadataBuildSupport.XmlFile> metadataXmlList)
protected void initDatatypes(java.util.List<org.dom4j.Element> datatypeElements)
protected void loadDatatypesFromClasspathResource()
protected java.lang.String guessDatatypeId(com.haulmont.chile.core.datatypes.Datatype datatype)
protected java.lang.String getGetDatatypesResourcePath()
protected void replaceExtendedMetaClasses()
protected void initStoreMetaAnnotations(java.util.Map<java.lang.String,java.util.List<EntityClassInfo>> entityPackages)
protected void initExtensionMetaAnnotations()
protected void addMetaAnnotationsFromXml(java.util.List<MetadataBuildSupport.XmlAnnotations> xmlAnnotations, com.haulmont.chile.core.model.MetaClass metaClass)
metadata.xml
.
Can be overridden in application projects to handle application-specific annotations.
xmlAnnotations
- map of class name to annotations mapmetaClass
- MetaClass instance to assign annotationsprotected void assignMetaAnnotationValueFromXml(java.lang.String annName, MetadataBuildSupport.XmlAnnotation xmlAnn, java.util.Map<java.lang.String,java.lang.Object> metaAnnotations)
protected void postProcessClass(com.haulmont.chile.core.model.MetaClass metaClass)
protected void postProcessProperty(com.haulmont.chile.core.model.MetaClass metaClass, com.haulmont.chile.core.model.MetaProperty metaProperty)
protected void findMissingDescendants(com.haulmont.chile.core.model.MetaClass ancestor, java.util.Collection<com.haulmont.chile.core.model.MetaClass> missingDescendants)
protected void initMetaAnnotations(com.haulmont.chile.core.model.MetaClass metaClass)