Package org.eclipse.epsilon.eol.models
Class ModelReference
java.lang.Object
org.eclipse.epsilon.eol.models.ModelReference
- All Implemented Interfaces:
AutoCloseable,IOperationContributorProvider,IWrapper,IAdaptableModel,IModel
- Direct Known Subclasses:
ReflectiveModelReference
public class ModelReference
extends Object
implements IAdaptableModel, IWrapper, IOperationContributorProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.epsilon.eol.models.IModel
IModel.AmbiguityCheckResult -
Field Summary
Fields -
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) createInstance(String type, Collection<Object> parameters) voiddeleteElement(Object instance) voiddispose()Collection<?>getAllOfKind(String type) Collection<?>getAllOfType(String type) getElementById(String id) getElementId(Object instance) getEnumerationValue(String enumeration, String label) getFullyQualifiedTypeNameOf(Object instance) Returns a string representing the fully-qualified type of the instance object.getMetamodel(StringProperties properties, IRelativePathResolver resolver) getName()getTypeNameOf(Object instance) Returns a string representing the type of the instance object.booleanbooleanisInstantiable(String type) booleanisModelElement(Object instance) Used to test whether a Java object can be contained by this model.booleanbooleanbooleanisPropertySet(Object instance, String property) Returnstrueif this instance has an explicit value for this property.booleanbooleanbooleanknowsAboutProperty(Object instance, String property) Returnstrueif this instance could have this property at some point.voidload()voidload(StringProperties properties) voidload(StringProperties properties, String basePath) voidload(StringProperties properties, IRelativePathResolver resolver) booleanUsed to test whether an object is contained in this model.voidsetElementId(Object instance, String newId) voidvoidsetReadOnLoad(boolean readOnLoad) voidsetStoredOnDisposal(boolean storedOnDisposal) booleanstore()booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.epsilon.eol.models.IModel
checkAmbiguity, close
-
Field Details
-
target
-
name
-
aliases
-
-
Constructor Details
-
ModelReference
-
-
Method Details
-
getTarget
-
getName
-
setName
-
getAliases
- Specified by:
getAliasesin interfaceIModel
-
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.
-
createInstance
public Object createInstance(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException - Specified by:
createInstancein interfaceIModel- Throws:
EolModelElementTypeNotFoundExceptionEolNotInstantiableModelElementTypeException
-
deleteElement
- Specified by:
deleteElementin interfaceIModel- Throws:
EolRuntimeException
-
dispose
public void dispose() -
getAllOfKind
- Specified by:
getAllOfKindin interfaceIModel- Throws:
EolModelElementTypeNotFoundException
-
getAllOfType
- Specified by:
getAllOfTypein interfaceIModel- Throws:
EolModelElementTypeNotFoundException
-
getEnumerationValue
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException - Specified by:
getEnumerationValuein interfaceIModel- Throws:
EolEnumerationValueNotFoundException
-
getElementById
- Specified by:
getElementByIdin interfaceIModel
-
getElementId
- Specified by:
getElementIdin interfaceIModel
-
setElementId
- Specified by:
setElementIdin interfaceIModel
-
getPropertyGetter
- Specified by:
getPropertyGetterin interfaceIModel
-
getPropertySetter
- Specified by:
getPropertySetterin interfaceIModel
-
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.
-
getFullyQualifiedTypeNameOf
Description copied from interface:IModelReturns a string representing the fully-qualified 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:
getFullyQualifiedTypeNameOfin interfaceIModel- Parameters:
instance- The model object whose type is to be determined.- Returns:
- the name of the type of the model object, instance.
-
hasType
-
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- Parameters:
instance- the Java object to test.- Returns:
- true if and only if instance can be contained by this model.
-
isOfKind
- Specified by:
isOfKindin interfaceIModel- Throws:
EolModelElementTypeNotFoundException
-
isOfType
- Specified by:
isOfTypein interfaceIModel- Throws:
EolModelElementTypeNotFoundException
-
isReadOnLoad
public boolean isReadOnLoad()- Specified by:
isReadOnLoadin interfaceIModel
-
isStoredOnDisposal
public boolean isStoredOnDisposal()- Specified by:
isStoredOnDisposalin interfaceIModel
-
load
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException - Specified by:
loadin interfaceIModel- Throws:
EolModelLoadingException
-
load
- Specified by:
loadin interfaceIModel- Throws:
EolModelLoadingException
-
owns
Description copied from interface:IModelUsed to test whether an object is contained in this model. -
setReadOnLoad
public void setReadOnLoad(boolean readOnLoad) - Specified by:
setReadOnLoadin interfaceIModel
-
setStoredOnDisposal
public void setStoredOnDisposal(boolean storedOnDisposal) - Specified by:
setStoredOnDisposalin interfaceIModel
-
store
-
store
public boolean store() -
getTransactionSupport
- Specified by:
getTransactionSupportin interfaceIModel
-
knowsAboutProperty
Description copied from interface:IModelReturnstrueif this instance could have this property at some point.- Specified by:
knowsAboutPropertyin interfaceIModel
-
isPropertySet
Description copied from interface:IModelReturnstrueif this instance has an explicit value for this property. This would be equivalent to eIsSet in EMF.- Specified by:
isPropertySetin interfaceIModel- Throws:
EolRuntimeException
-
createInstance
public Object createInstance(String type, Collection<Object> parameters) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException - Specified by:
createInstancein interfaceIModel- Throws:
EolModelElementTypeNotFoundExceptionEolNotInstantiableModelElementTypeException
-
getWrapped
- Specified by:
getWrappedin interfaceIWrapper
-
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.
-
getOperationContributor
- Specified by:
getOperationContributorin interfaceIOperationContributorProvider
-
load
- Specified by:
loadin interfaceIModel- Throws:
EolModelLoadingException
-
load
- Specified by:
loadin interfaceIModel- Throws:
EolModelLoadingException
-
getMetamodel
- Specified by:
getMetamodelin interfaceIModel
-