java.lang.Object
org.tentackle.model.impl.EntityInfoImpl
- All Implemented Interfaces:
EntityInfo
Entity as a component of a model.
- Author:
- harald
-
Constructor Summary
ConstructorDescriptionEntityInfoImpl
(Entity entity, URL url, String modelSource, ModelDefaults defaults) Creates a model entity. -
Method Summary
Modifier and TypeMethodDescriptionGets the entity.getFile()
Gets the model file.Gets the model defaults used when the entity was created from the model source.Gets the source text of the model for this entity.getURL()
Gets the URL of the model source.boolean
Returns whether the model file has changed.boolean
isFile()
Returns true if the URL points to a file.toString()
-
Constructor Details
-
EntityInfoImpl
public EntityInfoImpl(Entity entity, URL url, String modelSource, ModelDefaults defaults) throws ModelException Creates a model entity.- Parameters:
entity
- the entityurl
- the model source URLmodelSource
- the model source textdefaults
- 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
-
getEntity
Description copied from interface:EntityInfo
Gets the entity.- Specified by:
getEntity
in interfaceEntityInfo
- Returns:
- the entity
-
getURL
Description copied from interface:EntityInfo
Gets the URL of the model source.- Specified by:
getURL
in interfaceEntityInfo
- 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 interfaceEntityInfo
- Returns:
- true if URL is a file, else some other URL
-
getFile
Description copied from interface:EntityInfo
Gets the model file.- Specified by:
getFile
in interfaceEntityInfo
- Returns:
- the file
- Throws:
ModelException
- if the URL does not represent a file in the filesystem
-
getModelSource
Description copied from interface:EntityInfo
Gets the source text of the model for this entity.- Specified by:
getModelSource
in interfaceEntityInfo
- Returns:
- the source text
-
getModelDefaults
Description copied from interface:EntityInfo
Gets the model defaults used when the entity was created from the model source.- Specified by:
getModelDefaults
in interfaceEntityInfo
- 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 interfaceEntityInfo
- Returns:
- true if changed, always false if URL is not a file
-