Interface ArtifactAst

All Known Implementing Classes:
BaseArtifactAst

@NoImplement public interface ArtifactAst
Represents a Mule artifact and provides access to its contents.
Since:
1.0
  • 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 the DependencyResolutionMode set.
      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 extensionModel if avialable, Optional.empty() if not.
    • namespaceDefinition

      default NamespaceDefinition namespaceDefinition()
      Returns:
      a NamespaceDefinition that represents the namespace definition of this artifact.
    • getParent

      Optional<ArtifactAst> getParent()
      Returns:
      the ArtifactAst that is the parent of this artifact, if available.
    • recursiveStream

      Stream<ComponentAst> recursiveStream()
      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)
      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()
      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)
      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}.
    • topLevelComponents

      List<ComponentAst> topLevelComponents()
      Returns:
      a List for the top-level components (i.e.: configs, flows) of the artifact represented by this AST.
    • topLevelComponentsStream

      Stream<ComponentAst> topLevelComponentsStream()
      Returns:
      a Stream for the top-level components (i.e.: configs, flows) of the artifact represented by this AST.
    • topLevelComponentsSpliterator

      Spliterator<ComponentAst> topLevelComponentsSpliterator()
      Returns:
      a Spliterator for the top-level components (i.e.: configs, flows) of the artifact represented by this AST.
    • filteredComponents

      Stream<ComponentAst> filteredComponents(Predicate<ComponentAst> predicate)
      Given a Predicate, navigates the whole AST looking for all ComponentAsts satisfied by the provided Predicate

      Check ComponentAstPredicatesFactory, there are several Predicate already defined.

      Parameters:
      predicate - the Predicate to test.
      Returns:
      a Stream filtering ComponentAst that satisfied the predicate.
    • updatePropertiesResolver

      void updatePropertiesResolver(UnaryOperator<String> newPropertiesResolver)
      Updates the mapping used to resolve property placeholders throughout the AST.

      The received operator will transform a String containing keys surrounded with placeholder delimiters (${}) to a String with 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 ErrorTypeRepository instance