Interface AstXmlParser
ArtifactAst.
This parser needs to know the extension models that are used by the artifact in order to generate the ArtifactAst
correctly.
A single parser instance may be used to generate more than one ArtifactAst from different configs, since no state
specific to a parsing process is kept by this parser. The same parser may be used to parse different configs concurrently, as
well.
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder for creatingAstXmlParserinstances. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.mule.runtime.api.component.ComponentIdentifierstatic final org.mule.runtime.api.component.ComponentIdentifierstatic final org.mule.runtime.api.component.ComponentIdentifierstatic final org.mule.runtime.api.component.ComponentIdentifier -
Method Summary
Modifier and TypeMethodDescriptionstatic AstXmlParser.Builderbuilder()Creates a builder for anAstXmlParser.parse(String resourceName, InputStream appXmlConfigInputStream) Generate a newArtifactAstrepresentation form the XML read from the provided inputStream.parse(String artifactName, String resourceName, InputStream appXmlConfigInputStream) Generate a newArtifactAstrepresentation form the XML read from the provided inputStream.Generate a newArtifactAstrepresentation form the XML read from the provided uris.Generate a newArtifactAstrepresentation form the XML read from the provided urls.parse(String artifactName, List<org.mule.runtime.api.util.Pair<String, InputStream>> appXmlConfigInputStreams) Generate a newArtifactAstrepresentation form the XML read from the provided inputStreams.Generate a newArtifactAstrepresentation form the XML read from the provided inputStreams.Generate a newArtifactAstrepresentation form the XML read from the provided uris.Generate a newArtifactAstrepresentation form the XML read from the provided urls.parse(List<org.mule.runtime.api.util.Pair<String, InputStream>> appXmlConfigInputStreams) Generate a newArtifactAstrepresentation form the XML read from the provided inputStreams.parse(org.mule.runtime.dsl.api.ConfigResource... appXmlConfigResources) Generate a newArtifactAstrepresentation form the XML read from the provided inputStreams.parseDocument(String artifactName, List<org.mule.runtime.api.util.Pair<String, Document>> appXmlConfigDocuments) Generate a newArtifactAstrepresentation from the XML DOM tree.parseDocument(List<org.mule.runtime.api.util.Pair<String, Document>> appXmlConfigDocuments) Generate a newArtifactAstrepresentation form the XML DOM tree.
-
Field Details
-
IMPORT_IDENTIFIER
static final org.mule.runtime.api.component.ComponentIdentifier IMPORT_IDENTIFIER -
MULE_ROOT_IDENTIFIER
static final org.mule.runtime.api.component.ComponentIdentifier MULE_ROOT_IDENTIFIER -
DOMAIN_ROOT_IDENTIFIER
static final org.mule.runtime.api.component.ComponentIdentifier DOMAIN_ROOT_IDENTIFIER -
ANNOTATIONS_IDENTIFIER
static final org.mule.runtime.api.component.ComponentIdentifier ANNOTATIONS_IDENTIFIER
-
-
Method Details
-
builder
Creates a builder for anAstXmlParser.- Returns:
- a builder for an
AstXmlParser.
-
parseDocument
ArtifactAst parseDocument(String artifactName, List<org.mule.runtime.api.util.Pair<String, Document>> appXmlConfigDocuments) Generate a newArtifactAstrepresentation from the XML DOM tree.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.Note: The component metadata that is generated relies on data populated at the time of parsing the config XML into its
Document. In the case of this method, the providedDocumentmust be of level 3 and have that data populated for the component metadata about the underlying DSL to be accurate. The required data is auserDatawith keyXmlMetadataAnnotations.METADATA_ANNOTATIONS_KEYand value of typeXmlMetadataAnnotationson every node of the DOM tree.- Parameters:
artifactName- the name of the artifact to parseappXmlConfigDocuments- the XML content to be parsed. The first part of each pair is the name to be used as fileName in the metadata of the generatesArtifactAst.- Returns:
- the
ArtifactAstrepresentation of the provided XML config.
-
parseDocument
ArtifactAst parseDocument(List<org.mule.runtime.api.util.Pair<String, Document>> appXmlConfigDocuments) Generate a newArtifactAstrepresentation form the XML DOM tree.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.Note: The component metadata that is generated relies on data populated at the time of parsing the config XML into its
Document. In the case of this method, the providedDocumentmust be of level 3 and have that data populated for the component metadata about the underlying DSL to be accurate. The required data is auserDatawith keyXmlMetadataAnnotations.METADATA_ANNOTATIONS_KEYand value of typeXmlMetadataAnnotationson every node of the DOM tree.- Parameters:
appXmlConfigDocuments- the XML content to be parsed. The first part of each pair is the name to be used as fileName in the metadata of the generatesArtifactAst.- Returns:
- the
ArtifactAstrepresentation of the provided XML config. - Since:
- 1.1
-
parse
ArtifactAst parse(String artifactName, List<org.mule.runtime.api.util.Pair<String, InputStream>> appXmlConfigInputStreams) Generate a newArtifactAstrepresentation form the XML read from the provided inputStreams.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.- Parameters:
artifactName- the name of the artifact to parseappXmlConfigInputStreams- the streams that will provide the XML content to be parsed. The first part of each pair is the name to be used as fileName in the metadata of the generatesArtifactAst.- Returns:
- the
ArtifactAstrepresentation of the provided XML config. - Since:
- 1.1
-
parse
ArtifactAst parse(List<org.mule.runtime.api.util.Pair<String, InputStream>> appXmlConfigInputStreams) Generate a newArtifactAstrepresentation form the XML read from the provided inputStreams.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.- Parameters:
appXmlConfigInputStreams- the streams that will provide the XML content to be parsed. The first part of each pair is the name to be used as fileName in the metadata of the generatesArtifactAst.- Returns:
- the
ArtifactAstrepresentation of the provided XML config.
-
parse
ArtifactAst parse(String artifactName, org.mule.runtime.dsl.api.ConfigResource... appXmlConfigResources) Generate a newArtifactAstrepresentation form the XML read from the provided inputStreams.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.- Parameters:
artifactName- the name of the artifact to parseappXmlConfigResources- the resources that will provide the XML content to be parsed.- Returns:
- the
ArtifactAstrepresentation of the provided XML config.
-
parse
Generate a newArtifactAstrepresentation form the XML read from the provided inputStreams.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.- Parameters:
appXmlConfigResources- the resources that will provide the XML content to be parsed.- Returns:
- the
ArtifactAstrepresentation of the provided XML config.
-
parse
Generate a newArtifactAstrepresentation form the XML read from the provided inputStream.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.- Parameters:
artifactName- the name of the artifact to parseresourceName- the name to be used as fileName in the metadata of the generatesArtifactAst.appXmlConfigInputStream- the stream that will provide the XML content to be parsed.- Returns:
- the
ArtifactAstrepresentation of the provided XML config.
-
parse
Generate a newArtifactAstrepresentation form the XML read from the provided inputStream.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.- Parameters:
resourceName- the name to be used as fileName in the metadata of the generatesArtifactAst.appXmlConfigInputStream- the stream that will provide the XML content to be parsed.- Returns:
- the
ArtifactAstrepresentation of the provided XML config.
-
parse
Generate a newArtifactAstrepresentation form the XML read from the provided uris.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.- Parameters:
artifactName- the name of the artifact to parseappXmlConfigUris- the uris that will provide the XML content to be parsed.- Returns:
- the
ArtifactAstrepresentation of the provided XML config.
-
parse
Generate a newArtifactAstrepresentation form the XML read from the provided uris.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.- Parameters:
appXmlConfigUris- the uris that will provide the XML content to be parsed.- Returns:
- the
ArtifactAstrepresentation of the provided XML config.
-
parse
Generate a newArtifactAstrepresentation form the XML read from the provided urls.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.- Parameters:
artifactName- the name of the artifact to parseappXmlConfigUrls- the urls that will provide the XML content to be parsed.- Returns:
- the
ArtifactAstrepresentation of the provided XML config.
-
parse
Generate a newArtifactAstrepresentation form the XML read from the provided urls.The parsing process will resolve references in
importtags. Relative paths will be resolved using the currently setThreadContextClassLoader.- Parameters:
appXmlConfigUrls- the urls that will provide the XML content to be parsed.- Returns:
- the
ArtifactAstrepresentation of the provided XML config.
-