java.lang.Object
org.tentackle.model.impl.EntityInfoImpl
- All Implemented Interfaces:
EntityInfo
Entity as a component of a model.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionEntityInfoImpl(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.booleanReturns whether the model file has changed.booleanisFile()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:EntityInfoGets the entity.- Specified by:
getEntityin interfaceEntityInfo- Returns:
- the entity
-
getURL
Description copied from interface:EntityInfoGets the URL of the model source.- Specified by:
getURLin interfaceEntityInfo- Returns:
- the URL
-
isFile
public boolean isFile()Description copied from interface:EntityInfoReturns true if the URL points to a file.- Specified by:
isFilein interfaceEntityInfo- Returns:
- true if URL is a file, else some other URL
-
getFile
Description copied from interface:EntityInfoGets the model file.- Specified by:
getFilein interfaceEntityInfo- Returns:
- the file
- Throws:
ModelException- if the URL does not represent a file in the filesystem
-
getModelSource
Description copied from interface:EntityInfoGets the source text of the model for this entity.- Specified by:
getModelSourcein interfaceEntityInfo- Returns:
- the source text
-
getModelDefaults
Description copied from interface:EntityInfoGets the model defaults used when the entity was created from the model source.- Specified by:
getModelDefaultsin interfaceEntityInfo- Returns:
- the defaults, null if none
-
hasChanged
public boolean hasChanged()Description copied from interface:EntityInfoReturns whether the model file has changed.- Specified by:
hasChangedin interfaceEntityInfo- Returns:
- true if changed, always false if URL is not a file
-