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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
Tries 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) void
deleteElement
(Object instance) void
dispose()
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.boolean
boolean
isInstantiable
(String type) boolean
isModelElement
(Object instance) Used to test whether a Java object can be contained by this model.boolean
boolean
boolean
isPropertySet
(Object instance, String property) Returnstrue
if this instance has an explicit value for this property.boolean
boolean
boolean
knowsAboutProperty
(Object instance, String property) Returnstrue
if this instance could have this property at some point.void
load()
void
load
(StringProperties properties) void
load
(StringProperties properties, String basePath) void
load
(StringProperties properties, IRelativePathResolver resolver) boolean
Used to test whether an object is contained in this model.void
setElementId
(Object instance, String newId) void
void
setReadOnLoad
(boolean readOnLoad) void
setStoredOnDisposal
(boolean storedOnDisposal) boolean
store()
boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getAliases
in interfaceIModel
-
allContents
Description copied from interface:IModel
Returns a collection containing all of the objects contained in this model.- Specified by:
allContents
in interfaceIModel
- Returns:
- all of the objects contained in this model.
-
createInstance
public Object createInstance(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException - Specified by:
createInstance
in interfaceIModel
- Throws:
EolModelElementTypeNotFoundException
EolNotInstantiableModelElementTypeException
-
deleteElement
- Specified by:
deleteElement
in interfaceIModel
- Throws:
EolRuntimeException
-
dispose
public void dispose() -
getAllOfKind
- Specified by:
getAllOfKind
in interfaceIModel
- Throws:
EolModelElementTypeNotFoundException
-
getAllOfType
- Specified by:
getAllOfType
in interfaceIModel
- Throws:
EolModelElementTypeNotFoundException
-
getEnumerationValue
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException - Specified by:
getEnumerationValue
in interfaceIModel
- Throws:
EolEnumerationValueNotFoundException
-
getElementById
- Specified by:
getElementById
in interfaceIModel
-
getElementId
- Specified by:
getElementId
in interfaceIModel
-
setElementId
- Specified by:
setElementId
in interfaceIModel
-
getPropertyGetter
- Specified by:
getPropertyGetter
in interfaceIModel
-
getPropertySetter
- Specified by:
getPropertySetter
in interfaceIModel
-
getTypeOf
-
getTypeNameOf
Description copied from interface:IModel
Returns 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:
getTypeNameOf
in 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:IModel
Returns 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:
getFullyQualifiedTypeNameOf
in 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:
isInstantiable
in interfaceIModel
-
isModelElement
Description copied from interface:IModel
Used 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:
isModelElement
in interfaceIModel
- Parameters:
instance
- the Java object to test.- Returns:
- true if and only if instance can be contained by this model.
-
isOfKind
- Specified by:
isOfKind
in interfaceIModel
- Throws:
EolModelElementTypeNotFoundException
-
isOfType
- Specified by:
isOfType
in interfaceIModel
- Throws:
EolModelElementTypeNotFoundException
-
isReadOnLoad
public boolean isReadOnLoad()- Specified by:
isReadOnLoad
in interfaceIModel
-
isStoredOnDisposal
public boolean isStoredOnDisposal()- Specified by:
isStoredOnDisposal
in interfaceIModel
-
load
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException - Specified by:
load
in interfaceIModel
- Throws:
EolModelLoadingException
-
load
- Specified by:
load
in interfaceIModel
- Throws:
EolModelLoadingException
-
owns
Description copied from interface:IModel
Used to test whether an object is contained in this model. -
setReadOnLoad
public void setReadOnLoad(boolean readOnLoad) - Specified by:
setReadOnLoad
in interfaceIModel
-
setStoredOnDisposal
public void setStoredOnDisposal(boolean storedOnDisposal) - Specified by:
setStoredOnDisposal
in interfaceIModel
-
store
-
store
public boolean store() -
getTransactionSupport
- Specified by:
getTransactionSupport
in interfaceIModel
-
knowsAboutProperty
Description copied from interface:IModel
Returnstrue
if this instance could have this property at some point.- Specified by:
knowsAboutProperty
in interfaceIModel
-
isPropertySet
Description copied from interface:IModel
Returnstrue
if this instance has an explicit value for this property. This would be equivalent to eIsSet in EMF.- Specified by:
isPropertySet
in interfaceIModel
- Throws:
EolRuntimeException
-
createInstance
public Object createInstance(String type, Collection<Object> parameters) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException - Specified by:
createInstance
in interfaceIModel
- Throws:
EolModelElementTypeNotFoundException
EolNotInstantiableModelElementTypeException
-
getWrapped
- Specified by:
getWrapped
in interfaceIWrapper
-
adaptTo
Description copied from interface:IAdaptableModel
Tries to adapt the model to a different type. If it is not possible, this method should returnnull
.- Specified by:
adaptTo
in interfaceIAdaptableModel
- Parameters:
modelType
- Type to which this model should be adapted.- Returns:
- Non-null value if the model could be adapted,
null
otherwise.
-
getOperationContributor
- Specified by:
getOperationContributor
in interfaceIOperationContributorProvider
-
load
- Specified by:
load
in interfaceIModel
- Throws:
EolModelLoadingException
-
load
- Specified by:
load
in interfaceIModel
- Throws:
EolModelLoadingException
-
getMetamodel
- Specified by:
getMetamodel
in interfaceIModel
-