Package org.eclipse.epsilon.eol.models
Class ModelGroup
- java.lang.Object
-
- org.eclipse.epsilon.eol.models.Model
-
- org.eclipse.epsilon.eol.models.ModelGroup
-
- All Implemented Interfaces:
AutoCloseable
,IModel
public class ModelGroup extends Model
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ModelGroup.DelegatingModelElementPropertyGetter
class
ModelGroup.DelegatingModelElementPropertySetter
-
Nested classes/interfaces inherited from interface org.eclipse.epsilon.eol.models.IModel
IModel.AmbiguityCheckResult
-
-
Field Summary
Fields Modifier and Type Field Description protected ArrayList<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 ModelGroup()
ModelGroup(ModelRepository repository, String metaModel)
-
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.Object
createInstance(String metaClass)
Object
createInstance(String metaClass, Collection<Object> parameters)
void
deleteElement(Object instance)
void
dispose()
Collection<?>
getAllOfKind(String metaClass)
Collection<?>
getAllOfType(String metaClass)
Object
getElementById(String id)
String
getElementId(Object instance)
Object
getEnumerationValue(String enumeration, String label)
String
getMetaModel()
ArrayList<IModel>
getModels()
IPropertySetter
getPropertySetter()
String
getTypeNameOf(Object instance)
Returns a string representing the type of the instance object.Object
getTypeOf(Object instance)
boolean
hasType(String metaClass)
boolean
isInstantiable(String metaClass)
boolean
isModelElement(Object instance)
Used to test whether a Java object can be contained by this model.boolean
isOfKind(Object instance, String metaClass)
boolean
isOfType(Object instance, String metaClass)
boolean
knowsAboutProperty(Object instance, String property)
Returnstrue
if this instance could have this property at some point.void
load()
void
load(StringProperties properties, IRelativePathResolver resolver)
boolean
owns(Object instance)
Used to test whether an object is contained in this model.void
setElementId(Object instance, String newId)
boolean
store()
boolean
store(String fileName)
-
Methods inherited from class org.eclipse.epsilon.eol.models.Model
allInstances, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getTransactionSupport, isPropertySet, isReadOnLoad, isStoredOnDisposal, load, load, setName, setReadOnLoad, setStoredOnDisposal
-
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
-
-
-
-
Constructor Detail
-
ModelGroup
public ModelGroup()
-
ModelGroup
public ModelGroup(ModelRepository repository, String metaModel) throws EolModelNotFoundException
- Throws:
EolModelNotFoundException
-
-
Method Detail
-
load
public void load() throws EolModelLoadingException
- Throws:
EolModelLoadingException
-
getMetaModel
public String getMetaModel()
-
getEnumerationValue
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException
-
getAllOfType
public Collection<?> getAllOfType(String metaClass) throws EolModelElementTypeNotFoundException
-
getAllOfKind
public Collection<?> getAllOfKind(String metaClass) throws EolModelElementTypeNotFoundException
-
allContents
public Collection<?> allContents()
Description copied from interface:IModel
Returns a collection containing all of the objects contained in this model.- Returns:
- all of the objects contained in this model.
-
getTypeNameOf
public String getTypeNameOf(Object instance)
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.- 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 metaClass, Collection<Object> parameters) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
- Specified by:
createInstance
in interfaceIModel
- Overrides:
createInstance
in classModel
- Throws:
EolModelElementTypeNotFoundException
EolNotInstantiableModelElementTypeException
-
createInstance
public Object createInstance(String metaClass) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
-
deleteElement
public void deleteElement(Object instance) throws EolRuntimeException
- Throws:
EolRuntimeException
-
owns
public boolean owns(Object instance)
Description copied from interface:IModel
Used 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.
-
knowsAboutProperty
public boolean knowsAboutProperty(Object instance, String property)
Description copied from interface:IModel
Returnstrue
if this instance could have this property at some point.- Specified by:
knowsAboutProperty
in interfaceIModel
- Overrides:
knowsAboutProperty
in classModel
-
store
public boolean store(String fileName)
-
store
public boolean store()
-
dispose
public void dispose()
-
isInstantiable
public boolean isInstantiable(String metaClass)
-
hasType
public boolean hasType(String metaClass)
-
isOfKind
public boolean isOfKind(Object instance, String metaClass) throws EolModelElementTypeNotFoundException
- Specified by:
isOfKind
in interfaceIModel
- Overrides:
isOfKind
in classModel
- Throws:
EolModelElementTypeNotFoundException
-
isOfType
public boolean isOfType(Object instance, String metaClass) throws EolModelElementTypeNotFoundException
- Specified by:
isOfType
in interfaceIModel
- Overrides:
isOfType
in classModel
- Throws:
EolModelElementTypeNotFoundException
-
load
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException
- Specified by:
load
in interfaceIModel
- Overrides:
load
in classModel
- Throws:
EolModelLoadingException
-
isModelElement
public boolean isModelElement(Object instance)
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
- Overrides:
isModelElement
in classModel
- Parameters:
instance
- the Java object to test.- Returns:
- true if and only if instance can be contained by this model.
-
getPropertySetter
public IPropertySetter getPropertySetter()
- Specified by:
getPropertySetter
in interfaceIModel
- Overrides:
getPropertySetter
in classModel
-
-