public class OMXMLBuilderFactory extends Object
Modifier and Type | Method and Description |
---|---|
static OMXMLParserWrapper |
createOMBuilder(InputStream in)
Create an object model builder that reads a plain XML document from the provided input stream
with the default parser configuration defined by
StAXParserConfiguration.DEFAULT . |
static OMXMLParserWrapper |
createOMBuilder(InputStream in,
String encoding)
Create an object model builder that reads a plain XML document from the provided input stream
with the default parser configuration defined by
StAXParserConfiguration.DEFAULT . |
static OMXMLParserWrapper |
createOMBuilder(Node node,
boolean expandEntityReferences)
Create an object model builder that reads a plain XML document from the provided DOM tree.
|
static OMXMLParserWrapper |
createOMBuilder(OMFactory omFactory,
InputStream in)
Create an object model builder that reads an XML document from the provided input stream
using a specified object model factory and with the default parser configuration defined by
StAXParserConfiguration.DEFAULT . |
static OMXMLParserWrapper |
createOMBuilder(OMFactory omFactory,
InputStream in,
String encoding)
Create an object model builder that reads an XML document from the provided input stream
using a specified object model factory and with the default parser configuration defined by
StAXParserConfiguration.DEFAULT . |
static OMXMLParserWrapper |
createOMBuilder(OMFactory omFactory,
Node node,
boolean expandEntityReferences)
Create an object model builder that reads an XML document from the provided DOM tree using a
specified object model factory.
|
static OMXMLParserWrapper |
createOMBuilder(OMFactory omFactory,
Reader in)
Create an object model builder that reads an XML document from the provided character stream
using a specified object model factory and with the default parser configuration defined by
StAXParserConfiguration.DEFAULT . |
static OMXMLParserWrapper |
createOMBuilder(OMFactory omFactory,
SAXSource source,
boolean expandEntityReferences)
Create an object model builder that reads an XML document from the provided
SAXSource
using a specified object model factory. |
static OMXMLParserWrapper |
createOMBuilder(OMFactory omFactory,
Source source)
Create an object model builder that reads an XML document from the provided
Source
using a specified object model factory. |
static OMXMLParserWrapper |
createOMBuilder(OMFactory omFactory,
StAXParserConfiguration configuration,
Attachments attachments)
Create an XOP aware model builder from the provided
Attachments object using a
specified object model factory and with a given parser configuration. |
static OMXMLParserWrapper |
createOMBuilder(OMFactory omFactory,
StAXParserConfiguration configuration,
InputStream in)
Create an object model builder that reads an XML document from the provided input stream
using a specified object model factory and with a given parser configuration.
|
static OMXMLParserWrapper |
createOMBuilder(OMFactory omFactory,
StAXParserConfiguration configuration,
InputStream in,
String encoding)
Create an object model builder that reads an XML document from the provided input stream
using a specified object model factory and with a given parser configuration.
|
static OMXMLParserWrapper |
createOMBuilder(OMFactory omFactory,
StAXParserConfiguration configuration,
Reader in)
Create an object model builder that reads an XML document from the provided character stream
using a specified object model factory and with a given parser configuration.
|
static OMXMLParserWrapper |
createOMBuilder(Reader in)
Create an object model builder that reads a plain XML document from the provided character
stream with the default parser configuration defined by
StAXParserConfiguration.DEFAULT . |
static OMXMLParserWrapper |
createOMBuilder(SAXSource source,
boolean expandEntityReferences)
Create an object model builder that reads a plain XML document from the provided
SAXSource . |
static OMXMLParserWrapper |
createOMBuilder(Source source)
Create an object model builder that reads a plain XML document from the provided
Source . |
static OMXMLParserWrapper |
createOMBuilder(StAXParserConfiguration configuration,
Attachments attachments)
Create an XOP aware model builder from the provided
Attachments object and with a
given parser configuration. |
static OMXMLParserWrapper |
createOMBuilder(StAXParserConfiguration configuration,
InputStream in)
Create an object model builder that reads a plain XML document from the provided input stream
with a given parser configuration.
|
static OMXMLParserWrapper |
createOMBuilder(StAXParserConfiguration configuration,
InputStream in,
String encoding)
Create an object model builder that reads a plain XML document from the provided input stream
with a given parser configuration.
|
static OMXMLParserWrapper |
createOMBuilder(StAXParserConfiguration configuration,
Reader in)
Create an object model builder that reads a plain XML document from the provided character
stream with a given parser configuration.
|
static SOAPModelBuilder |
createSOAPModelBuilder(Attachments attachments)
Create an MTOM aware model builder from the provided
Attachments object. |
static SOAPModelBuilder |
createSOAPModelBuilder(InputStream in,
String encoding)
Create an object model builder for SOAP that reads a message from the provided input stream,
using a given charset encoding.
|
static SOAPModelBuilder |
createSOAPModelBuilder(OMMetaFactory metaFactory,
Attachments attachments)
Create an MTOM aware model builder from the provided
Attachments object using a
particular Axiom implementation. |
static SOAPModelBuilder |
createSOAPModelBuilder(OMMetaFactory metaFactory,
InputStream in,
String encoding)
Create an object model builder for SOAP that reads a message from the provided input stream,
using a particular Axiom implementation and a given charset encoding.
|
static SOAPModelBuilder |
createSOAPModelBuilder(OMMetaFactory metaFactory,
Reader in)
Create an object model builder for SOAP that reads a message from the provided character
stream using a particular Axiom implementation.
|
static SOAPModelBuilder |
createSOAPModelBuilder(OMMetaFactory metaFactory,
Source source)
Create an object model builder for SOAP that reads a message from the provided
Source
using a particular Axiom implementation. |
static SOAPModelBuilder |
createSOAPModelBuilder(Reader in)
Create an object model builder for SOAP that reads a message from the provided character
stream.
|
static SOAPModelBuilder |
createSOAPModelBuilder(Source source)
Create an object model builder for SOAP that reads a message from the provided
Source . |
static OMXMLParserWrapper |
createStAXOMBuilder(OMFactory omFactory,
javax.xml.stream.XMLStreamReader parser)
Create an object model builder that pulls events from a StAX stream reader using a specified
object model factory.
|
static OMXMLParserWrapper |
createStAXOMBuilder(javax.xml.stream.XMLStreamReader parser)
Create an object model builder for plain XML that pulls events from a StAX stream reader.
|
static SOAPModelBuilder |
createStAXSOAPModelBuilder(OMMetaFactory metaFactory,
javax.xml.stream.XMLStreamReader parser)
Create an object model builder for SOAP that pulls events from a StAX stream reader and that
uses a particular Axiom implementation.
|
static SOAPModelBuilder |
createStAXSOAPModelBuilder(javax.xml.stream.XMLStreamReader parser)
Create an object model builder for SOAP that pulls events from a StAX stream reader.
|
public static OMXMLParserWrapper createStAXOMBuilder(javax.xml.stream.XMLStreamReader parser)
The reader must be positioned on a XMLStreamConstants.START_DOCUMENT
or
XMLStreamConstants.START_ELEMENT
event. If the current event is
XMLStreamConstants.START_DOCUMENT
then the builder will consume events up to the
XMLStreamConstants.END_DOCUMENT
event. If the current event is
XMLStreamConstants.START_ELEMENT
, then the builder will consume events up to the
corresponding XMLStreamConstants.END_ELEMENT
. After the object model is completely
built, the stream reader will be positioned on the event immediately following this
XMLStreamConstants.END_ELEMENT
event. This means that this method can be used in a
well defined way to build an object model from a fragment (corresponding to a single element)
of the document represented by the stream reader.
The builder supports the XMLStreamReader
extension defined by
DataHandlerReader
as well as the legacy extension mechanism defined in the
documentation of XMLStreamReaderUtils
.
The returned builder also performs namespace repairing, i.e. it adds appropriate namespace declarations if undeclared namespaces appear in the StAX stream.
parser
- the stream reader to read the XML data fromOMException
- if the stream reader is positioned on an event other than
XMLStreamConstants.START_DOCUMENT
or
XMLStreamConstants.START_ELEMENT
public static OMXMLParserWrapper createStAXOMBuilder(OMFactory omFactory, javax.xml.stream.XMLStreamReader parser)
See createStAXOMBuilder(XMLStreamReader)
for more information about the behavior of
the returned builder.
omFactory
- the object model factory to useparser
- the stream reader to read the XML data frompublic static OMXMLParserWrapper createOMBuilder(InputStream in)
StAXParserConfiguration.DEFAULT
.in
- the input stream representing the XML documentpublic static OMXMLParserWrapper createOMBuilder(InputStream in, String encoding)
StAXParserConfiguration.DEFAULT
.in
- the input stream representing the XML documentencoding
- the charset encoding of the XML document or null
if the parser should
determine the charset encodingpublic static OMXMLParserWrapper createOMBuilder(StAXParserConfiguration configuration, InputStream in)
configuration
- the parser configuration to usein
- the input stream representing the XML documentpublic static OMXMLParserWrapper createOMBuilder(StAXParserConfiguration configuration, InputStream in, String encoding)
configuration
- the parser configuration to usein
- the input stream representing the XML documentencoding
- the charset encoding of the XML document or null
if the parser should
determine the charset encodingpublic static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, InputStream in)
StAXParserConfiguration.DEFAULT
.omFactory
- the object model factory to usein
- the input stream representing the XML documentpublic static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, InputStream in, String encoding)
StAXParserConfiguration.DEFAULT
.omFactory
- the object model factory to usein
- the input stream representing the XML documentencoding
- the charset encoding of the XML document or null
if the parser should
determine the charset encodingpublic static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, StAXParserConfiguration configuration, InputStream in)
omFactory
- the object model factory to useconfiguration
- the parser configuration to usein
- the input stream representing the XML documentpublic static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, StAXParserConfiguration configuration, InputStream in, String encoding)
omFactory
- the object model factory to useconfiguration
- the parser configuration to usein
- the input stream representing the XML documentencoding
- the charset encoding of the XML document or null
if the parser should
determine the charset encodingpublic static OMXMLParserWrapper createOMBuilder(Reader in)
StAXParserConfiguration.DEFAULT
.in
- the character stream representing the XML documentpublic static OMXMLParserWrapper createOMBuilder(StAXParserConfiguration configuration, Reader in)
configuration
- the parser configuration to usein
- the character stream representing the XML documentpublic static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, Reader in)
StAXParserConfiguration.DEFAULT
.omFactory
- the object model factory to usein
- the character stream representing the XML documentpublic static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, StAXParserConfiguration configuration, Reader in)
omFactory
- the object model factory to useconfiguration
- the parser configuration to usein
- the character stream representing the XML documentpublic static OMXMLParserWrapper createOMBuilder(Source source)
Source
. When used with a DOMSource
or SAXSource
, entities are
expanded, i.e. the method has the same behavior as createOMBuilder(Node, boolean)
and createOMBuilder(SAXSource, boolean)
with expandEntityReferences
set to
true
.source
- the source of the XML documentpublic static OMXMLParserWrapper createOMBuilder(Node node, boolean expandEntityReferences)
node
- the DOM node; must be a Node.DOCUMENT_NODE
or Node.ELEMENT_NODE
expandEntityReferences
- Determines how EntityReference
nodes are handled:
false
then a single OMEntityReference
will be created for each EntityReference
. The child nodes of
EntityReference
nodes are not taken into account.
true
then no OMEntityReference
nodes
are created and the children of EntityReference
nodes are converted and
inserted into the Axiom tree.
public static OMXMLParserWrapper createOMBuilder(SAXSource source, boolean expandEntityReferences)
SAXSource
.source
- the source of the XML documentexpandEntityReferences
- Determines how entity references (i.e. LexicalHandler.startEntity(String)
and LexicalHandler.endEntity(String)
events) are handled:
false
then a single OMEntityReference
will be created for each pair of LexicalHandler.startEntity(String)
and
LexicalHandler.endEntity(String)
events. Other events reported between
these two events are not taken into account.
true
then no OMEntityReference
nodes
are created and LexicalHandler.startEntity(String)
and
LexicalHandler.endEntity(String)
events are ignored. However, events
between LexicalHandler.startEntity(String)
and
LexicalHandler.endEntity(String)
are processed normally.
public static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, Source source)
Source
using a specified object model factory. When used with a DOMSource
or
SAXSource
, entities are expanded, i.e. the method has the same behavior as
createOMBuilder(OMFactory, Node, boolean)
and
createOMBuilder(OMFactory, SAXSource, boolean)
with expandEntityReferences
set to true
.omFactory
- the object model factory to usesource
- the source of the XML documentpublic static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, Node node, boolean expandEntityReferences)
omFactory
- the object model factory to usenode
- the DOM node; must be a Node.DOCUMENT_NODE
or Node.ELEMENT_NODE
expandEntityReferences
- Determines how EntityReference
nodes are handled:
false
then a single OMEntityReference
will be created for each EntityReference
. The child nodes of
EntityReference
nodes are not taken into account.
true
then no OMEntityReference
nodes
are created and the children of EntityReference
nodes are converted and
inserted into the Axiom tree.
public static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, SAXSource source, boolean expandEntityReferences)
SAXSource
using a specified object model factory.omFactory
- the object model factory to usesource
- the source of the XML documentexpandEntityReferences
- Determines how entity references (i.e. LexicalHandler.startEntity(String)
and LexicalHandler.endEntity(String)
events) are handled:
false
then a single OMEntityReference
will be created for each pair of LexicalHandler.startEntity(String)
and
LexicalHandler.endEntity(String)
events. Other events reported between
these two events are not taken into account.
true
then no OMEntityReference
nodes
are created and LexicalHandler.startEntity(String)
and
LexicalHandler.endEntity(String)
events are ignored. However, events
between LexicalHandler.startEntity(String)
and
LexicalHandler.endEntity(String)
are processed normally.
public static OMXMLParserWrapper createOMBuilder(StAXParserConfiguration configuration, Attachments attachments)
Attachments
object and with a
given parser configuration.configuration
- the parser configuration to useattachments
- an Attachments
object that must have been created from an input streamOMException
- if an error occurs while processing the content type information from the
Attachments
objectpublic static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, StAXParserConfiguration configuration, Attachments attachments)
Attachments
object using a
specified object model factory and with a given parser configuration.omFactory
- the object model factory to useconfiguration
- the parser configuration to useattachments
- an Attachments
object that must have been created from an input streamOMException
- if an error occurs while processing the content type information from the
Attachments
objectpublic static SOAPModelBuilder createStAXSOAPModelBuilder(OMMetaFactory metaFactory, javax.xml.stream.XMLStreamReader parser)
SOAPFactory
based on the namespace URI of the SOAP envelope.
See createStAXOMBuilder(XMLStreamReader)
for more information about the behavior of
the returned builder.
metaFactory
- the meta factory for the Axiom implementation to useparser
- the stream reader to read the XML data frompublic static SOAPModelBuilder createStAXSOAPModelBuilder(javax.xml.stream.XMLStreamReader parser)
SOAPFactory
based on the namespace URI of the SOAP envelope.
See createStAXOMBuilder(XMLStreamReader)
for more information about the behavior of
the returned builder.
parser
- the stream reader to read the XML data frompublic static SOAPModelBuilder createSOAPModelBuilder(InputStream in, String encoding)
SOAPFactory
based on the namespace URI of the SOAP envelope. It will configure the underlying parser as
specified by StAXParserConfiguration.SOAP
.in
- the input stream containing the SOAP messageencoding
- the charset encoding of the SOAP message or null
if the parser should
determine the charset encodingpublic static SOAPModelBuilder createSOAPModelBuilder(OMMetaFactory metaFactory, InputStream in, String encoding)
SOAPFactory
based on the namespace URI of the SOAP envelope. It will
configure the underlying parser as specified by StAXParserConfiguration.SOAP
.metaFactory
- the meta factory for the Axiom implementation to usein
- the input stream containing the SOAP messageencoding
- the charset encoding of the SOAP message or null
if the parser should
determine the charset encodingpublic static SOAPModelBuilder createSOAPModelBuilder(Reader in)
SOAPFactory
based on the namespace URI
of the SOAP envelope. It will configure the underlying parser as specified by
StAXParserConfiguration.SOAP
.in
- the character stream containing the SOAP messagepublic static SOAPModelBuilder createSOAPModelBuilder(OMMetaFactory metaFactory, Reader in)
SOAPFactory
based on the namespace URI of the SOAP envelope. It will configure the
underlying parser as specified by StAXParserConfiguration.SOAP
.metaFactory
- the meta factory for the Axiom implementation to usein
- the character stream containing the SOAP messagepublic static SOAPModelBuilder createSOAPModelBuilder(Source source)
Source
.
The method will select the appropriate SOAPFactory
based on the namespace URI of
the SOAP envelope.source
- the source of the SOAP messagepublic static SOAPModelBuilder createSOAPModelBuilder(OMMetaFactory metaFactory, Source source)
Source
using a particular Axiom implementation. The method will select the appropriate
SOAPFactory
based on the namespace URI of the SOAP envelope.metaFactory
- the meta factory for the Axiom implementation to usesource
- the source of the SOAP messagepublic static SOAPModelBuilder createSOAPModelBuilder(Attachments attachments)
Attachments
object. The method
will determine the SOAP version based on the content type information from the
Attachments
object. It will configure the underlying parser as specified by
StAXParserConfiguration.SOAP
.attachments
- an Attachments
object that must have been created from an input streamOMException
- if an error occurs while processing the content type information from the
Attachments
objectpublic static SOAPModelBuilder createSOAPModelBuilder(OMMetaFactory metaFactory, Attachments attachments)
Attachments
object using a
particular Axiom implementation. The method will determine the SOAP version based on the
content type information from the Attachments
object. It will configure the
underlying parser as specified by StAXParserConfiguration.SOAP
.metaFactory
- the meta factory for the Axiom implementation to useattachments
- an Attachments
object that must have been created from an input streamOMException
- if an error occurs while processing the content type information from the
Attachments
objectCopyright © The Apache Software Foundation. All Rights Reserved.