Interface ComponentAst

All Known Implementing Classes:
BaseComponentAst, BaseComponentAstDecorator

@NoImplement public interface ComponentAst
Represents the user configuration of a component (flow, config, message processor, etc) defined in an artifact.

Every ComponentAst represents the configuration of a core configuration or an extension configuration. Which configuration element this object represents is identified by a ComponentIdentifier that can be retrieved using #getIdentifier().

Since:
1.0
  • Method Details

    • getIdentifier

      org.mule.runtime.api.component.ComponentIdentifier getIdentifier()
      Returns:
      the identifier for the configuration element this object represents.
    • getComponentType

      org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType getComponentType()
      Returns:
      a general typification of the role of this component.
    • getLocation

      org.mule.runtime.api.component.location.ComponentLocation getLocation()
      Returns:
      the location of the component in the configuration.
    • getMetadata

      ComponentMetadataAst getMetadata()
      Returns:
      the parser metadata for this component.
    • getGenerationInformation

      ComponentGenerationInformation getGenerationInformation()
      Returns:
      an object containing information about the generation of this component.
    • getComponentId

      Optional<String> getComponentId()
      Returns:
      the id of this component if it has one defined, or empty otherwise.
    • getAnnotations

      Map<String,Object> getAnnotations()
      An annotation is defined by the DSL processor that creates the instances of ComponentAst.
      Returns:
      a Map containing the annotations for this component.
    • getExtensionModel

      org.mule.runtime.api.meta.model.ExtensionModel getExtensionModel()
      Returns:
      the extension model that declares the model this component represents.
    • getModel

      <M> Optional<M> getModel(Class<M> modelClass)
      A component may be represented by different kinds of models, depending on the actual type of this component. Possible values may be, for instance, instances of ConfigurationModel, ComponentModel or ConnectionProviderModel (but not necessarily limited to those).
      Parameters:
      modelClass - the class of the model this method should return.
      Returns:
      the model that represents this component.
    • getType

      org.mule.metadata.api.model.MetadataType getType()
      Returns:
      the type that represents this component, if it is represented by a type.
    • getParameter

      ComponentParameterAst getParameter(String groupName, String paramName)
      Parameters:
      groupName - the name of the parameterGroup to get AST for.
      paramName - the name of the parameter to get AST for.
      Returns:
      the AST of the parameter, or null if there is no parameter with the given groupName and paramName.
    • getParameters

      A parameter may have a value either because it is explicitly set in the DSL, or because the extension model defines a default value for it.
      Returns:
      the ASTs of all the parameters, even if they don't have a value.
    • recursiveStream

      Stream<ComponentAst> recursiveStream()
      This method will also traverse the complex parameters in each component.
      Returns:
      a Stream for this component and its children recursively that navigates the whole AST using TOP_DOWN direction.
    • recursiveStream

      Stream<ComponentAst> recursiveStream(AstTraversalDirection direction)
      This method will also traverse the complex parameters in each component.
      Parameters:
      direction - the @{link AstTraversalDirection} used to navigate the whole AST.
      Returns:
      a Stream for this component and its children recursively that navigates the whole AST using the given @{code direction}.
    • recursiveSpliterator

      Spliterator<ComponentAst> recursiveSpliterator()
      This method will also traverse the complex parameters in each component.
      Returns:
      a Spliterator for this component and its children recursively that navigates the whole AST using TOP_DOWN direction.
    • recursiveSpliterator

      Spliterator<ComponentAst> recursiveSpliterator(AstTraversalDirection direction)
      This method will also traverse the complex parameters in each component.
      Parameters:
      direction - the @{link AstTraversalDirection} used to navigate the whole AST.
      Returns:
      a Spliterator for this component and its children recursively that navigates the whole AST using the given @{code direction}.
    • directChildren

      List<ComponentAst> directChildren()
      This method will NOT traverse any complex parameters this component has.
      Returns:
      a List for this component's children.
    • directChildrenStream

      Stream<ComponentAst> directChildrenStream()
      Returns:
      a Stream for this component's children.
    • directChildrenSpliterator

      Spliterator<ComponentAst> directChildrenSpliterator()
      This method will NOT traverse any complex parameters this component has.
      Returns:
      a Spliterator for this component's children.
    • directChildrenStreamByIdentifier

      default Stream<ComponentAst> directChildrenStreamByIdentifier(String namespace, String elementName)
      Returns a Stream of all the direct children which getIdentifier() match the given namespace and name.

      Criterias are match with an AND operator, meaning that both values must match. However, setting null to any of the arguments acts as a wildcard, causing that particular criteria to be ignored

      Parameters:
      namespace - Predicate to match against the ComponentIdentifier.getNamespace() method
      elementName - Predicate to match against the ComponentIdentifier.getName() method
      Returns:
      The direct children which identifier matches the given filters
      Since:
      1.1.0