- All Known Implementing Classes:
BaseArtifactAst
@NoImplement
public interface ArtifactAst
Represents a Mule artifact and provides access to its contents.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionSet<org.mule.runtime.api.meta.model.ExtensionModel>The way the dependencies are calculated depends on theDependencyResolutionModeset.default Optional<org.mule.runtime.extension.api.dsl.syntax.resolver.DslSyntaxResolver>dependenciesDsl(org.mule.runtime.api.meta.model.ExtensionModel extensionModel) Looks up the dsl syntax that was used for an extension during the ast creation.default org.mule.runtime.api.exception.ErrorTypeRepositoryGets an enriched error repository.filteredComponents(Predicate<ComponentAst> predicate) Given aPredicate, navigates the whole AST looking for allComponentAsts satisfied by the providedPredicateorg.mule.runtime.api.exception.ErrorTypeRepositorydefault NamespaceDefinitionrecursiveSpliterator(AstTraversalDirection direction) recursiveStream(AstTraversalDirection direction) voidupdatePropertiesResolver(UnaryOperator<String> newPropertiesResolver) Updates the mapping used to resolve property placeholders throughout the AST.
-
Method Details
-
getArtifactName
String getArtifactName()- Returns:
- the name of the artifact represented by this object.
- Since:
- 1.1
-
getArtifactType
ArtifactType getArtifactType()- Returns:
- the type of the artifact represented by this object.
- Since:
- 1.1
-
dependencies
Set<org.mule.runtime.api.meta.model.ExtensionModel> dependencies()The way the dependencies are calculated depends on theDependencyResolutionModeset.- Returns:
- the
ExtensionModels this artifact depends on.
-
dependenciesDsl
default Optional<org.mule.runtime.extension.api.dsl.syntax.resolver.DslSyntaxResolver> dependenciesDsl(org.mule.runtime.api.meta.model.ExtensionModel extensionModel) Looks up the dsl syntax that was used for an extension during the ast creation.- Returns:
- the dsl syntax for the
extensionModelif avialable,Optional.empty()if not.
-
namespaceDefinition
- Returns:
- a
NamespaceDefinitionthat represents the namespace definition of this artifact.
-
getParent
Optional<ArtifactAst> getParent()- Returns:
- the
ArtifactAstthat is the parent of this artifact, if available.
-
recursiveStream
Stream<ComponentAst> recursiveStream()- Returns:
- a
Streamfor this component and its children recursively that navigates the whole AST usingTOP_DOWNdirection.
-
recursiveStream
- 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()- Returns:
- a
Spliteratorfor this component and its children recursively that navigates the whole AST usingTOP_DOWNdirection.
-
recursiveSpliterator
- 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}.
-
topLevelComponents
List<ComponentAst> topLevelComponents()- Returns:
- a
Listfor the top-level components (i.e.: configs, flows) of the artifact represented by this AST.
-
topLevelComponentsStream
Stream<ComponentAst> topLevelComponentsStream()- Returns:
- a
Streamfor the top-level components (i.e.: configs, flows) of the artifact represented by this AST.
-
topLevelComponentsSpliterator
Spliterator<ComponentAst> topLevelComponentsSpliterator()- Returns:
- a
Spliteratorfor the top-level components (i.e.: configs, flows) of the artifact represented by this AST.
-
filteredComponents
Given aPredicate, navigates the whole AST looking for allComponentAsts satisfied by the providedPredicateCheck
ComponentAstPredicatesFactory, there are severalPredicatealready defined.- Parameters:
predicate- thePredicateto test.- Returns:
- a
StreamfilteringComponentAstthat satisfied thepredicate.
-
updatePropertiesResolver
Updates the mapping used to resolve property placeholders throughout the AST.The received operator will transform a
Stringcontaining keys surrounded with placeholder delimiters (${}) to aStringwith those placeholders replaced with the appropriate property.Bear in mind that a parameter resolved at one time may have a certain value, and resolving that parameter again after calling this method may yield another value.
- Parameters:
newPropertiesResolver- the new resolver to use for the component parameters of this artifact.
-
getErrorTypeRepository
org.mule.runtime.api.exception.ErrorTypeRepository getErrorTypeRepository()- Returns:
- the error types
-
getImportedResources
Collection<ImportedResource> getImportedResources()- Returns:
- a collection containing the imported resources. If the imported resource contains a transitive import, it's also included in the result.
-
enrichedErrorTypeRepository
default org.mule.runtime.api.exception.ErrorTypeRepository enrichedErrorTypeRepository()Gets an enriched error repository. This will involve error types that are registered depending on the environment.- Returns:
- the enriched
ErrorTypeRepositoryinstance
-