- 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 Summary
Modifier and TypeMethodDescriptionThis method will NOT traverse any complex parameters this component has.This method will NOT traverse any complex parameters this component has.default Stream<ComponentAst>directChildrenStreamByIdentifier(String namespace, String elementName) Returns aStreamof all the direct children whichgetIdentifier()match the givennamespaceandname.An annotation is defined by the DSL processor that creates the instances ofComponentAst.org.mule.runtime.api.component.TypedComponentIdentifier.ComponentTypeorg.mule.runtime.api.meta.model.ExtensionModelorg.mule.runtime.api.component.ComponentIdentifierorg.mule.runtime.api.component.location.ComponentLocation<M> Optional<M>A component may be represented by different kinds of models, depending on the actual type of this component.getParameter(String groupName, String paramName) 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.org.mule.metadata.api.model.MetadataTypegetType()This method will also traverse the complex parameters in each component.recursiveSpliterator(AstTraversalDirection direction) This method will also traverse the complex parameters in each component.This method will also traverse the complex parameters in each component.recursiveStream(AstTraversalDirection direction) This method will also traverse the complex parameters in each component.
-
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
- Returns:
- the id of this component if it has one defined, or
emptyotherwise.
-
getAnnotations
An annotation is defined by the DSL processor that creates the instances ofComponentAst.- Returns:
- a
Mapcontaining 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
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 ofConfigurationModel,ComponentModelorConnectionProviderModel(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
- 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
groupNameandparamName.
-
getParameters
Collection<ComponentParameterAst> 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
Streamfor this component and its children recursively that navigates the whole AST usingTOP_DOWNdirection.
-
recursiveStream
This method will also traverse the complex parameters in each component.- Parameters:
direction- the @{link AstTraversalDirection} used to navigate the whole AST.- Returns:
- a
Streamfor 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
Spliteratorfor this component and its children recursively that navigates the whole AST usingTOP_DOWNdirection.
-
recursiveSpliterator
This method will also traverse the complex parameters in each component.- Parameters:
direction- the @{link AstTraversalDirection} used to navigate the whole AST.- Returns:
- a
Spliteratorfor 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
Listfor this component's children.
-
directChildrenStream
Stream<ComponentAst> directChildrenStream()- Returns:
- a
Streamfor this component's children.
-
directChildrenSpliterator
Spliterator<ComponentAst> directChildrenSpliterator()This method will NOT traverse any complex parameters this component has.- Returns:
- a
Spliteratorfor this component's children.
-
directChildrenStreamByIdentifier
Returns aStreamof all the direct children whichgetIdentifier()match the givennamespaceandname.Criterias are match with an AND operator, meaning that both values must match. However, setting
nullto any of the arguments acts as a wildcard, causing that particular criteria to be ignored
-