org.apache.axiom.om
Interface OMMetaFactory

All Known Subinterfaces:
DOMMetaFactory, OMMetaFactoryEx

public interface OMMetaFactory

Object model meta factory. This interface encapsulates a particular Axiom implementation and provides instances for plain XML, SOAP 1.1 and SOAP 1.2 object model factories for that implementation. Currently the two OM implementations provided by Axiom are LLOM (linked list) and DOOM (DOM compatible).

The factories returned by getOMFactory(), getSOAP11Factory() and getSOAP12Factory() MUST be stateless (and thread safe). The implementation MUST return the same instance on every invocation, i.e. instantiate the factory for each OM type only once.


Method Summary
 OMXMLParserWrapper createOMBuilder(OMFactory omFactory, Node node, boolean expandEntityReferences)
          Create an object model builder for plain XML that gets its input from a DOM tree.
 OMXMLParserWrapper createOMBuilder(OMFactory omFactory, SAXSource source, boolean expandEntityReferences)
          Create an object model builder for plain XML that gets its input from a SAXSource.
 OMXMLParserWrapper createOMBuilder(OMFactory omFactory, Source source)
          Create an object model builder for plain XML that gets its input from a Source.
 OMXMLParserWrapper createOMBuilder(OMFactory omFactory, StAXParserConfiguration configuration, InputSource is)
          Create an object model builder for plain XML that reads a document from the provided input source.
 OMXMLParserWrapper createOMBuilder(StAXParserConfiguration configuration, OMFactory omFactory, InputSource rootPart, MimePartProvider mimePartProvider)
          Create an XOP aware object model builder.
 SOAPModelBuilder createSOAPModelBuilder(StAXParserConfiguration configuration, InputSource is)
          Create an object model builder for SOAP that reads a message from the provided input source.
 SOAPModelBuilder createSOAPModelBuilder(StAXParserConfiguration configuration, SOAPFactory soapFactory, InputSource rootPart, MimePartProvider mimePartProvider)
          Create an MTOM aware object model builder.
 OMXMLParserWrapper createStAXOMBuilder(OMFactory omFactory, XMLStreamReader parser)
          Create an object model builder for plain XML that pulls events from a StAX stream reader.
 SOAPModelBuilder createStAXSOAPModelBuilder(XMLStreamReader parser)
          Create an object model builder for SOAP that pulls events from a StAX stream reader.
 OMFactory getOMFactory()
          Get the OM factory instance for the XML infoset model.
 SOAPFactory getSOAP11Factory()
          Get the OM factory instance for the SOAP 1.1 infoset model.
 SOAPFactory getSOAP12Factory()
          Get the OM factory instance for the SOAP 1.2 infoset model.
 

Method Detail

getOMFactory

OMFactory getOMFactory()
Get the OM factory instance for the XML infoset model.

Returns:
the OM factory instance

getSOAP11Factory

SOAPFactory getSOAP11Factory()
Get the OM factory instance for the SOAP 1.1 infoset model.

Returns:
the OM factory instance

getSOAP12Factory

SOAPFactory getSOAP12Factory()
Get the OM factory instance for the SOAP 1.2 infoset model.

Returns:
the OM factory instance

createStAXOMBuilder

OMXMLParserWrapper createStAXOMBuilder(OMFactory omFactory,
                                       XMLStreamReader parser)
Create an object model builder for plain XML that pulls events from a StAX stream reader.

The implementation must perform namespace repairing, i.e. it must add appropriate namespace declarations if undeclared namespaces appear in the StAX stream.

Parameters:
omFactory - The object model factory to use. This factory must be obtained from the same OMMetaFactory instance as the one used to invoke this method. In general the factory will be retrieved from getOMFactory()), but in some cases it may be necessary to pass a SOAPFactory instance, although this method will never produce a SOAP infoset.
parser - the stream reader to read the XML data from
Returns:
the builder

createOMBuilder

OMXMLParserWrapper createOMBuilder(OMFactory omFactory,
                                   StAXParserConfiguration configuration,
                                   InputSource is)
Create an object model builder for plain XML that reads a document from the provided input source.

