|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.ocl.expressions.util.ExpressionsUtil
Static utilities for working with expressions.
Method Summary | |
---|---|
static org.eclipse.emf.ecore.EObject |
containerOfType(org.eclipse.emf.ecore.EClass type,
org.eclipse.emf.ecore.EObject eObject)
Computes the nearest container of an eObject that has the
specified type . |
static OCLExpression |
createBodyCondition(org.eclipse.emf.ecore.EClassifier classifier,
org.eclipse.emf.ecore.EOperation context,
java.lang.String expression,
boolean validate)
Creates an operation body condition expression. |
static OCLExpression |
createBodyCondition(Environment env,
java.lang.String expression,
boolean validate)
Creates an operation body condition expression in the specified environment. |
static OCLExpression |
createBodyCondition(org.eclipse.emf.ecore.EOperation context,
java.lang.String expression,
boolean validate)
Creates an operation body condition expression. |
static Environment |
createClassifierContext(org.eclipse.emf.ecore.EClassifier classifier)
Creates an environment for OCL constraints in the context of the specified classifier . |
static OCLExpression |
createDerivedValueExpression(org.eclipse.emf.ecore.EClassifier classifier,
org.eclipse.emf.ecore.EStructuralFeature context,
java.lang.String expression,
boolean validate)
Creates an property derived value expression. |
static OCLExpression |
createDerivedValueExpression(Environment env,
java.lang.String expression,
boolean validate)
Creates a property derived value expression in the specified environment. |
static OCLExpression |
createDerivedValueExpression(org.eclipse.emf.ecore.EStructuralFeature context,
java.lang.String expression,
boolean validate)
Creates a property derived value expression. |
static OCLExpression |
createInitialValueExpression(org.eclipse.emf.ecore.EClassifier classifier,
org.eclipse.emf.ecore.EStructuralFeature context,
java.lang.String expression,
boolean validate)
Creates an property initial value expression. |
static OCLExpression |
createInitialValueExpression(Environment env,
java.lang.String expression,
boolean validate)
Creates a property initial value expression in the specified environment. |
static OCLExpression |
createInitialValueExpression(org.eclipse.emf.ecore.EStructuralFeature context,
java.lang.String expression,
boolean validate)
Creates a property initial value expression. |
static OCLExpression |
createInvariant(org.eclipse.emf.ecore.EClassifier context,
java.lang.String expression,
boolean validate)
Creates an invariant constraint expression. |
static OCLExpression |
createInvariant(Environment env,
java.lang.String expression,
boolean validate)
Creates an invariant constraint expression in the specified environment. |
static Environment |
createOperationContext(org.eclipse.emf.ecore.EClassifier classifier,
org.eclipse.emf.ecore.EOperation operation)
Creates an environment for OCL constraints in the context of the specified classifier and operation .
|
static Environment |
createOperationContext(org.eclipse.emf.ecore.EOperation operation)
Creates an environment for OCL constraints in the context of the specified operation . |
static OCLExpression |
createPostcondition(org.eclipse.emf.ecore.EClassifier classifier,
org.eclipse.emf.ecore.EOperation context,
java.lang.String expression,
boolean validate)
Creates an operation postcondition constraint expression. |
static OCLExpression |
createPostcondition(Environment env,
java.lang.String expression,
boolean validate)
Creates an operation postcondition constraint expression in the specified environment. |
static OCLExpression |
createPostcondition(org.eclipse.emf.ecore.EOperation context,
java.lang.String expression,
boolean validate)
Creates an operation postcondition constraint expression. |
static OCLExpression |
createPrecondition(org.eclipse.emf.ecore.EClassifier classifier,
org.eclipse.emf.ecore.EOperation context,
java.lang.String expression,
boolean validate)
Creates an operation precondition constraint expression. |
static OCLExpression |
createPrecondition(Environment env,
java.lang.String expression,
boolean validate)
Creates an operation precondition constraint expression in the specified environment. |
static OCLExpression |
createPrecondition(org.eclipse.emf.ecore.EOperation context,
java.lang.String expression,
boolean validate)
Creates an operation precondition constraint expression. |
static Environment |
createPropertyContext(org.eclipse.emf.ecore.EClassifier classifier,
org.eclipse.emf.ecore.EStructuralFeature property)
Creates an environment for OCL constraints in the context of the specified classifier and property .
|
static Environment |
createPropertyContext(org.eclipse.emf.ecore.EStructuralFeature property)
Creates an environment for OCL constraints in the context of the specified property . |
static OCLExpression |
createQuery(org.eclipse.emf.ecore.EClassifier context,
java.lang.String expression,
boolean validate)
Creates a query expression with an arbitrary result type. |
static OCLExpression |
createQuery(Environment env,
java.lang.String expression,
boolean validate)
Creates a query expression with an arbitrary result type in the specified environment. |
static void |
define(org.eclipse.emf.ecore.EClassifier context,
java.lang.String expression)
Defines a property or an operation of the specified signature. |
static org.eclipse.emf.ecore.ETypedElement |
define(Environment env,
java.lang.String defExpression)
Defines a property or operation of the specified signature. |
static boolean |
isInPostcondition(OCLExpression exp)
Checks whether the specified OCL expression is in an operation postcondition constraint. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static Environment createClassifierContext(org.eclipse.emf.ecore.EClassifier classifier)
classifier
.
classifier
- the context classifier
public static Environment createOperationContext(org.eclipse.emf.ecore.EClassifier classifier, org.eclipse.emf.ecore.EOperation operation)
classifier
and operation
.
This is useful when defining constraints on the redefinition of an
operation in the context of a classifier that inherits it (i.e.,
different from the classifier that defines the operation).
classifier
- the context classifieroperation
- the operation context
ExpressionsUtil.createOperationContext(EOperation)
public static Environment createOperationContext(org.eclipse.emf.ecore.EOperation operation)
operation
. The implied classifier context is
the classifier that defines the operation.
operation
- the operation context
ExpressionsUtil.createOperationContext(EClassifier, EOperation)
public static Environment createPropertyContext(org.eclipse.emf.ecore.EClassifier classifier, org.eclipse.emf.ecore.EStructuralFeature property)
classifier
and property
.
This is useful when defining constraints on the redefinition of a
property in the context of a classifier that inherits it (i.e.,
different from the classifier that defines the property).
classifier
- the context classifierproperty
- the property context
#createProper
public static Environment createPropertyContext(org.eclipse.emf.ecore.EStructuralFeature property)
property
. The implied classifier context is
the classifier that defines the property.
property
- the property context
ExpressionsUtil.createOperationContext(EClassifier, EOperation)
public static OCLExpression createQuery(org.eclipse.emf.ecore.EClassifier context, java.lang.String expression, boolean validate) throws ParserException
context
- the invariant's classifier contextexpression
- the expression (without any "inv:"
or
similar preamble)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createQuery(Environment env, java.lang.String expression, boolean validate) throws ParserException
env
- the OCL environmentexpression
- the expression (without any "inv:"
or
similar preamble)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createInvariant(org.eclipse.emf.ecore.EClassifier context, java.lang.String expression, boolean validate) throws ParserException
context
- the invariant's classifier contextexpression
- the expression (without the "inv:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createInvariant(Environment env, java.lang.String expression, boolean validate) throws ParserException
env
- the OCL environmentexpression
- the expression (without the "inv:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createPrecondition(org.eclipse.emf.ecore.EOperation context, java.lang.String expression, boolean validate) throws ParserException
context
- the precondition's operation contextexpression
- the expression (without the "pre:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createPrecondition(org.eclipse.emf.ecore.EClassifier classifier, org.eclipse.emf.ecore.EOperation context, java.lang.String expression, boolean validate) throws ParserException
classifier
- the context classifiercontext
- the precondition's operation contextexpression
- the expression (without the "pre:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createPrecondition(Environment env, java.lang.String expression, boolean validate) throws ParserException
env
- the OCL environmentexpression
- the expression (without the "pre:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createPostcondition(org.eclipse.emf.ecore.EOperation context, java.lang.String expression, boolean validate) throws ParserException
context
- the postcondition's operation contextexpression
- the expression (without the "post:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createPostcondition(org.eclipse.emf.ecore.EClassifier classifier, org.eclipse.emf.ecore.EOperation context, java.lang.String expression, boolean validate) throws ParserException
classifier
- the context classifiercontext
- the postcondition's operation contextexpression
- the expression (without the "post:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createPostcondition(Environment env, java.lang.String expression, boolean validate) throws ParserException
env
- the OCL environmentexpression
- the expression (without the "post:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createBodyCondition(org.eclipse.emf.ecore.EOperation context, java.lang.String expression, boolean validate) throws ParserException
context
- the body's operation contextexpression
- the expression (without the "body:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createBodyCondition(org.eclipse.emf.ecore.EClassifier classifier, org.eclipse.emf.ecore.EOperation context, java.lang.String expression, boolean validate) throws ParserException
classifier
- the context classifiercontext
- the body's operation contextexpression
- the expression (without the "body:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createBodyCondition(Environment env, java.lang.String expression, boolean validate) throws ParserException
env
- the OCL environmentexpression
- the expression (without the "body:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createInitialValueExpression(org.eclipse.emf.ecore.EStructuralFeature context, java.lang.String expression, boolean validate) throws ParserException
context
- the property contextexpression
- the expression (without the "init:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createInitialValueExpression(org.eclipse.emf.ecore.EClassifier classifier, org.eclipse.emf.ecore.EStructuralFeature context, java.lang.String expression, boolean validate) throws ParserException
classifier
- the context classifiercontext
- the property contextexpression
- the expression (without the "init:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createInitialValueExpression(Environment env, java.lang.String expression, boolean validate) throws ParserException
env
- the OCL property environmentexpression
- the expression (without the "init:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createDerivedValueExpression(org.eclipse.emf.ecore.EStructuralFeature context, java.lang.String expression, boolean validate) throws ParserException
context
- the property contextexpression
- the expression (without the "derive:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createDerivedValueExpression(org.eclipse.emf.ecore.EClassifier classifier, org.eclipse.emf.ecore.EStructuralFeature context, java.lang.String expression, boolean validate) throws ParserException
classifier
- the context classifiercontext
- the property contextexpression
- the expression (without the "derive:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static OCLExpression createDerivedValueExpression(Environment env, java.lang.String expression, boolean validate) throws ParserException
env
- the OCL property environmentexpression
- the expression (without the "derive:"
)validate
- whether to validate the result or not
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static void define(org.eclipse.emf.ecore.EClassifier context, java.lang.String expression) throws ParserException
context
- the classifier context to own the new property or operationexpression
- the expression (without the "def:"
preamble but including the "name(...) : type ="
part)
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static org.eclipse.emf.ecore.ETypedElement define(Environment env, java.lang.String defExpression) throws ParserException
defExpression
- the definition expression (without the "def:"
preamble but including the "name(...) : type ="
part)
EOperation
or EStructuralFeature
ParserException
- if the expression fails to parse
java.lang.IllegalArgumentException
- if the expression fails to validatepublic static org.eclipse.emf.ecore.EObject containerOfType(org.eclipse.emf.ecore.EClass type, org.eclipse.emf.ecore.EObject eObject)
eObject
that has the
specified type
.
type
- the container type to look foreObject
- the object for which we seek a container
type
, or
null
if no such container is foundpublic static boolean isInPostcondition(OCLExpression exp)
exp
- an OCL expression
true
if it is in a postcondition constraint;
false
, otherwise (including case of no constraint at all)
|
Copyright 2002, 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |