Package org.eclipse.epsilon.eol.models
Interface IModel
-
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
IAdaptableModel
,IComparableModel
,IGenericSimulinkModel
,IReflectiveModel
- All Known Implementing Classes:
AbstractEmfModel
,AbstractReflectiveEmfModel
,AbstractSimulinkModel
,BibtexModel
,CachedModel
,CachedModelTests.SimpleCachedModel
,CDOModel
,CompositeModel
,ConcreteModel
,CsvModel
,DecoratorEmfModel
,EmfM0Model
,EmfMetaModel
,EmfModel
,EmptyModel
,ExcelModel
,GraphmlModel
,GSModel
,HtmlModel
,HutnModel
,InMemoryEmfModel
,InMemoryFlexmiModel
,JavaModel
,JavaObjectModel
,JdtModel
,Model
,ModelGroup
,ModelReference
,ModelSpy
,MuddleModel
,PatternMatchModel
,PlainXmlModel
,ReflectiveModelReference
,SecureExcelModel
,SecureGSModel
,SimulinkDictionaryModel
,SimulinkDictionaryModelInEclipse
,SimulinkModel
,SimulinkModelInEclipse
,SimulinkRequirementModel
,SimulinkRequirementModelInEclipse
,SpreadsheetModel
,UmlModel
,VirtualEmfModel
,XmlModel
,YamlModel
public interface IModel extends AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IModel.AmbiguityCheckResult
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Collection<?>
allContents()
Returns a collection containing all of the objects contained in this model.default IModel.AmbiguityCheckResult
checkAmbiguity(String type)
Used to test if a given type name is ambiguous or not within a model.default void
close()
Object
createInstance(String type)
Object
createInstance(String type, Collection<Object> parameters)
void
deleteElement(Object instance)
void
dispose()
List<String>
getAliases()
Collection<?>
getAllOfKind(String kind)
Collection<?>
getAllOfType(String type)
Object
getElementById(String id)
String
getElementId(Object instance)
Object
getEnumerationValue(String enumeration, String label)
String
getFullyQualifiedTypeNameOf(Object instance)
Returns a string representing the fully-qualified type of the instance object.Metamodel
getMetamodel(StringProperties properties, IRelativePathResolver resolver)
String
getName()
IPropertyGetter
getPropertyGetter()
IPropertySetter
getPropertySetter()
IModelTransactionSupport
getTransactionSupport()
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.boolean
isOfKind(Object instance, String type)
boolean
isOfType(Object instance, String type)
boolean
isPropertySet(Object instance, String property)
Returnstrue
if this instance has an explicit value for this property.boolean
isReadOnLoad()
boolean
isStoredOnDisposal()
boolean
knowsAboutProperty(Object instance, String property)
Returnstrue
if this instance could have this property at some point.void
load()
void
load(StringProperties properties)
void
load(StringProperties properties, String basePath)
void
load(StringProperties properties, IRelativePathResolver relativePathResolver)
boolean
owns(Object instance)
Used to test whether an object is contained in this model.void
setElementId(Object instance, String newId)
void
setName(String name)
void
setReadOnLoad(boolean readOnLoad)
void
setStoredOnDisposal(boolean storedOnDisposal)
boolean
store()
boolean
store(String location)
-
-
-
Method Detail
-
load
void load(StringProperties properties) throws EolModelLoadingException
- Throws:
EolModelLoadingException
-
load
void load(StringProperties properties, String basePath) throws EolModelLoadingException
- Throws:
EolModelLoadingException
-
load
void load(StringProperties properties, IRelativePathResolver relativePathResolver) throws EolModelLoadingException
- Throws:
EolModelLoadingException
-
load
void load() throws EolModelLoadingException
- Throws:
EolModelLoadingException
-
getName
String getName()
-
setName
void setName(String name)
-
getEnumerationValue
Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException
-
allContents
Collection<?> allContents()
Returns a collection containing all of the objects contained in this model.- Returns:
- all of the objects contained in this model.
-
getAllOfType
Collection<?> getAllOfType(String type) throws EolModelElementTypeNotFoundException
-
getAllOfKind
Collection<?> getAllOfKind(String kind) throws EolModelElementTypeNotFoundException
-
getTypeNameOf
String getTypeNameOf(Object instance)
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.
- Throws:
IllegalArgumentException
- when isModelElement(instance) returns false
-
getFullyQualifiedTypeNameOf
String getFullyQualifiedTypeNameOf(Object instance)
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.- Parameters:
instance
- The model object whose type is to be determined.- Returns:
- the name of the type of the model object, instance.
- Throws:
IllegalArgumentException
- when isModelElement(instance) returns false
-
createInstance
Object createInstance(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
-
createInstance
Object createInstance(String type, Collection<Object> parameters) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
-
deleteElement
void deleteElement(Object instance) throws EolRuntimeException
- Throws:
EolRuntimeException
-
isOfKind
boolean isOfKind(Object instance, String type) throws EolModelElementTypeNotFoundException
-
isOfType
boolean isOfType(Object instance, String type) throws EolModelElementTypeNotFoundException
-
owns
boolean owns(Object instance)
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
boolean knowsAboutProperty(Object instance, String property)
Returnstrue
if this instance could have this property at some point.
-
isPropertySet
boolean isPropertySet(Object instance, String property) throws EolRuntimeException
Returnstrue
if this instance has an explicit value for this property. This would be equivalent to eIsSet in EMF.- Throws:
EolRuntimeException
-
isInstantiable
boolean isInstantiable(String type)
-
isModelElement
boolean isModelElement(Object instance)
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.- Parameters:
instance
- the Java object to test.- Returns:
- true if and only if instance can be contained by this model.
-
hasType
boolean hasType(String type)
-
checkAmbiguity
default IModel.AmbiguityCheckResult checkAmbiguity(String type)
Used to test if a given type name is ambiguous or not within a model. For example, the package registry in an EMF model could include multiple EClasses with the same name.
-
store
boolean store(String location)
-
store
boolean store()
-
dispose
void dispose()
-
getPropertyGetter
IPropertyGetter getPropertyGetter()
-
getPropertySetter
IPropertySetter getPropertySetter()
-
isStoredOnDisposal
boolean isStoredOnDisposal()
-
setStoredOnDisposal
void setStoredOnDisposal(boolean storedOnDisposal)
-
isReadOnLoad
boolean isReadOnLoad()
-
setReadOnLoad
void setReadOnLoad(boolean readOnLoad)
-
getTransactionSupport
IModelTransactionSupport getTransactionSupport()
-
getMetamodel
Metamodel getMetamodel(StringProperties properties, IRelativePathResolver resolver)
-
close
default void close()
- Specified by:
close
in interfaceAutoCloseable
- Since:
- 1.6
-
-