Parameters:
omFactory - The object model factory to use. This factory must be obtained from the same OMMetaFactory instance as the one used to invoke this method. In general the factory will be retrieved from getOMFactory()), but in some cases it may be necessary to pass a SOAPFactory instance, although this method will never produce a SOAP infoset.
configuration - the parser configuration to use
is - the source of the XML document
Returns:
the builder

createOMBuilder

OMXMLParserWrapper createOMBuilder(OMFactory omFactory,
                                   Source source)
Create an object model builder for plain XML that gets its input from a Source.

Parameters:
omFactory - The object model factory to use. This factory must be obtained from the same OMMetaFactory instance as the one used to invoke this method. In general the factory will be retrieved from getOMFactory()), but in some cases it may be necessary to pass a SOAPFactory instance, although this method will never produce a SOAP infoset.
source - the source of the XML document
Returns:
the builder

createOMBuilder

OMXMLParserWrapper createOMBuilder(OMFactory omFactory,
                                   Node node,
                                   boolean expandEntityReferences)
Create an object model builder for plain XML that gets its input from a DOM tree.

Parameters:
omFactory - The object model factory to use. This factory must be obtained from the same OMMetaFactory instance as the one used to invoke this method. In general the factory will be retrieved from getOMFactory()), but in some cases it may be necessary to pass a SOAPFactory instance, although this method will never produce a SOAP infoset.
node - the DOM node; must be a Node.DOCUMENT_NODE or Node.ELEMENT_NODE
expandEntityReferences - Determines how EntityReference nodes are handled:
Returns:
the builder

createOMBuilder

OMXMLParserWrapper createOMBuilder(OMFactory omFactory,
                                   SAXSource source,
                                   boolean expandEntityReferences)
Create an object model builder for plain XML that gets its input from a SAXSource.

Parameters:
omFactory - The object model factory to use. This factory must be obtained from the same OMMetaFactory instance as the one used to invoke this method. In general the factory will be retrieved from getOMFactory()), but in some cases it may be necessary to pass a SOAPFactory instance, although this method will never produce a SOAP infoset.
expandEntityReferences - Determines how entity references (i.e. LexicalHandler.startEntity(String) and LexicalHandler.endEntity(String) events) are handled:
source - the source of the XML document
Returns:
the builder

createOMBuilder

OMXMLParserWrapper createOMBuilder(StAXParserConfiguration configuration,
                                   OMFactory omFactory,
                                   InputSource rootPart,
                                   MimePartProvider mimePartProvider)
Create an XOP aware object model builder.

Parameters:
configuration - the parser configuration to use
omFactory - The object model factory to use. This factory must be obtained from the same OMMetaFactory instance as the one used to invoke this method.
rootPart - the source of the root part of the XOP message
mimePartProvider - the provider from which MIME parts referenced in the root part will be retrieved
Returns:
the builder

createStAXSOAPModelBuilder

SOAPModelBuilder createStAXSOAPModelBuilder(XMLStreamReader parser)
Create an object model builder for SOAP that pulls events from a StAX stream reader. The implementation will select the appropriate SOAPFactory based on the namespace URI of the SOAP envelope.

Parameters:
parser - the stream reader to read the SOAP message from
Returns:
the builder

createSOAPModelBuilder

SOAPModelBuilder createSOAPModelBuilder(StAXParserConfiguration configuration,
                                        InputSource is)
Create an object model builder for SOAP that reads a message from the provided input source. The implementation will select the appropriate SOAPFactory based on the namespace URI of the SOAP envelope.

Parameters:
configuration - the parser configuration to use; for security reasons, this should in general be StAXParserConfiguration.SOAP
is - the source of the SOAP message
Returns:
the builder

createSOAPModelBuilder

SOAPModelBuilder createSOAPModelBuilder(StAXParserConfiguration configuration,
                                        SOAPFactory soapFactory,
                                        InputSource rootPart,
                                        MimePartProvider mimePartProvider)
Create an MTOM aware object model builder.

Parameters:
configuration - the parser configuration to use; for security reasons, this should in general be StAXParserConfiguration.SOAP
soapFactory - the SOAPFactory to use, or null if the implementation should select the appropriate SOAPFactory based on the namespace URI of the SOAP envelope.
rootPart - the source of the root part of the MTOM message
mimePartProvider - the provider from which MIME parts referenced in the root part will be retrieved
Returns:
the builder


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.