Class BaseComponentAstDecorator

java.lang.Object
org.mule.runtime.ast.api.util.BaseComponentAstDecorator
All Implemented Interfaces:
ComponentAst

public abstract class BaseComponentAstDecorator extends Object implements ComponentAst
This class provides a skeletal implementation of the ComponentAst interface, to minimize the effort required to implement this interface when decorating instances of ComponentAst.
Since:
1.0
  • Constructor Details

    • BaseComponentAstDecorator

      public BaseComponentAstDecorator(ComponentAst decorated)
      Creates a new decorator for the provided instance.
      Parameters:
      decorated - the ComponentAst instance to decorate.
  • Method Details

    • getDecorated

      protected ComponentAst getDecorated()
      Returns:
      the decorated ComponentAst instance.
    • recursiveStream

      public Stream<ComponentAst> recursiveStream(AstTraversalDirection direction)
      Description copied from interface: ComponentAst
      This method will also traverse the complex parameters in each component.
      Specified by:
      recursiveStream in interface ComponentAst
      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}.
    • recursiveStream

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

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

      public Spliterator<ComponentAst> recursiveSpliterator(AstTraversalDirection direction)
      Description copied from interface: ComponentAst
      This method will also traverse the complex parameters in each component.
      Specified by:
      recursiveSpliterator in interface ComponentAst
      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

      public List<ComponentAst> directChildren()
      Description copied from interface: ComponentAst
      This method will NOT traverse any complex parameters this component has.
      Specified by:
      directChildren in interface ComponentAst
      Returns:
      a List for this component's children.
    • directChildrenStream

      public Stream<ComponentAst> directChildrenStream()
      Specified by:
      directChildrenStream in interface ComponentAst
      Returns:
      a Stream for this component's children.
    • directChildrenSpliterator

      public Spliterator<ComponentAst> directChildrenSpliterator()
      Description copied from interface: ComponentAst
      This method will NOT traverse any complex parameters this component has.
      Specified by:
      directChildrenSpliterator in interface ComponentAst
      Returns:
      a Spliterator for this component's children.
    • getParameters

      public Collection<ComponentParameterAst> getParameters()
      Description copied from interface: ComponentAst
      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.
      Specified by:
      getParameters in interface ComponentAst
      Returns:
      the ASTs of all the parameters, even if they don't have a value.
    • getParameter

      public ComponentParameterAst getParameter(String groupName, String paramName)
      Specified by:
      getParameter in interface ComponentAst
      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.
    • getExtensionModel

      public org.mule.runtime.api.meta.model.ExtensionModel getExtensionModel()
      Specified by:
      getExtensionModel in interface ComponentAst
      Returns:
      the extension model that declares the model this component represents.
    • getModel

      public <M> Optional<M> getModel(Class<M> modelClass)
      Description copied from interface: ComponentAst
      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).
      Specified by:
      getModel in interface ComponentAst
      Parameters:
      modelClass - the class of the model this method should return.
      Returns:
      the model that represents this component.
    • getType

      public org.mule.metadata.api.model.MetadataType getType()
      Specified by:
      getType in interface ComponentAst
      Returns:
      the type that represents this component, if it is represented by a type.
    • getAnnotations

      public Map<String,Object> getAnnotations()
      Description copied from interface: ComponentAst
      An annotation is defined by the DSL processor that creates the instances of ComponentAst.
      Specified by:
      getAnnotations in interface ComponentAst
      Returns:
      a Map containing the annotations for this component.
    • getMetadata

      public ComponentMetadataAst getMetadata()
      Specified by:
      getMetadata in interface ComponentAst
      Returns:
      the parser metadata for this component.
    • getLocation

      public org.mule.runtime.api.component.location.ComponentLocation getLocation()
      Specified by:
      getLocation in interface ComponentAst
      Returns:
      the location of the component in the configuration.
    • getIdentifier

      public org.mule.runtime.api.component.ComponentIdentifier getIdentifier()
      Specified by:
      getIdentifier in interface ComponentAst
      Returns:
      the identifier for the configuration element this object represents.
    • getComponentType

      public org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType getComponentType()
      Specified by:
      getComponentType in interface ComponentAst
      Returns:
      a general typification of the role of this component.
    • getComponentId

      public Optional<String> getComponentId()
      Specified by:
      getComponentId in interface ComponentAst
      Returns:
      the id of this component if it has one defined, or empty otherwise.
    • getGenerationInformation

      public ComponentGenerationInformation getGenerationInformation()
      Specified by:
      getGenerationInformation in interface ComponentAst
      Returns:
      an object containing information about the generation of this component.
    • toString

      public String toString()
      Overrides:
      toString in class Object