Package org.mule.runtime.ast.api.util
Class ComponentAstPredicatesFactory
java.lang.Object
org.mule.runtime.ast.api.util.ComponentAstPredicatesFactory
Set of predicates to filter
ComponentAsts.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Predicate<List<ComponentAst>>anyElementInHierarchy(Predicate<ComponentAst> currentElementPredicate) Filter a component hierarchy by evaluating the provided component against any hierarchy element.static Predicate<List<ComponentAst>>currentElemement(Predicate<ComponentAst> currentElementPredicate) Filter a component hierarchy by evaluating the provided component against the last hierarchy element.static Predicate<ComponentAst>equalsComponentId(String componentId) static Predicate<ComponentAst>equalsIdentifier(org.mule.runtime.api.component.ComponentIdentifier identifier) FilterComponentAstwith equalsComponentIdentifierstatic Predicate<ComponentAst>equalsLocation(org.mule.runtime.api.component.location.ComponentLocation location) FilterComponentAstwith equalsComponentLocationstatic Predicate<ComponentAst>equalsNamespace(String namespace) FilterComponentAstwith equals identifier namespacestatic Predicate<List<ComponentAst>>Filter component hierarchies that represent just a top-level component.
-
Method Details
-
equalsIdentifier
public static Predicate<ComponentAst> equalsIdentifier(org.mule.runtime.api.component.ComponentIdentifier identifier) FilterComponentAstwith equalsComponentIdentifier- Parameters:
identifier- theComponentIdentifierto check for.- Returns:
- the predicate with which to select the desired
identifier
-
equalsComponentId
- Parameters:
componentId- thecomponentIdto check for.- Returns:
- the predicate with which to select the desired
componentId
-
equalsNamespace
FilterComponentAstwith equals identifier namespace- Parameters:
namespace- the namespace to check for.- Returns:
- the predicate with which to select the desired
identifier
-
equalsLocation
public static Predicate<ComponentAst> equalsLocation(org.mule.runtime.api.component.location.ComponentLocation location) FilterComponentAstwith equalsComponentLocation- Parameters:
location- theComponentLocationto check for.- Returns:
- the predicate with which to select the desired
location
-
topLevelElement
Filter component hierarchies that represent just a top-level component.- Returns:
- a predicate to filter just top-level elements
-
currentElemement
public static Predicate<List<ComponentAst>> currentElemement(Predicate<ComponentAst> currentElementPredicate) Filter a component hierarchy by evaluating the provided component against the last hierarchy element.- Parameters:
currentElementPredicate- the predicate to apply to the last element of the component hierarchy being inspected.- Returns:
- an adapted predicate.
-
anyElementInHierarchy
public static Predicate<List<ComponentAst>> anyElementInHierarchy(Predicate<ComponentAst> currentElementPredicate) Filter a component hierarchy by evaluating the provided component against any hierarchy element.- Parameters:
currentElementPredicate- the predicate to apply to any element of the component hierarchy being inspected.- Returns:
- an adapted predicate.
-