Interface MDWObject
-
- All Superinterfaces:
Comparable<Object>,org.eclipse.emf.ecore.EModelElement,org.eclipse.emf.ecore.EObject,org.eclipse.emf.common.notify.Notifier
- All Known Subinterfaces:
MDWEObject
public interface MDWObject extends Comparable<Object>, org.eclipse.emf.ecore.EModelElement
MDWObjectis the root of all modeled objects. Most of method names start with "e" to distinguish the MDWorkbench methods from the client methods.It provides support to call scripts, and gives access to the related model and the metamodel.
This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcompareTo(Object o)Compares this object with the specified object for order using thetoString()method.ExtendedClasseExtendedClass()Returns the type which gives reflective access to structural features.booleaneIsInstanceOf(String typeName)Determines whether this object is an instance of the specified type.booleaneIsInstanceOf(String typeName, String profileName)Determines whether this object is an instance of the specified type and if it matches the specified profile name.booleaneIsProfiled(String profileName, boolean includeSubTypes)Determines whether this object matches the specified profile name.booleaneIsRemoved()Answers whether this object is tagged as removed.MetamodeleMetamodel()Returns the metamodel to which this object is related.StringeMetaTypeName()Returns the simple name of the meta-type ("Actor"or"Activity"for example).ModeleModel()Returns the containing model, ornull.voideRemove()Tag this object as removed.voideSetUniqueID(String uniqueID)Sets the unique ID of this object.StringeUniqueID()Returns the ID which uniquely identifies the object, and which is constant in time.ObjectsuperScript(String scriptName)Invokes the specified script defined on the super-type.ObjectsuperScript(String scriptName, List<?> arguments)Invokes the specified script defined on the super-type.booleantoBoolean(String scriptName)Invokes the specified script and returns abooleanrepresentation of the evaluation result.booleantoBoolean(String scriptName, List<?> arguments)Invokes the specified script and returns abooleanrepresentation of the evaluation result.bytetoByte(String scriptName)Invokes the specified script and returns abyterepresentation of the evaluation result.bytetoByte(String scriptName, List<?> arguments)Invokes the specified script and returns abyterepresentation of the evaluation result.chartoChar(String scriptName)Invokes the specified script and returns acharrepresentation of the evaluation result.chartoChar(String scriptName, List<?> arguments)Invokes the specified script and returns acharrepresentation of the evaluation result.doubletoDouble(String scriptName)Invokes the specified script and returns adoublerepresentation of the evaluation result.doubletoDouble(String scriptName, List<?> arguments)Invokes the specified script and returns adoublerepresentation of the evaluation result.floattoFloat(String scriptName)Invokes the specified script and returns afloatrepresentation of the evaluation result.floattoFloat(String scriptName, List<?> arguments)Invokes the specified script and returns afloatrepresentation of the evaluation result.inttoInt(String scriptName)Invokes the specified script and returns aintrepresentation of the evaluation result.inttoInt(String scriptName, List<?> arguments)Invokes the specified script and returns aintrepresentation of the evaluation result.<E> MDWList<E>toList(E[] values)Converts the specified array to a new modifiableMDWList.<T> MDWList<T>toList(String scriptName)Invokes the specified script and returns aMDWListrepresentation of the evaluation result.<T> MDWList<T>toList(String scriptName, List<?> arguments)Invokes the specified script and returns aMDWListrepresentation of the evaluation result.<E> MDWList<E>toList(Collection<E> values)Converts the specified collection to a new modifiableMDWList.<E> MDWList<E>toList(Iterator<E> values)Converts the specified iterator to a new modifiableMDWList.longtoLong(String scriptName)Invokes the specified script and returns alongrepresentation of the evaluation result.longtoLong(String scriptName, List<?> arguments)Invokes the specified script and returns alongrepresentation of the evaluation result.ObjecttoObject(String scriptName)Invokes the specified script.ObjecttoObject(String scriptName, List<?> arguments)Invokes the specified script.<T> MDWSet<T>toSet(String scriptName)Invokes the specified script and returns aMDWSetrepresentation of the evaluation result.<T> MDWSet<T>toSet(String scriptName, List<?> arguments)Invokes the specified script and returns aMDWSetrepresentation of the evaluation result.shorttoShort(String scriptName)Invokes the specified script and returns ashortrepresentation of the evaluation result.shorttoShort(String scriptName, List<?> arguments)Invokes the specified script and returns ashortrepresentation of the evaluation result.StringtoString(String scriptName)Invokes the specified script and returns aStringrepresentation of the evaluation result.StringtoString(String scriptName, List<?> arguments)Invokes the specified script and returns aStringrepresentation of the evaluation result.-
Methods inherited from interface org.eclipse.emf.ecore.EModelElement
getEAnnotation, getEAnnotations
-
-
-
-
Method Detail
-
eModel
Model eModel()
Returns the containing model, ornull.The returned model is the one used to create this object (
Model.create()), or the one to which the object has been added (Model.add()).- Returns:
- the containing model, or
null(when the object is removed). - See Also:
Model.create(String),Model.add(MDWObject)
-
eMetamodel
Metamodel eMetamodel()
Returns the metamodel to which this object is related.- Returns:
- the metamodel used by this object.
- Throws:
InvalidCallException- if this object is not attached to a model.
-
eMetaTypeName
String eMetaTypeName()
Returns the simple name of the meta-type ("Actor"or"Activity"for example).- Returns:
- the simple name of the meta-type.
-
eUniqueID
String eUniqueID()
Returns the ID which uniquely identifies the object, and which is constant in time.This ID is not generated by the framework, a
MDWObjectmay not have a unique ID. The returned ID is the one that has been set usingeSetUniqueID().This ID must be unique during the lifetime of this object, and must be constant between multiple sessions. Reloading a model must assign the same unique ID for each element.
- Returns:
- the unique ID of this object,
nullif no ID has been set.
-
eSetUniqueID
void eSetUniqueID(String uniqueID)
Sets the unique ID of this object.This ID must be unique during the lifetime of this object, and must be constant between multiple sessions. Reloading a model must assign the same unique ID for each element.
- Parameters:
uniqueID- the unique ID of this object.
-
compareTo
int compareTo(Object o)
Compares this object with the specified object for order using thetoString()method.Caution: while this implementation may be statisfying for a natural ordering based on
toString(), it may have no sense to compare model elements this way. It is always a good practice to sort model elements by defining your ownComparatorwhich may handle specific features.- Specified by:
compareToin interfaceComparable<Object>- See Also:
Comparable,Comparator,Collections.sort(java.util.List, java.util.Comparator)
-
eIsInstanceOf
boolean eIsInstanceOf(String typeName)
Determines whether this object is an instance of the specified type.The specified type name can be a fully qualified class (
"com.sodius.mdw.metamodel.uml21.Classifier"for example), or a simple name ("Classifier"), if this name is unique in the metamodel.- Parameters:
typeName- the type name to compare with.- Returns:
trueif this object's type matches the specified type or one of its subtype,falseotherwise.- Throws:
InvalidCallException- if this object is not attached to a model.NoSuchTypeException- if the specified type does not exists
-
eIsInstanceOf
boolean eIsInstanceOf(String typeName, String profileName)
Determines whether this object is an instance of the specified type and if it matches the specified profile name.The specified type name can be a fully qualified class (
"com.sodius.mdw.metamodel.uml21.Classifier"for example), or a simple name ("Classifier"), if this name is unique in the metamodel.- Parameters:
typeName- the type name to compare with.profileName- the name of the profile type this instance must match.- Returns:
trueif this object's type matches the specified type or one of its subtype,falseotherwise.- Throws:
InvalidCallException- if this object is not attached to a model or if this API is not called during an MDWorkbench evaluation.NoSuchTypeException- if the specified type does not exists
-
eIsProfiled
boolean eIsProfiled(String profileName, boolean includeSubTypes)
Determines whether this object matches the specified profile name.- Parameters:
profileName- the name of the profile type this instance must match.includeSubTypes- determines whether to check for sub profile types.- Returns:
trueif this object's type matches the specified profile type or one of its subtype,falseotherwise.- Throws:
InvalidCallException- if this object is not attached to a model or if this API is not called during an MDWorkbench evaluation.NoSuchTypeException- if the specified type does not exists
-
eIsRemoved
boolean eIsRemoved()
Answers whether this object is tagged as removed.When removed, an object is no longer attached to a model and you can't anymore call scripts on it.
- Returns:
trueif the object is removed,falseotherwise.
-
eRemove
void eRemove()
Tag this object as removed. Has no effect if the object is already tagged as removed.This method will:
- Removes references from other objects to this one.
- Detach this object from its container or its resource (if this is a
EObject). - Detach this object from its model
Once the object is tagged as removed, it should not be accessible from other objects and from its model.
-
toObject
Object toObject(String scriptName)
Invokes the specified script.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- the script result, or
nullif the scripts returns nothing. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed.
-
toObject
Object toObject(String scriptName, List<?> arguments)
Invokes the specified script.The number and type of arguments must match the parameters of the script.
- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- the script result, or
nullif the scripts returns nothing. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed.
-
toString
String toString(String scriptName)
Invokes the specified script and returns aStringrepresentation of the evaluation result.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- a
Stringrepresentation of the script result, an emptyStringif the result isnull. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed.- See Also:
String.valueOf(java.lang.Object)
-
toString
String toString(String scriptName, List<?> arguments)
Invokes the specified script and returns aStringrepresentation of the evaluation result.The number and type of arguments must match the parameters of the script.
- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- a
Stringrepresentation of the script result, an emptyStringif the result isnull. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed.- See Also:
String.valueOf(java.lang.Object)
-
toBoolean
boolean toBoolean(String scriptName)
Invokes the specified script and returns abooleanrepresentation of the evaluation result.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.If the script result is:
null:falseis returned.- a
java.lang.Boolean, itsbooleanvalue is returned. - a
java.lang.String,Boolean.valueOf(String)is used to convert theStringto aboolean. - anything else, an exception is thrown.
- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- a
booleanrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to aboolean.- See Also:
Boolean.valueOf(java.lang.String)
-
toBoolean
boolean toBoolean(String scriptName, List<?> arguments)
Invokes the specified script and returns abooleanrepresentation of the evaluation result.If the script result is:
null:falseis returned.- a
java.lang.Boolean, itsbooleanvalue is returned. - a
java.lang.String,Boolean.valueOf(String)is used to convert theStringto aboolean. - anything else, an exception is thrown.
The number and type of arguments must match the parameters of the script.
- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- a
booleanrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to aboolean.- See Also:
Boolean.valueOf(java.lang.String)
-
toInt
int toInt(String scriptName)
Invokes the specified script and returns aintrepresentation of the evaluation result.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.If the script result is:
null:0is returned.- a
java.lang.Number, itsintvalue is returned. - a
java.lang.String,Integer.parseInt(String)is used to convert theStringto aint. - anything else, an exception is thrown.
- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- an
intrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to aint.- See Also:
Integer.parseInt(java.lang.String)
-
toInt
int toInt(String scriptName, List<?> arguments)
Invokes the specified script and returns aintrepresentation of the evaluation result.If the script result is:
null:0is returned.- a
java.lang.Number, itsintvalue is returned. - a
java.lang.String,Integer.parseInt(String)is used to convert theStringto aint. - anything else, an exception is thrown.
The number and type of arguments must match the parameters of the script.
- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- an
intrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to aint.- See Also:
Integer.parseInt(java.lang.String)
-
toLong
long toLong(String scriptName)
Invokes the specified script and returns alongrepresentation of the evaluation result.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.If the script result is:
null:0is returned.- a
java.lang.Number, itslongvalue is returned. - a
java.lang.String,Long.parseLong(String)is used to convert theStringto along. - anything else, an exception is thrown.
- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- a
longrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to along.- See Also:
Long.parseLong(java.lang.String)
-
toLong
long toLong(String scriptName, List<?> arguments)
Invokes the specified script and returns alongrepresentation of the evaluation result.If the script result is:
null:0is returned.- a
java.lang.Number, itslongvalue is returned. - a
java.lang.String,Long.parseLong(String)is used to convert theStringto along. - anything else, an exception is thrown.
The number and type of arguments must match the parameters of the script.
- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- a
longrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to along.- See Also:
Long.parseLong(java.lang.String)
-
toShort
short toShort(String scriptName)
Invokes the specified script and returns ashortrepresentation of the evaluation result.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.If the script result is:
null:0is returned.- a
java.lang.Number, itsshortvalue is returned. - a
java.lang.String,Short.parseShort(String)is used to convert theStringto ashort. - anything else, an exception is thrown.
- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- a
shortrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to ashort.- See Also:
Short.parseShort(java.lang.String)
-
toShort
short toShort(String scriptName, List<?> arguments)
Invokes the specified script and returns ashortrepresentation of the evaluation result.If the script result is:
null:0is returned.- a
java.lang.Number, itsshortvalue is returned. - a
java.lang.String,Short.parseShort(String)is used to convert theStringto ashort. - anything else, an exception is thrown.
The number and type of arguments must match the parameters of the script.
- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- a
shortrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to ashort.- See Also:
Short.parseShort(java.lang.String)
-
toFloat
float toFloat(String scriptName)
Invokes the specified script and returns afloatrepresentation of the evaluation result.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.If the script result is:
null:0is returned.- a
java.lang.Number, itsfloatvalue is returned. - a
java.lang.String,Float.parseFloat(String)is used to convert theStringto afloat. - anything else, an exception is thrown.
- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- a
floatrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to afloat.- See Also:
Float.parseFloat(java.lang.String)
-
toFloat
float toFloat(String scriptName, List<?> arguments)
Invokes the specified script and returns afloatrepresentation of the evaluation result.If the script result is:
null:0is returned.- a
java.lang.Number, itsfloatvalue is returned. - a
java.lang.String,Float.parseFloat(String)is used to convert theStringto afloat. - anything else, an exception is thrown.
The number and type of arguments must match the parameters of the script.
- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- a
floatrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to afloat.- See Also:
Float.parseFloat(java.lang.String)
-
toDouble
double toDouble(String scriptName)
Invokes the specified script and returns adoublerepresentation of the evaluation result.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.If the script result is:
null:0is returned.- a
java.lang.Number, itsdoublevalue is returned. - a
java.lang.String,Double.parseDouble(String)is used to convert theStringto adouble. - anything else, an exception is thrown.
- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- a
doublerepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to adouble.- See Also:
Double.parseDouble(java.lang.String)
-
toDouble
double toDouble(String scriptName, List<?> arguments)
Invokes the specified script and returns adoublerepresentation of the evaluation result.If the script result is:
null:0is returned.- a
java.lang.Number, itsdoublevalue is returned. - a
java.lang.String,Double.parseDouble(String)is used to convert theStringto adouble. - anything else, an exception is thrown.
The number and type of arguments must match the parameters of the script.
- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- a
doublerepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to adouble.- See Also:
Double.parseDouble(java.lang.String)
-
toByte
byte toByte(String scriptName)
Invokes the specified script and returns abyterepresentation of the evaluation result.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.If the script result is:
null:0is returned.- a
java.lang.Number, itsbytevalue is returned. - a
java.lang.String,Byte.parseByte(String)is used to convert theStringto abyte. - anything else, an exception is thrown.
- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- a
byterepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to abyte.- See Also:
Byte.parseByte(java.lang.String)
-
toByte
byte toByte(String scriptName, List<?> arguments)
Invokes the specified script and returns abyterepresentation of the evaluation result.If the script result is:
null:0is returned.- a
java.lang.Number, itsbytevalue is returned. - a
java.lang.String,Byte.parseByte(String)is used to convert theStringto abyte. - anything else, an exception is thrown.
The number and type of arguments must match the parameters of the script.
- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- a
byterepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to abyte.- See Also:
Byte.parseByte(java.lang.String)
-
toChar
char toChar(String scriptName)
Invokes the specified script and returns acharrepresentation of the evaluation result.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.If the script result is:
- a
java.lang.Character, itscharvalue is returned. - a
java.lang.Stringof one character, its unique character is returned. - anything else, an exception is thrown.
- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- a
byterepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to achar.
- a
-
toChar
char toChar(String scriptName, List<?> arguments)
Invokes the specified script and returns acharrepresentation of the evaluation result.If the script result is:
- a
java.lang.Character, itscharvalue is returned. - a
java.lang.Stringof one character, its unique character is returned. - anything else, an exception is thrown.
The number and type of arguments must match the parameters of the script.
- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- a
byterepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed, or the script result can't be converted to achar.
- a
-
toSet
<T> MDWSet<T> toSet(String scriptName)
Invokes the specified script and returns aMDWSetrepresentation of the evaluation result.MDWSetprovides facilities to invoke scripts on eachMDWObjectelement of the Set.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.If the script result is:
null, an emptyMDWSetis returned.- a collection-like (
Collection,Map,Iteratororarray), aMDWSetis created and wraps these elements. - anything else, a singleton
MDWSetis created containing just this element.
- Type Parameters:
T- the type of elements in the returned collection.- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- a modifiable
MDWSetrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed.- Since:
- MDWorkbench 3.0.0
-
toSet
<T> MDWSet<T> toSet(String scriptName, List<?> arguments)
Invokes the specified script and returns aMDWSetrepresentation of the evaluation result.MDWSetprovides facilities to invoke scripts on eachMDWObjectelement of the Set.If the script result is:
null, an emptyMDWSetis returned.- a collection-like (
Collection,Map,Iteratororarray), aMDWSetis created and wraps these elements. - anything else, a singleton
MDWSetis created containing just this element.
The number and type of arguments must match the parameters of the script.
- Type Parameters:
T- the type of elements in the returned collection.- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- a modifiable
MDWSetrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed.- Since:
- MDWorkbench 3.0.0
-
toList
<T> MDWList<T> toList(String scriptName)
Invokes the specified script and returns aMDWListrepresentation of the evaluation result.MDWListprovides facilities to invoke scripts on eachMDWObjectelement of the list.The specified name can reference a structural feature (
EAttributeorEReference) defined in the related metamodel.If the script result is:
null, an emptyMDWListis returned.- a collection-like (
Collection,Map,Iteratororarray), aMDWListis created and wraps these elements. - anything else, a singleton
MDWListis created containing just this element.
- Type Parameters:
T- the type of elements in the returned collection.- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- a modifiable
MDWListrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed.
-
toList
<T> MDWList<T> toList(String scriptName, List<?> arguments)
Invokes the specified script and returns aMDWListrepresentation of the evaluation result.MDWListprovides facilities to invoke scripts on eachMDWObjectelement of the list.If the script result is:
null, an emptyMDWListis returned.- a collection-like (
Collection,Map,Iteratororarray), aMDWListis created and wraps these elements. - anything else, a singleton
MDWListis created containing just this element.
The number and type of arguments must match the parameters of the script.
- Type Parameters:
T- the type of elements in the returned collection.- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- a modifiable
MDWListrepresentation of the script result. - Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed.
-
toList
<E> MDWList<E> toList(Collection<E> values)
Converts the specified collection to a new modifiableMDWList.MDWListprovides facilities to invoke scripts on eachMDWObjectelement of the list.- Type Parameters:
E- the type of elements in the returned collection.- Parameters:
values- the collection to wrap into a list.- Returns:
- a modifiable
MDWListcontaining each element of the specified collection.
-
toList
<E> MDWList<E> toList(Iterator<E> values)
Converts the specified iterator to a new modifiableMDWList.MDWListprovides facilities to invoke scripts on eachMDWObjectelement of the list.- Type Parameters:
E- the type of elements in the returned collection.- Parameters:
values- the iterator to wrap into a list.- Returns:
- a modifiable
MDWListcontaining each element of the specified iterator.
-
toList
<E> MDWList<E> toList(E[] values)
Converts the specified array to a new modifiableMDWList.MDWListprovides facilities to invoke scripts on eachMDWObjectelement of the list.- Type Parameters:
E- the type of elements in the returned collection.- Parameters:
values- the array to wrap into a list.- Returns:
- a modifiable
MDWListcontaining each element of the specified array.
-
superScript
Object superScript(String scriptName)
Invokes the specified script defined on the super-type.This is useful when overriding a script: when you redefine a script on a subtype, you're still able to call the super-type script and refine its behavior.
If the related type has many super-types (for example in UML,
Classifierinherits fromGeneralizableElementand fromNamespace), the specified script may be defined on more than one super-type, and the call can be ambiguous. To resolve this ambiguity, the expected script can be prefixed by its defining super-type name. For example, from aClassifierelement, you can callself.superScript("Namespace.myScript").- Parameters:
scriptName- the name of the script to evaluate (which must not expect any parameter).- Returns:
- the script result.
- Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed.NoSuchTypeException- if the super-type (if specified) does not exists
-
superScript
Object superScript(String scriptName, List<?> arguments)
Invokes the specified script defined on the super-type.This is useful when overriding a script: when you redefine a script on a subtype, you're still able to call the super-type script and refine its behavior.
If the related type has many super-types (for example in UML,
Classifierinherits fromGeneralizableElementand fromNamespace), the specified script may be defined on more than one super-type, and the call can be ambiguous. To resolve this ambiguity, the expected script can be prefixed by its defining super-type name. For example, from aClassifierelement, you can callself.superScript("Namespace.myScript").The number and type of arguments must match the parameters of the script.
- Parameters:
scriptName- the name of the script to evaluate.arguments- the script arguments.- Returns:
- the script result.
- Throws:
InvalidCallException- if the script does not exist or is not visible.EvaluationException- if the evaluation of the script failed.NoSuchTypeException- if the super-type (if specified) does not exists
-
eExtendedClass
ExtendedClass eExtendedClass()
Returns the type which gives reflective access to structural features.- Returns:
- the type which gives reflective access to structural features.
- Since:
- MDWorkbench 3.0.0
-
-