Class JavaObjectModel
- java.lang.Object
-
- org.eclipse.epsilon.eol.models.Model
-
- org.eclipse.epsilon.eol.models.java.JavaObjectModel
-
- All Implemented Interfaces:
AutoCloseable
,IModel
public class JavaObjectModel extends Model
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.epsilon.eol.models.IModel
IModel.AmbiguityCheckResult
-
-
Field Summary
Fields Modifier and Type Field Description protected Collection<Object>
contents
protected List<String>
importedPackages
-
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 JavaObjectModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Object>
allContents()
Returns a collection containing all of the objects contained in this model.Class<?>
classForName(String type)
Object
createInstance(String type)
void
deleteElement(Object instance)
void
dispose()
Collection<?>
getAllOfKind(String type)
Collection<?>
getAllOfType(String type)
Object
getElementById(String id)
String
getElementId(Object instance)
Object
getEnumerationValue(String enumeration, String label)
List<String>
getImportedPackages()
protected Class<?>
getJavaClass(String name)
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 type)
boolean
isInstantiable(String type)
boolean
isModelElement(Object instance)
Used to test whether a Java object can be contained by this model.void
load()
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 location)
-
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, 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
-
-
-
-
Field Detail
-
contents
protected Collection<Object> contents
-
-
Method Detail
-
allContents
public Collection<Object> 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.
-
createInstance
public Object createInstance(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
-
classForName
public Class<?> classForName(String type) throws EolModelElementTypeNotFoundException
-
deleteElement
public void deleteElement(Object instance) throws EolRuntimeException
- Throws:
EolRuntimeException
-
getAllOfKind
public Collection<?> getAllOfKind(String type) throws EolModelElementTypeNotFoundException
-
getAllOfType
public Collection<?> 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: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.
-
hasType
public boolean hasType(String type)
-
getPropertiesOf
public Collection<String> getPropertiesOf(String type) throws EolModelElementTypeNotFoundException
-
isInstantiable
public boolean isInstantiable(String type)
-
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.
-
load
public void load() throws EolModelLoadingException
- Throws:
EolModelLoadingException
-
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 location)
-
store
public boolean store()
-
-