Package org.eclipse.epsilon.emc.hutn
Class HutnModel
java.lang.Object
org.eclipse.epsilon.eol.models.Model
org.eclipse.epsilon.emc.hutn.HutnModel
- All Implemented Interfaces:
AutoCloseable,IAdaptableModel,IModel,IReflectiveModel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.epsilon.eol.models.IModel
IModel.AmbiguityCheckResult -
Field Summary
FieldsFields inherited from class org.eclipse.epsilon.eol.models.Model
aliases, ENV_PREFIX, name, PROPERTY_ALIASES, PROPERTY_NAME, PROPERTY_READONLOAD, PROPERTY_READONLY, PROPERTY_STOREONDISPOSAL, propertyGetter, propertySetter, readOnLoad, storeOnDisposal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TTries to adapt the model to a different type.Collection<?>Returns a collection containing all of the objects contained in this model.createInstance(String type) voiddeleteElement(Object instance) Collection<?>getAllOfKind(String type) Collection<?>getAllOfType(String type) getContainerOf(Object object) Returns the model element that contains the given model element, or null if the given model element is top-level.getElementById(String id) getElementId(Object instance) getEnumerationLabelOf(Object literal) Returns the enumeration label of the literal parameter.getEnumerationTypeOf(Object literal) Returns the name of the enumeration type of the literal parameter.getEnumerationValue(String enumeration, String label) getPropertiesOf(String type) Returns a collection containing all of the properties that instances of type know about.getTypeNameOf(Object instance) Returns a string representing the type of the instance object.booleanhasPackage(String packageName) Returns true iff this model contains a package with the given name.booleanhasProperty(String type, String property) booleanbooleanisEnumerationValue(Object object) Returns true iff object is an enumeration value.booleanisInstantiable(String type) booleanisLoaded()booleanisModelElement(Object instance) Used to test whether a Java object can be contained by this model.voidload()voidload(StringProperties properties, IRelativePathResolver resolver) booleanUsed to test whether an object is contained in this model.booleanPrevents the loading of model elements that are referenced by this model but are not contained in this model.voidsetElementId(Object instance, String newId) booleanstore()booleantoString()Methods inherited from class org.eclipse.epsilon.eol.models.Model
allInstances, createInstance, dispose, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getTransactionSupport, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, setName, setReadOnLoad, setStoredOnDisposalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.epsilon.eol.models.IModel
checkAmbiguity, close, createInstance, dispose, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getTransactionSupport, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, setName, setReadOnLoad, setStoredOnDisposal
-
Field Details
-
PROPERTY_SOURCE_FILE
- See Also:
-
-
Constructor Details
-
HutnModel
public HutnModel() -
HutnModel
-
-
Method Details
-
preventLoadingOfExternalModelElements
public boolean preventLoadingOfExternalModelElements()Description copied from interface:IReflectiveModelPrevents the loading of model elements that are referenced by this model but are not contained in this model. This is useful for clients, such as Epsilon Flock, which create a clone or conservative copy of this model.- Specified by:
preventLoadingOfExternalModelElementsin interfaceIReflectiveModel- Returns:
- true iff this method had an effect (i.e. when this model supports external references, was configured to load external references and is no longer configured to load external references).
-
load
- Specified by:
loadin interfaceIModel- Throws:
EolModelLoadingException
-
load
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException - Specified by:
loadin interfaceIModel- Overrides:
loadin classModel- Throws:
EolModelLoadingException
-
isLoaded
public boolean isLoaded()- Since:
- 1.6
-
getPropertyGetter
- Specified by:
getPropertyGetterin interfaceIModel- Overrides:
getPropertyGetterin classModel
-
getPropertySetter
- Specified by:
getPropertySetterin interfaceIModel- Specified by:
getPropertySetterin interfaceIReflectiveModel- Overrides:
getPropertySetterin classModel
-
store
-
store
public boolean store() -
toString
-
getEnumerationValue
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException - Specified by:
getEnumerationValuein interfaceIModel- Throws:
EolEnumerationValueNotFoundException
-
allContents
Description copied from interface:IModelReturns a collection containing all of the objects contained in this model.- Specified by:
allContentsin interfaceIModel- Returns:
- all of the objects contained in this model.
-
getAllOfType
- Specified by:
getAllOfTypein interfaceIModel- Throws:
EolModelElementTypeNotFoundException
-
getAllOfKind
- Specified by:
getAllOfKindin interfaceIModel- Throws:
EolModelElementTypeNotFoundException
-
getTypeOf
-
getTypeNameOf
Description copied from interface:IModelReturns a string representing the type of the instance object. The value returned by this function can be passed to createInstance to instantiate another object of the same type as instance.- Specified by:
getTypeNameOfin interfaceIModel- Parameters:
instance- The model object whose type is to be determined.- Returns:
- the name of the type of the model object, instance.
-
createInstance
public Object createInstance(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException - Specified by:
createInstancein interfaceIModel- Throws:
EolModelElementTypeNotFoundExceptionEolNotInstantiableModelElementTypeException
-
getElementById
- Specified by:
getElementByIdin interfaceIModel
-
getElementId
- Specified by:
getElementIdin interfaceIModel
-
setElementId
- Specified by:
setElementIdin interfaceIModel
-
deleteElement
- Specified by:
deleteElementin interfaceIModel- Throws:
EolRuntimeException
-
owns
Description copied from interface:IModelUsed to test whether an object is contained in this model. -
isInstantiable
- Specified by:
isInstantiablein interfaceIModel
-
isModelElement
Description copied from interface:IModelUsed to test whether a Java object can be contained by this model. For example, EMF models can contain instances of EObject, but not instances of just Object.- Specified by:
isModelElementin interfaceIModel- Overrides:
isModelElementin classModel- Parameters:
instance- the Java object to test.- Returns:
- true if and only if instance can be contained by this model.
-
hasType
-
hasPackage
Description copied from interface:IReflectiveModelReturns true iff this model contains a package with the given name. In general, a "package" is a group of types (and potentially other packages) and a namespace for the grouped elements. The precise semantics of "package" is specific to the implementation. For example, an Ecore implementation might use EPackage. An XML implementation might use XML namespaces. A CSV implementation might not support any notion of packages (and hence always return false).- Specified by:
hasPackagein interfaceIReflectiveModel
-
getContainerOf
Description copied from interface:IReflectiveModelReturns the model element that contains the given model element, or null if the given model element is top-level.- Specified by:
getContainerOfin interfaceIReflectiveModel- Parameters:
object- The model element whose container is to be found.- Returns:
- the model element that contains object, or null if object is not contained in any other model element.
-
getPropertiesOf
Description copied from interface:IReflectiveModelReturns a collection containing all of the properties that instances of type know about.- Specified by:
getPropertiesOfin interfaceIReflectiveModel- Parameters:
type- The type of model object whose properties are to be determined.- Returns:
- all of the properties that instances of type knows about.
- Throws:
EolModelElementTypeNotFoundException- when this model has no such type
-
hasProperty
public boolean hasProperty(String type, String property) throws EolModelElementTypeNotFoundException - Specified by:
hasPropertyin interfaceIReflectiveModel- Throws:
EolModelElementTypeNotFoundException
-
isEnumerationValue
Description copied from interface:IReflectiveModelReturns true iff object is an enumeration value.- Specified by:
isEnumerationValuein interfaceIReflectiveModel
-
getEnumerationTypeOf
Description copied from interface:IReflectiveModelReturns the name of the enumeration type of the literal parameter.- Specified by:
getEnumerationTypeOfin interfaceIReflectiveModel- Throws:
EolNotAnEnumerationValueException- when literal is not an enumeration value
-
getEnumerationLabelOf
Description copied from interface:IReflectiveModelReturns the enumeration label of the literal parameter.- Specified by:
getEnumerationLabelOfin interfaceIReflectiveModel- Throws:
EolNotAnEnumerationValueException- when literal is not an enumeration value
-
adaptTo
Description copied from interface:IAdaptableModelTries to adapt the model to a different type. If it is not possible, this method should returnnull.- Specified by:
adaptToin interfaceIAdaptableModel- Parameters:
modelType- Type to which this model should be adapted.- Returns:
- Non-null value if the model could be adapted,
nullotherwise.
-