Class AstXmlParser.Builder

java.lang.Object
org.mule.runtime.ast.api.xml.AstXmlParser.Builder
Enclosing interface:
AstXmlParser

public static final class AstXmlParser.Builder extends Object
A builder for creating AstXmlParser instances.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withExtensionModel

      public AstXmlParser.Builder withExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
      Add an extension model for the parser.

      The target parser must contain the extension models for every namespace that is used in the XML config for the ArtifactAsts to be created correctly.

      Parameters:
      extensionModel - the extension model to add to the target parser
      Returns:
      the updated builder.
    • withExtensionModels

      public AstXmlParser.Builder withExtensionModels(Collection<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels)
      Add an extension model for the parser.

      The target parser must contain the extension models for every namespace that is used in the XML config for the ArtifactAsts to be created correctly.

      Parameters:
      extensionModels - the extension model to add to the target parser
      Returns:
      the updated builder.
    • withArtifactType

      public AstXmlParser.Builder withArtifactType(ArtifactType artifactType)
      Set the ArtifactType of the target ArtifactAst
      Parameters:
      artifactType - the type pf the target artifact.
      Returns:
      the updated builder.
    • withParentArtifact

      public AstXmlParser.Builder withParentArtifact(ArtifactAst parentArtifact)
      Set the ArtifactAst from the parent artifact (i.e.: the parent domain)
      Parameters:
      parentArtifact - the ArtifactAst that is the parent of the artifacts generated with this parser.
      Returns:
      the updated builder.
    • withSchemaValidationsDisabled

      public AstXmlParser.Builder withSchemaValidationsDisabled()
      Disables schema validations during the parse process.

      This will speed up the parsing process, but may provide an invalid ArtifactAst for invalid XMLs.

      Returns:
      the updated builder.
    • withPropertyResolver

      public AstXmlParser.Builder withPropertyResolver(org.mule.runtime.dsl.api.xml.parser.ParsingPropertyResolver propertyResolver)
      Sets the propertyResolver to be used to resolve property placeholders ({@code ${...}) found in the config. @param propertyResolver the property resolver to be used by the created {@link ArtifactAst}s. @return the updated builder.
    • withLegacyFailStrategy

      public AstXmlParser.Builder withLegacyFailStrategy()
    • build

      public AstXmlParser build()
      Creates a new ArtifactAst according to the state set to this builder.
      Returns:
      a newly built ArtifactAst.