Class ModelReader

  • All Implemented Interfaces:
    java.io.Serializable

    public class ModelReader
    extends java.lang.Object
    implements java.io.Serializable
    Generic Entity - Entity Definition Reader
    See Also:
    Serialized Form
    • Field Detail

      • module

        public static final java.lang.String module
      • entityCache

        protected volatile java.util.Map<java.lang.String,​ModelEntity> entityCache
      • numEntities

        protected int numEntities
      • numViewEntities

        protected int numViewEntities
      • numFields

        protected int numFields
      • numRelations

        protected int numRelations
      • numAutoRelations

        protected int numAutoRelations
      • modelName

        protected java.lang.String modelName
      • entityResourceHandlers

        protected java.util.Collection<ResourceHandler> entityResourceHandlers
        collection of filenames for entity definitions
      • resourceHandlerEntities

        protected java.util.Map<ResourceHandler,​java.util.Collection<java.lang.String>> resourceHandlerEntities
        contains a collection of entity names for each ResourceHandler, populated as they are loaded
      • entityResourceHandlerMap

        protected java.util.Map<java.lang.String,​ResourceHandler> entityResourceHandlerMap
        for each entity contains a map to the ResourceHandler that the entity came from
    • Method Detail

      • rebuildResourceHandlerEntities

        public void rebuildResourceHandlerEntities()
        rebuilds the resourceHandlerEntities Map of Collections based on the current entityResourceHandlerMap Map, must be done whenever a manual change is made to the entityResourceHandlerMap Map after the initial load to make them consistent again.
      • getResourceHandlerEntitiesKeyIterator

        public java.util.Iterator<ResourceHandler> getResourceHandlerEntitiesKeyIterator()
      • getResourceHandlerEntities

        public java.util.Collection<java.lang.String> getResourceHandlerEntities​(ResourceHandler resourceHandler)
      • addEntityToResourceHandler

        public void addEntityToResourceHandler​(java.lang.String entityName,
                                               java.lang.String loaderName,
                                               java.lang.String location)
      • getEntityResourceHandler

        public ResourceHandler getEntityResourceHandler​(java.lang.String entityName)
      • getModelEntity

        public ModelEntity getModelEntity​(java.lang.String entityName)
                                   throws GenericEntityException
        Gets an Entity object based on a definition from the specified XML Entity descriptor file.
        Parameters:
        entityName - The entityName of the Entity definition to use.
        Returns:
        An Entity object describing the specified entity of the specified descriptor file.
        Throws:
        GenericEntityException
      • getModelEntityNoCheck

        public ModelEntity getModelEntityNoCheck​(java.lang.String entityName)
      • getEntityNamesIterator

        public java.util.Iterator<java.lang.String> getEntityNamesIterator()
                                                                    throws GenericEntityException
        Creates a Iterator with the entityName of each Entity defined in the specified XML Entity Descriptor file.
        Returns:
        A Iterator of entityName Strings
        Throws:
        GenericEntityException
      • getEntityNames

        public java.util.Set<java.lang.String> getEntityNames()
                                                       throws GenericEntityException
        Creates a Set with the entityName of each Entity defined in the specified XML Entity Descriptor file.
        Returns:
        A Set of entityName Strings
        Throws:
        GenericEntityException
      • getEntitiesByPackage

        public java.util.Map<java.lang.String,​java.util.TreeSet<java.lang.String>> getEntitiesByPackage​(java.util.Set<java.lang.String> packageFilterSet,
                                                                                                              java.util.Set<java.lang.String> entityFilterSet)
                                                                                                       throws GenericEntityException
        Get all entities, organized by package
        Throws:
        GenericEntityException
      • validateEntityName

        public java.lang.String validateEntityName​(java.lang.String entityName)
                                            throws GenericEntityException
        Util method to validate an entity name; if no entity is found with the name, characters are stripped from the beginning of the name until a valid entity name is found. It is intended to be used to determine the entity name from a relation name.
        Returns:
        A valid entityName or null
        Throws:
        GenericEntityException
      • incrementFieldCount

        public void incrementFieldCount​(int amount)