Package org.eclipse.epsilon.eol.models
Class Model
java.lang.Object
org.eclipse.epsilon.eol.models.Model
- All Implemented Interfaces:
AutoCloseable
,IModel
- Direct Known Subclasses:
CachedModel
,CompositeModel
,EmptyModel
,HutnModel
,JavaModel
,JavaObjectModel
,ModelGroup
,MuddleModel
,PatternMatchModel
,SpreadsheetModel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.epsilon.eol.models.IModel
IModel.AmbiguityCheckResult
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
Used for acquiring properties externally (e.g.protected String
static final String
static final String
static final String
static final String
Indicates that the model will not be modified.static final String
protected IPropertyGetter
protected IPropertySetter
protected boolean
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<?>
createInstance
(String type, Collection<Object> parameters) void
dispose()
getFullyQualifiedTypeNameOf
(Object instance) Returns a string representing the fully-qualified type of the instance object.getMetamodel
(StringProperties properties, IRelativePathResolver resolver) getName()
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
(StringProperties properties) void
load
(StringProperties properties, String basePath) void
load
(StringProperties properties, IRelativePathResolver resolver) void
void
setReadOnLoad
(boolean readOnLoad) void
setStoredOnDisposal
(boolean storedOnDisposal) 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, deleteElement, getAllOfKind, getAllOfType, getElementById, getElementId, getEnumerationValue, getTypeNameOf, hasType, isInstantiable, load, owns, setElementId, store, store
-
Field Details
-
PROPERTY_NAME
- See Also:
-
PROPERTY_READONLOAD
- See Also:
-
PROPERTY_STOREONDISPOSAL
- See Also:
-
PROPERTY_ALIASES
- See Also:
-
PROPERTY_READONLY
Indicates that the model will not be modified.- Since:
- 1.6
- See Also:
-
ENV_PREFIX
Used for acquiring properties externally (e.g. from environment variables)- Since:
- 1.6
- See Also:
-
name
-
aliases
-
storeOnDisposal
protected boolean storeOnDisposal -
readOnLoad
protected boolean readOnLoad -
propertyGetter
- Since:
- 1.6
-
propertySetter
- Since:
- 1.6
-
-
Constructor Details
-
Model
public Model()
-
-
Method Details
-
getName
-
setName
-
getAliases
- Specified by:
getAliases
in interfaceIModel
-
load
- Specified by:
load
in interfaceIModel
- Throws:
EolModelLoadingException
-
load
- Specified by:
load
in interfaceIModel
- Throws:
EolModelLoadingException
-
load
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException - Specified by:
load
in interfaceIModel
- Throws:
EolModelLoadingException
-
createInstance
public Object createInstance(String type, Collection<Object> parameters) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException - Specified by:
createInstance
in interfaceIModel
- Throws:
EolModelElementTypeNotFoundException
EolNotInstantiableModelElementTypeException
-
allInstances
-
isOfKind
public boolean isOfKind(Object instance, String metaClass) throws EolModelElementTypeNotFoundException - Specified by:
isOfKind
in interfaceIModel
- Throws:
EolModelElementTypeNotFoundException
-
isOfType
public boolean isOfType(Object instance, String metaClass) throws EolModelElementTypeNotFoundException - Specified by:
isOfType
in interfaceIModel
- Throws:
EolModelElementTypeNotFoundException
-
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.
-
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.
-
getTypeOf
-
isReadOnLoad
public boolean isReadOnLoad()- Specified by:
isReadOnLoad
in interfaceIModel
-
isStoredOnDisposal
public boolean isStoredOnDisposal()- Specified by:
isStoredOnDisposal
in interfaceIModel
-
setReadOnLoad
public void setReadOnLoad(boolean readOnLoad) - Specified by:
setReadOnLoad
in interfaceIModel
-
setStoredOnDisposal
public void setStoredOnDisposal(boolean storedOnDisposal) - Specified by:
setStoredOnDisposal
in interfaceIModel
-
getPropertyGetter
- Specified by:
getPropertyGetter
in interfaceIModel
-
getPropertySetter
- Specified by:
getPropertySetter
in interfaceIModel
-
dispose
public void dispose() -
knowsAboutProperty
Description copied from interface:IModel
Returnstrue
if this instance could have this property at some point.- Specified by:
knowsAboutProperty
in interfaceIModel
-
getTransactionSupport
- Specified by:
getTransactionSupport
in interfaceIModel
-
getMetamodel
- Specified by:
getMetamodel
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
-