Package org.eclipse.epsilon.eol.models
Class EmptyModel
- java.lang.Object
-
- org.eclipse.epsilon.eol.models.Model
-
- org.eclipse.epsilon.eol.models.EmptyModel
-
- All Implemented Interfaces:
AutoCloseable
,IModel
public class EmptyModel extends Model
-
-
Field Summary
-
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 EmptyModel()
-
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)
void
deleteElement(Object instance)
void
dispose()
Collection<?>
getAllClasses(boolean onlyConcrete)
Collection<?>
getAllOfKind(String metaClass)
Collection<?>
getAllOfType(String metaClass)
Collection<?>
getAllSubtypes(String metaClass)
Collection<?>
getAllSupertypes(String metaClass)
String
getClassOf(Object instance)
Object
getElementById(String id)
String
getElementId(Object instance)
Object
getEnumerationValue(String enumeration, String label)
String
getMetaModel()
Collection<String>
getPropertiesOf(String type)
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
isLoaded()
boolean
isModelElement(Object instance)
Used to test whether a Java object can be contained by this model.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, createInstance, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getPropertySetter, getTransactionSupport, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, setName, setReadOnLoad, setStoredOnDisposal
-
-
-
-
Method Detail
-
load
public void load() throws EolModelLoadingException
- Throws:
EolModelLoadingException
-
getMetaModel
public String getMetaModel()
-
getAllOfType
public Collection<?> getAllOfType(String metaClass) throws EolModelElementTypeNotFoundException
-
getAllOfKind
public Collection<?> getAllOfKind(String metaClass) throws EolModelElementTypeNotFoundException
-
getAllSupertypes
public Collection<?> getAllSupertypes(String metaClass) throws EolModelElementTypeNotFoundException
-
getAllSubtypes
public Collection<?> getAllSubtypes(String metaClass) throws EolModelElementTypeNotFoundException
-
getAllClasses
public Collection<?> getAllClasses(boolean onlyConcrete)
-
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.
-
getPropertiesOf
public Collection<String> getPropertiesOf(String type)
-
createInstance
public Object createInstance(String metaClass) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
-
deleteElement
public void deleteElement(Object instance)
-
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.
-
store
public boolean store(String fileName)
-
store
public boolean store()
-
dispose
public void dispose()
-
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.
-
isInstantiable
public boolean isInstantiable(String metaClass)
-
hasType
public boolean hasType(String metaClass)
-
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.
-
isLoaded
public boolean isLoaded()
- Since:
- 1.6
-
-