Class EntityInfoImpl

java.lang.Object
org.tentackle.model.impl.EntityInfoImpl
All Implemented Interfaces:
EntityInfo

public class EntityInfoImpl extends Object implements EntityInfo
Entity as a component of a model.
Author:
harald
  • Constructor Details

    • EntityInfoImpl

      public EntityInfoImpl(Entity entity, URL url, String modelSource, ModelDefaults defaults) throws ModelException
      Creates a model entity.
      Parameters:
      entity - the entity
      url - the model source URL
      modelSource - the model source text
      defaults - the model defaults used when the entity was created from the model source
      Throws:
      ModelException - if file does not exist or is not a regular file
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getEntity

      public Entity getEntity()
      Description copied from interface: EntityInfo
      Gets the entity.
      Specified by:
      getEntity in interface EntityInfo
      Returns:
      the entity
    • getURL

      public URL getURL()
      Description copied from interface: EntityInfo
      Gets the URL of the model source.
      Specified by:
      getURL in interface EntityInfo
      Returns:
      the URL
    • isFile

      public boolean isFile()
      Description copied from interface: EntityInfo
      Returns true if the URL points to a file.
      Specified by:
      isFile in interface EntityInfo
      Returns:
      true if URL is a file, else some other URL
    • getFile

      public File getFile() throws ModelException
      Description copied from interface: EntityInfo
      Gets the model file.
      Specified by:
      getFile in interface EntityInfo
      Returns:
      the file
      Throws:
      ModelException - if the URL does not represent a file in the filesystem
    • getModelSource

      public String getModelSource()
      Description copied from interface: EntityInfo
      Gets the source text of the model for this entity.
      Specified by:
      getModelSource in interface EntityInfo
      Returns:
      the source text
    • getModelDefaults

      public ModelDefaults getModelDefaults()
      Description copied from interface: EntityInfo
      Gets the model defaults used when the entity was created from the model source.
      Specified by:
      getModelDefaults in interface EntityInfo
      Returns:
      the defaults, null if none
    • hasChanged

      public boolean hasChanged()
      Description copied from interface: EntityInfo
      Returns whether the model file has changed.
      Specified by:
      hasChanged in interface EntityInfo
      Returns:
      true if changed, always false if URL is not a file