Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.gmt.modisco.infra.query.core
Class AbstractModelQuery

    java.lang.Object
      org.eclipse.gmt.modisco.infra.query.core.AbstractModelQuery

Direct Known Subclasses:
  JavaModelQueryAdapter, JXPathModelQueryAdapter, OCLModelQueryAdapter

    public abstract class AbstractModelQuery

extends java.lang.Object

To get a sub class instance of this class, the `ModelQuerySetCatalog` must be used.

     ModelQuerySetCatalog catalog = ModelQuerySetCatalog.getSingleton();
     ModelQuerySet modelQuerySet = catalog.getModelQuerySet("modisco.infra.query.tests.01");
     ModelQuery modelQuery = modelQuerySet.getQuery("test001");
     AbstractModelQuery modelQueryInst = catalog.getModelQueryImpl(modelQuery);

Author:
  Gr?goire Dup? (Mia-Software)

Constructor Summary
`AbstractModelQuery(ModelQuery modelQuery)` AbstractModelQuery constructor

Method Summary
`java.lang.Object` | `basicEvaluate(EObject context)` This method is equivalent to `evaluate(EObject)` but rather than return the errors into a ModelQueryResult instance, it throws an exception.
`abstract java.lang.Object` | `basicEvaluate(EObject context, java.util.List<ModelQueryParameterValue> parameterValues)` This method must be overridden by each sub class to implement query evaluation.
`ModelQueryResult` | `evaluate(EObject context)` This method is used to evaluate the query on one model element.
`java.util.List<ModelQueryResult>` | `evaluate(ModelQueryContext context, java.util.List<ModelQueryParameterValue> parameterValues)` This method is used to evaluate the query on a set of models and model elements described by the context parameter.
`ModelQuery` | `getModelQuery()` This method returns the model query element passed as parameter to the constructor
`void` | `setCheckResult(boolean checkResult)`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### AbstractModelQuery

    public AbstractModelQuery(ModelQuery modelQuery)

  AbstractModelQuery constructor

  Parameters:
    `modelQuery` - the model query description (model element)

Method Detail

### getModelQuery

    public final ModelQuery getModelQuery()

  This method returns the model query element passed as parameter to the constructor

  Returns:
    The model query element passed as parameter to the constructor

### evaluate

    public final java.util.List<ModelQueryResult> evaluate(ModelQueryContext context,
                                                           java.util.List<ModelQueryParameterValue> parameterValues)

  This method is used to evaluate the query on a set of models and model elements described by the context parameter. The query is evaluated on each contextually referred model element and on each element of a contextually referred model.

  Parameters:
    `context` - The query evaluation context described by a ModelQueryContext instance.
    `parameterValues` - The query parameter values.
  Returns:
    A list of ModelQueryResult (one per evaluation)

### evaluate

    public final ModelQueryResult evaluate(EObject context)

  This method is used to evaluate the query on one model element. The method is only usable for queries which do not have any parameters.

  Parameters:
    `context` - The query evaluation context
  Returns:
    A ModelQueryResult instance

### basicEvaluate

    public abstract java.lang.Object basicEvaluate(EObject context,
                                                   java.util.List<ModelQueryParameterValue> parameterValues)
                                            throws ModelQueryException

  This method must be overridden by each sub class to implement query evaluation.

  Parameters:
    `context` - The query evaluation context
    `parameterValues` - The query parameter values
  Returns:
    A list of ModelQueryResult (one per evaluation)
  Throws:
    `ModelQueryExecutionException`
    `ModelQueryException`

### basicEvaluate

    public final java.lang.Object basicEvaluate(EObject context)
                                         throws ModelQueryException

  This method is equivalent to `evaluate(EObject)` but rather than return the errors into a ModelQueryResult instance, it throws an exception.

  Parameters:
    `context` - The query evaluation context
  Returns:
    The query result.
  Throws:
    `ModelQueryExecutionException`
    `ModelQueryException`

### setCheckResult

    public void setCheckResult(boolean checkResult)

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD