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_EINVERSE
          Name of the "eInverse" 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.
static java.lang.String PRIMITIVE_STRING_NAME
          Name of the primitive type "String" as defined in the OCL standard library.
static java.lang.String TYPE_OCLANY_NAME
          Name of the type "OclAny" used for common EOperations for all EObjects.
 
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.
 org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EOperation> getExistingOperations(java.lang.String classifierName)
          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_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_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_EINVERSE

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

eInverse( ) : Sequence(T)
Returns the inverse references of the receiver.

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

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_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 all parts of self split around delimiters defined by the characters in String delim.

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

PRIMITIVE_STRING_NAME

public static final java.lang.String PRIMITIVE_STRING_NAME
Name of the primitive type "String" as defined in the OCL standard library.

See Also:
Constant Field Values

TYPE_OCLANY_NAME

public static final java.lang.String TYPE_OCLANY_NAME
Name of the type "OclAny" used for common EOperations for all EObjects.

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.

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

getExistingOperations

public org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EOperation> getExistingOperations(java.lang.String classifierName)
Obtains the operations declared on the specified type.

Parameters:
classifierName - The name of the classifier which operation are sought.
Returns:
The operations it declares. null if none.

Copyright 2008 Obeo
All Rights Reserved.