Package org.eclipse.epsilon.eol.models
Class ReflectiveModelReference
java.lang.Object
org.eclipse.epsilon.eol.models.ModelReference
org.eclipse.epsilon.eol.models.ReflectiveModelReference
- All Implemented Interfaces:
AutoCloseable
,IOperationContributorProvider
,IWrapper
,IAdaptableModel
,IModel
,IReflectiveModel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.epsilon.eol.models.IModel
IModel.AmbiguityCheckResult
-
Field Summary
Fields inherited from class org.eclipse.epsilon.eol.models.ModelReference
aliases, name, target
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContainerOf
(Object object) Returns the model element that contains the given model element, or null if the given model element is top-level.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.getPropertiesOf
(String type) Returns a collection containing all of the properties that instances of type know about.boolean
hasPackage
(String packageName) Returns true iff this model contains a package with the given name.boolean
hasProperty
(String type, String property) boolean
isEnumerationValue
(Object object) Returns true iff object is an enumeration value.boolean
Prevents the loading of model elements that are referenced by this model but are not contained in this model.Methods inherited from class org.eclipse.epsilon.eol.models.ModelReference
adaptTo, allContents, createInstance, createInstance, deleteElement, dispose, getAliases, getAllOfKind, getAllOfType, getElementById, getElementId, getEnumerationValue, getFullyQualifiedTypeNameOf, getMetamodel, getName, getOperationContributor, getPropertyGetter, getTarget, getTransactionSupport, getTypeNameOf, getTypeOf, getWrapped, hasType, isInstantiable, isModelElement, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, load, load, owns, setElementId, setName, setReadOnLoad, setStoredOnDisposal, store, store
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
allContents, checkAmbiguity, close, createInstance, createInstance, deleteElement, dispose, getAliases, getAllOfKind, getAllOfType, getElementById, getElementId, getEnumerationValue, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getTransactionSupport, getTypeNameOf, getTypeOf, hasType, isInstantiable, isModelElement, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, load, load, owns, setElementId, setName, setReadOnLoad, setStoredOnDisposal, store, store
-
Constructor Details
-
ReflectiveModelReference
-
-
Method Details
-
preventLoadingOfExternalModelElements
public boolean preventLoadingOfExternalModelElements()Description copied from interface:IReflectiveModel
Prevents 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:
preventLoadingOfExternalModelElements
in 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).
-
getPropertySetter
- Specified by:
getPropertySetter
in interfaceIModel
- Specified by:
getPropertySetter
in interfaceIReflectiveModel
- Overrides:
getPropertySetter
in classModelReference
-
getPropertiesOf
Description copied from interface:IReflectiveModel
Returns a collection containing all of the properties that instances of type know about.- Specified by:
getPropertiesOf
in 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:
hasProperty
in interfaceIReflectiveModel
- Throws:
EolModelElementTypeNotFoundException
-
hasPackage
Description copied from interface:IReflectiveModel
Returns 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:
hasPackage
in interfaceIReflectiveModel
-
isEnumerationValue
Description copied from interface:IReflectiveModel
Returns true iff object is an enumeration value.- Specified by:
isEnumerationValue
in interfaceIReflectiveModel
-
getEnumerationTypeOf
Description copied from interface:IReflectiveModel
Returns the name of the enumeration type of the literal parameter.- Specified by:
getEnumerationTypeOf
in interfaceIReflectiveModel
- Throws:
EolNotAnEnumerationValueException
- when literal is not an enumeration value
-
getEnumerationLabelOf
Description copied from interface:IReflectiveModel
Returns the enumeration label of the literal parameter.- Specified by:
getEnumerationLabelOf
in interfaceIReflectiveModel
- Throws:
EolNotAnEnumerationValueException
- when literal is not an enumeration value
-
getContainerOf
Description copied from interface:IReflectiveModel
Returns the model element that contains the given model element, or null if the given model element is top-level.- Specified by:
getContainerOf
in 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.
-