public interface ComplexTypeConditionHandler<E>
Modifier and Type | Method and Description |
---|---|
ComplexTypeConditionsSet<E> |
complexTypeConditionsSet()
Return the set of defined complex condition.
|
EmptyComplexTypeConditionable<E> |
withComplexTypeCondition()
Creates complex type condition.
|
EmptyComplexTypeConditionable<E> withComplexTypeCondition()
QueryNode
, which allow to define a
type condition in addition to the main type condition and restrict it with qualifier condition.
Allows to create a set of type condition on different class types. This will be interpreted
into a hierarchy of include / exclude type condition over the class model hierarchy. Every include type condition
will extended the acceptable class types that its ancestors (according to class model) conditions contributed,
and each exclude type condition will restrict the acceptable class types.
The following example defines a query node with a type 'x' and a complex condition that exclude all the
nodes of type 'sub_x', assuming that 'x' is an ancestor of 'sub_x':
queryNode.ofType("x").withComplexTypeCondition().withoutType("sub_x");For the class hierarchy:
x / \ y sub_x / \ sub_y sub_sub_xOnly results of type 'x', type 'y' and type 'sub_y' will be returned. We can use the same condition, but restricted it to the given type, without its subtypes, using the following code:
queryNode.ofType("x").withComplexTypeCondition().strictlyWithoutType("sub_x");It will return results with the types 'x', 'y', 'sub_y' AND 'sub_sub_x' NOTE: The type of the query element can be ignored for the results if needed. Just create a
complex condition
and declare this type
to be ignored
in the result.
In this case, the results will only be matched to the complex type conditions
and
not to the type of the query element. Example:
queryNode.ofType("x").withComplexTypeCondition().withoutType("x"). toQueryElement(). withComplexTypeCondition().withType("sub_sub_x"). toQueryElement(). withComplexTypeCondition().withType("y");The result will includes instances of types 'y', 'sub_y' and 'sub_sub_x', and will not include results with type 'x' or 'sub_x'(Given the above class hierarchy).
ComplexTypeConditionsSet<E> complexTypeConditionsSet()
Collection< ? extends ComplexTypeConditionable> conditions = queryNode.complexTypeConditionsSet().conditions(); for (ComplexTypeConditionable condition : conditions) { print(condition.type()); }
Documentation Feedback
Copyright 2011 - 2018 Micro Focus or one of its affiliates.