Class CompositeModel
- java.lang.Object
-
- org.eclipse.epsilon.eol.models.Model
-
- org.eclipse.epsilon.emc.composite.CompositeModel
-
- All Implemented Interfaces:
AutoCloseable,IModel
public class CompositeModel extends Model
-
-
Field Summary
Fields Modifier and Type Field Description protected ArrayList<ArrayList<Object>>equivalentsprotected Collection<IModel>models-
Fields 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 Constructor Description CompositeModel(String name, Collection<IModel> models)CompositeModel(Collection<IModel> models)CompositeModel(Collection<IModel> models, MatchTrace matchTrace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<?>allContents()Returns a collection containing all of the objects contained in this model.ObjectcreateInstance(String type)voiddeleteElement(Object instance)voiddispose()protected voidfindEquivalents(MatchTrace matchTrace)Collection<Object>getAllOfKind(String type)Collection<Object>getAllOfType(String type)ObjectgetElementById(String id)StringgetElementId(Object instance)ObjectgetEnumerationValue(String enumeration, String label)Collection<Object>getEquivalents(Object instance)IPropertySettergetPropertySetter()StringgetTypeNameOf(Object instance)Returns a string representing the type of the instance object.ObjectgetTypeOf(Object instance)booleanhasType(String type)booleanisInstantiable(String type)booleanisModelElement(Object instance)Used to test whether a Java object can be contained by this model.voidload()booleanowns(Object instance)Used to test whether an object is contained in this model.protected voidremoveDuplicates(Collection<Object> original)voidremoveDuplicates(Collection<Object> original, Collection<Object> equivalents)voidsetElementId(Object instance, String newId)booleanstore()booleanstore(String location)-
Methods inherited from class org.eclipse.epsilon.eol.models.Model
allInstances, createInstance, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getTransactionSupport, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, load, setName, setReadOnLoad, setStoredOnDisposal
-
-
-
-
Field Detail
-
models
protected Collection<IModel> models
-
-
Constructor Detail
-
CompositeModel
public CompositeModel(Collection<IModel> models)
-
CompositeModel
public CompositeModel(String name, Collection<IModel> models)
-
CompositeModel
public CompositeModel(Collection<IModel> models, MatchTrace matchTrace)
-
-
Method Detail
-
findEquivalents
protected void findEquivalents(MatchTrace matchTrace)
-
getEquivalents
public Collection<Object> getEquivalents(Object instance)
-
removeDuplicates
public void removeDuplicates(Collection<Object> original, Collection<Object> equivalents)
-
removeDuplicates
protected void removeDuplicates(Collection<Object> original)
-
allContents
public Collection<?> allContents()
Description copied from interface:IModelReturns a collection containing all of the objects contained in this model.- Returns:
- all of the objects contained in this model.
-
createInstance
public Object createInstance(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
-
deleteElement
public void deleteElement(Object instance) throws EolRuntimeException
- Throws:
EolRuntimeException
-
getAllOfKind
public Collection<Object> getAllOfKind(String type) throws EolModelElementTypeNotFoundException
-
getAllOfType
public Collection<Object> getAllOfType(String type) throws EolModelElementTypeNotFoundException
-
getEnumerationValue
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException
-
getTypeNameOf
public String getTypeNameOf(Object instance)
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.- Parameters:
instance- The model object whose type is to be determined.- Returns:
- the name of the type of the model object, instance.
-
hasType
public boolean hasType(String type)
-
isInstantiable
public boolean isInstantiable(String type)
-
isModelElement
public boolean isModelElement(Object instance)
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.
-
load
public void load() throws EolModelLoadingException- Throws:
EolModelLoadingException
-
owns
public boolean owns(Object instance)
Description copied from interface:IModelUsed to test whether an object is contained in this model.- Parameters:
instance- the Java object to test.- Returns:
- true if and only if instance is contained by this model.
-
dispose
public void dispose()
-
store
public boolean store(String location)
-
store
public boolean store()
-
getPropertySetter
public IPropertySetter getPropertySetter()
- Specified by:
getPropertySetterin interfaceIModel- Overrides:
getPropertySetterin classModel
-
-