Package org.mule.runtime.ast.api.builder
Interface ArtifactAstBuilder
- All Known Implementing Classes:
DefaultArtifactAstBuilder
@NoImplement
public interface ArtifactAstBuilder
Provides a way of creating
ArtifactAst instances, adding and configuring its components.- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionAdds a top-level component to the artifact being built with this builder.build()Builds the target artifact and its inner components.static ArtifactAstBuilderbuilder(String artifactName, ArtifactType artifactType, Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact, UnaryOperator<String> basePropertiesResolver) static ArtifactAstBuilderbuilder(String artifactName, ArtifactType artifactType, Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact, UnaryOperator<String> basePropertiesResolver, ExtensionModelHelper extModelHelper) static ArtifactAstBuilderbuilder(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact) static ArtifactAstBuilderbuilder(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact, UnaryOperator<String> basePropertiesResolver) Instantiates a new raw builder, whose components will be declared in the providedextensionModels.static ArtifactAstBuilderbuilder(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact, UnaryOperator<String> basePropertiesResolver, ExtensionModelHelper extModelHelper) Instantiates a new raw builder, whose components will be declared in the providedextensionModels.static ArtifactAstBuilderbuilder(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact, ExtensionModelHelper extModelHelper) withImportedResource(ImportedResource resource) Adds a resource to be imported by the resultingArtifactAst.voidwithNamespaceDefinition(NamespaceDefinition namespaceDefinition) Adds aNamespaceDefinitionto the Artifact being built.
-
Method Details
-
builder
static ArtifactAstBuilder builder(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact) -
builder
static ArtifactAstBuilder builder(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact, ExtensionModelHelper extModelHelper) -
builder
static ArtifactAstBuilder builder(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact, UnaryOperator<String> basePropertiesResolver) Instantiates a new raw builder, whose components will be declared in the providedextensionModels.- Parameters:
extensionsModels- contain the declaration of the components to be added to the targetArtifactAst.parentArtifact- theArtifactAstthat is the parent of the target artifact.basePropertiesResolver- the resolver for properties that may be found during the basic building of the AST (for instance, the names of components used to generate locations).- Returns:
- the newly created builder
-
builder
static ArtifactAstBuilder builder(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact, UnaryOperator<String> basePropertiesResolver, ExtensionModelHelper extModelHelper) Instantiates a new raw builder, whose components will be declared in the providedextensionModels.- Parameters:
extensionsModels- contain the declaration of the components to be added to the targetArtifactAst.parentArtifact- theArtifactAstthat is the parent of the target artifact.basePropertiesResolver- the resolver for properties that may be found during the basic building of the AST (for instance, the names of components used to generate locations).- Returns:
- the newly created builder
-
builder
static ArtifactAstBuilder builder(String artifactName, ArtifactType artifactType, Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact, UnaryOperator<String> basePropertiesResolver) -
builder
static ArtifactAstBuilder builder(String artifactName, ArtifactType artifactType, Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionsModels, Optional<ArtifactAst> parentArtifact, UnaryOperator<String> basePropertiesResolver, ExtensionModelHelper extModelHelper) -
addTopLevelComponent
ComponentAstBuilder addTopLevelComponent()Adds a top-level component to the artifact being built with this builder.- Returns:
- the builder for the newly added top-level component
-
createMetadataBuilder
ComponentMetadataAstBuilder createMetadataBuilder()- Returns:
- A properly configured
ComponentMetadataAstBuilderto use with this instance.
-
build
ArtifactAst build()Builds the target artifact and its inner components.- Returns:
- the target artifact.
-
withNamespaceDefinition
Adds aNamespaceDefinitionto the Artifact being built.- Parameters:
namespaceDefinition- the namespace definition to be added.
-
withImportedResource
Adds a resource to be imported by the resultingArtifactAst.- Parameters:
resource- The resource to be imported by the resultingArtifactAst.- Returns:
- the same ast builder.
-