Class ComponentAstPredicatesFactory

java.lang.Object
org.mule.runtime.ast.api.util.ComponentAstPredicatesFactory

public class ComponentAstPredicatesFactory extends Object
Set of predicates to filter ComponentAsts.
Since:
1.0.0
  • Method Details

    • equalsIdentifier

      public static Predicate<ComponentAst> equalsIdentifier(org.mule.runtime.api.component.ComponentIdentifier identifier)
      Filter ComponentAst with equals ComponentIdentifier
      Parameters:
      identifier - the ComponentIdentifier to check for.
      Returns:
      the predicate with which to select the desired identifier
    • equalsComponentId

      public static Predicate<ComponentAst> equalsComponentId(String componentId)
      Filter ComponentAst with equals componentId (Ref: ComponentAst.getComponentId())
      Parameters:
      componentId - the componentId to check for.
      Returns:
      the predicate with which to select the desired componentId
    • equalsNamespace

      public static Predicate<ComponentAst> equalsNamespace(String namespace)
      Filter ComponentAst with 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)
      Filter ComponentAst with equals ComponentLocation
      Parameters:
      location - the ComponentLocation to check for.
      Returns:
      the predicate with which to select the desired location
    • topLevelElement

      public static Predicate<List<ComponentAst>> 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.