Class PatternMatchModel
- java.lang.Object
-
- org.eclipse.epsilon.eol.models.Model
-
- org.eclipse.epsilon.epl.execute.model.PatternMatchModel
-
- All Implemented Interfaces:
AutoCloseable
,IModel
public class PatternMatchModel extends Model
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Set<Object>>
componentMap
protected Set<PatternMatch>
matches
protected Map<String,Collection<PatternMatch>>
matchMap
-
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 PatternMatchModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMatch(PatternMatch match)
void
addMatches(Collection<PatternMatch> matches)
Collection<?>
allContents()
Returns a collection containing all of the objects contained in this model.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)
Set<PatternMatch>
getMatches()
IPropertyGetter
getPropertyGetter()
IPropertySetter
getPropertySetter()
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)
void
setPatterns(Collection<Pattern> patterns)
boolean
store()
boolean
store(String location)
String
toString()
-
Methods inherited from class org.eclipse.epsilon.eol.models.Model
allInstances, createInstance, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getTransactionSupport, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, load, setName, setReadOnLoad, setStoredOnDisposal
-
-
-
-
Field Detail
-
matchMap
protected final Map<String,Collection<PatternMatch>> matchMap
-
matches
protected final Set<PatternMatch> matches
-
-
Method Detail
-
dispose
public void dispose()
-
addMatches
public void addMatches(Collection<PatternMatch> matches)
- Parameters:
matches
-- Since:
- 1.6
-
addMatch
public void addMatch(PatternMatch match)
-
setPatterns
public void setPatterns(Collection<Pattern> patterns)
-
load
public void load() throws EolModelLoadingException
- Throws:
EolModelLoadingException
-
getEnumerationValue
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException
-
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.
-
getMatches
public Set<PatternMatch> getMatches()
-
getAllOfType
public Collection<?> getAllOfType(String type) throws EolModelElementTypeNotFoundException
-
getAllOfKind
public Collection<?> getAllOfKind(String type) throws EolModelElementTypeNotFoundException
-
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 type) 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.
-
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.
-
hasType
public boolean hasType(String type)
-
store
public boolean store(String location)
-
store
public boolean store()
-
getPropertyGetter
public IPropertyGetter getPropertyGetter()
- Specified by:
getPropertyGetter
in interfaceIModel
- Overrides:
getPropertyGetter
in classModel
-
getPropertySetter
public IPropertySetter getPropertySetter()
- Specified by:
getPropertySetter
in interfaceIModel
- Overrides:
getPropertySetter
in classModel
-
-