org.eclipse.mtl.common.utils
Class MTLNonStandardLibrary

java.lang.Object
  extended by org.eclipse.mtl.common.utils.MTLNonStandardLibrary

public final class MTLNonStandardLibrary
extends java.lang.Object

This will define additional convenience operations on OCL types. Those were not defined in the specification.


Field Summary
static java.lang.String OPERATION_OCLANY_ANCESTORS
          Name of the "ancestors" non-standard operation accessible on all objects.
static java.lang.String OPERATION_OCLANY_EALLCONTENTS
          Name of the "eAllContents" non-standard operation accessible on all objects.
static java.lang.String OPERATION_OCLANY_TOSTRING
          Name of the "toString" non-standard operation accessible on all objects.
static java.lang.String OPERATION_STRING_ENDSWITH
          Name of the "endsWith" non-standard String operation.
static java.lang.String OPERATION_STRING_REPLACE
          Name of the "replace" non-standard String operation.
static java.lang.String OPERATION_STRING_REPLACEALL
          Name of the "replaceAll" non-standard String operation.
static java.lang.String OPERATION_STRING_STARTSWITH
          Name of the "startsWith" non-standard String operation.
static java.lang.String OPERATION_STRING_SUBSTITUTEALL
          Name of the "substituteAll" non-standard String operation.
static java.lang.String OPERATION_STRING_TOKENIZE
          Name of the "tokenize" non-standard String operation.
static java.lang.String OPERATION_STRING_TRIM
          Name of the "trim" non-standard String operation.
 
Constructor Summary
MTLNonStandardLibrary()
          Initializes the non-standard library package along with its content.
 
Method Summary
 org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EOperation> getExistingOperations(org.eclipse.emf.ecore.EClassifier type)
          Obtains the operations declared on the specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPERATION_STRING_ENDSWITH

public static final java.lang.String OPERATION_STRING_ENDSWITH
Name of the "endsWith" non-standard String operation.

endsWith( String substring ) : Boolean
Returns true if self ends with the substring substring, false otherwise.

See Also:
Constant Field Values

OPERATION_STRING_REPLACE

public static final java.lang.String OPERATION_STRING_REPLACE
Name of the "replace" non-standard String operation.

replace( String substring, String replacement ) : String
Substitutes the first occurence of substring substring in self by substring replacement and returns the resulting string. If there is no occurrence of the substring, The original string is returned. substring and replacement are treated as regular expressions.

See Also:
Constant Field Values

OPERATION_STRING_REPLACEALL

public static final java.lang.String OPERATION_STRING_REPLACEALL
Name of the "replaceAll" non-standard String operation.

replaceAll( String substring, String replacement ) : String
Substitutes all substrings substring in self by substring replacement and returns the resulting string. If there is no occurrence of the substring, The original string is returned. substring and replacement are treated as regular expressions.

See Also:
Constant Field Values

OPERATION_STRING_STARTSWITH

public static final java.lang.String OPERATION_STRING_STARTSWITH
Name of the "startsWith" non-standard String operation.

startsWith( String substring ) : Boolean
Returns true if self starts with the substring substring, false otherwise.

See Also:
Constant Field Values

OPERATION_STRING_SUBSTITUTEALL

public static final java.lang.String OPERATION_STRING_SUBSTITUTEALL
Name of the "substituteAll" non-standard String operation.

substituteAll( String substring, String replacement ) : String
Substitutes all substrings substring in self by substring replacement and returns the resulting string. If there is no occurrence of the substring, The original string is returned. substring and replacement are not treated as regular expressions.

See Also:
Constant Field Values

OPERATION_STRING_TRIM

public static final java.lang.String OPERATION_STRING_TRIM
Name of the "trim" non-standard String operation.

trim( ) : String
Removes all leading and trailing spaces of self.

See Also:
Constant Field Values

OPERATION_STRING_TOKENIZE

public static final java.lang.String OPERATION_STRING_TOKENIZE
Name of the "tokenize" non-standard String operation.

tokenize( String delim ) : Sequence
Returns a sequence containing the tokens of the given string (using delim as delimiter).

See Also:
Constant Field Values

OPERATION_OCLANY_EALLCONTENTS

public static final java.lang.String OPERATION_OCLANY_EALLCONTENTS
Name of the "eAllContents" non-standard operation accessible on all objects. This operation comes in two flavors :

eAllContents( ) : Sequence
Returns the whole content tree of the receiver as a Sequence.

eAllContents( OclAny ) : Sequence
Returns the elements of the given type from the whole content tree of the receiver as a Sequence.

See Also:
Constant Field Values

OPERATION_OCLANY_ANCESTORS

public static final java.lang.String OPERATION_OCLANY_ANCESTORS
Name of the "ancestors" non-standard operation accessible on all objects.

ancestors( ) : Sequence
Returns a Sequence containing the full set of the receiver's ancestors.

See Also:
Constant Field Values

OPERATION_OCLANY_TOSTRING

public static final java.lang.String OPERATION_OCLANY_TOSTRING
Name of the "toString" non-standard operation accessible on all objects.

toString( ) : String
Returns the String representation of the receiver.

See Also:
Constant Field Values
Constructor Detail

MTLNonStandardLibrary

public MTLNonStandardLibrary()
Initializes the non-standard library package along with its content.

Method Detail

getExistingOperations

public org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EOperation> getExistingOperations(org.eclipse.emf.ecore.EClassifier type)
Obtains the operations declared on the specified type. Note that this method returns null, not an empty list, if none are found.

Parameters:
type - The type which operation are sought.
Returns:
The operations it declares. null if none.

Copyright 2008 Obeo
All Rights Reserved.