public final class XmlConfigurationDocumentLoader extends Object
Document object.
If when loading the configuration one, or more, ErrorHandler.error(SAXParseException) are call, at the end of
loadDocument(Supplier, EntityResolver, String, InputStream) will throw an exception containing all the errors.#loadDocument(Supplier, EntityResolver, String, InputStream)}public static XmlConfigurationDocumentLoader schemaValidatingDocumentLoader()
XmlConfigurationDocumentLoader using the default DefaultXmlGathererErrorHandlerFactory to
instantiate XmlGathererErrorHandlers objects when executing the
loadDocument(Supplier, EntityResolver, String, InputStream) method.
Using the default constructor implies that all XSD validations will take place and, at the end of the parsing, all the errors
will be contained in an MuleRuntimeException which will be thrown.XmlConfigurationDocumentLoaderpublic static XmlConfigurationDocumentLoader schemaValidatingDocumentLoader(XmlGathererErrorHandlerFactory errorHandlerFactory)
XmlConfigurationDocumentLoader using a parametrized XmlGathererErrorHandlerFactory to instantiate
XmlGathererErrorHandlers objects when executing the
loadDocument(Supplier, EntityResolver, String, InputStream) method.
Depending on what type of XmlGathererErrorHandler the factory returns, the
loadDocument(Supplier, EntityResolver, String, InputStream) method will not thrown any exception if
XmlGathererErrorHandler.getErrors() is an empty list.errorHandlerFactory - to create XmlGathererErrorHandler in the
loadDocument(Supplier, EntityResolver, String, InputStream)XmlConfigurationDocumentLoaderpublic static XmlConfigurationDocumentLoader noValidationDocumentLoader()
XmlConfigurationDocumentLoader that will ignore XSD validation when executing the
loadDocument(Supplier, EntityResolver, String, InputStream) method.
XmlConfigurationDocumentLoaderpublic Document loadDocument(Supplier<SAXParserFactory> saxParserFactorySupplier, String filename, InputStream inputStream, EntityResolver entityResolver)
Document from an InputStream with the required configuration of a mule configuration file parsing.inputStream - the input stream with the XML configuration content.Document object with the provided content.org.mule.runtime.api.exception.MuleRuntimeException - if an error occurs in MuleDocumentLoader factory, or if the current filename
contains 1 or more errors.DefaultXmlLoggerErrorHandler#getErrors()}public Document loadDocument(Supplier<SAXParserFactory> saxParserFactorySupplier, EntityResolver entityResolver, String filename, InputStream inputStream)
Document from an InputStream with the required configuration of a mule configuration file parsing.entityResolver - resolver for XML schemas.filename - name of the file to display a better error messages (if there are any). Non null.inputStream - the input stream with the XML configuration content.Document object with the provided content.org.mule.runtime.api.exception.MuleRuntimeException - if an error occurs in MuleDocumentLoader factory, or if the current filename
contains 1 or more errors.DefaultXmlLoggerErrorHandler#getErrors()}public Document loadDocument(Supplier<SAXParserFactory> saxParserFactorySupplier, EntityResolver entityResolver, String filename, InputStream inputStream, org.mule.apache.xerces.xni.grammars.XMLGrammarPool xmlGrammarPool)
Document from an InputStream with the required configuration of a mule configuration file parsing.entityResolver - resolver for XML schemas.filename - name of the file to display a better error messages (if there are any). Non null.inputStream - the input stream with the XML configuration content.xmlGrammarPool - a XMLGrammarPool pool to be used while file parsing.Document object with the provided content.org.mule.runtime.api.exception.MuleRuntimeException - if an error occurs in MuleDocumentLoader factory, or if the current filename
contains 1 or more errors.DefaultXmlLoggerErrorHandler#getErrors()}Copyright © 2025 MuleSoft, Inc.. All rights reserved.