public class OCLQueryDelegate
extends java.lang.Object
implements org.eclipse.emf.ecore.util.QueryDelegate
OCLQueryDelegateFactory
Modifier and Type | Field and Description |
---|---|
protected org.eclipse.emf.ecore.EClassifier |
context |
protected OCLDelegateDomain |
delegateDomain |
protected java.lang.String |
expression |
protected java.util.Map<java.lang.String,org.eclipse.emf.ecore.EClassifier> |
variables |
Constructor and Description |
---|
OCLQueryDelegate(OCLDelegateDomain delegateDomain,
org.eclipse.emf.ecore.EClassifier context,
java.util.Map<java.lang.String,org.eclipse.emf.ecore.EClassifier> variables,
java.lang.String expression)
Initializes me with my domain, context, variables, and expression.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
execute(java.lang.Object target,
java.util.Map<java.lang.String,?> arguments)
Executes the query for the specified target object.
|
void |
prepare()
Prepares the query wrapping any exceptions as InvocationTargetException.
|
java.lang.String |
toString() |
protected final OCLDelegateDomain delegateDomain
protected final org.eclipse.emf.ecore.EClassifier context
protected final java.util.Map<java.lang.String,org.eclipse.emf.ecore.EClassifier> variables
protected final java.lang.String expression
public OCLQueryDelegate(OCLDelegateDomain delegateDomain, org.eclipse.emf.ecore.EClassifier context, java.util.Map<java.lang.String,org.eclipse.emf.ecore.EClassifier> variables, java.lang.String expression)
delegateDomain
- my domaincontext
- my contextvariables
- name and types of variables used in my expressionexpression
- the expression that I handleParserException
- if the expression is invalidpublic void prepare() throws java.lang.reflect.InvocationTargetException
prepare
in interface org.eclipse.emf.ecore.util.QueryDelegate
java.lang.reflect.InvocationTargetException
- wrapping any parser, io exceptionspublic java.lang.Object execute(java.lang.Object target, java.util.Map<java.lang.String,?> arguments) throws java.lang.reflect.InvocationTargetException
execute
in interface org.eclipse.emf.ecore.util.QueryDelegate
target
- the object on which to execute the query; this must be an
instance of the context with which the delegate was createdarguments
- a map of variable names to values; these must correspond to
the variables with which the delegate was createdjava.lang.reflect.InvocationTargetException
- in case of failure to prepare or execute the query, usually
because of an exceptionpublic java.lang.String toString()
toString
in class java.lang.Object