org.apache.axiom.om.impl.dom.factory
Class OMDOMFactory

java.lang.Object
  extended by org.apache.axiom.om.impl.dom.factory.OMDOMFactory
All Implemented Interfaces:
OMFactory
Direct Known Subclasses:
DOMSOAPFactory

public class OMDOMFactory
extends java.lang.Object
implements OMFactory

OM factory implementation for DOOM. It creates nodes that implement DOM as defined by the interfaces in org.w3c.dom.

Since DOM requires every node to have an owner document even if it has not yet been added to a tree, this factory internally maintains a reference to a DocumentImpl instance. The document can be set explicitly using the OMDOMFactory(DocumentImpl) constructor or the setDocument(DocumentImpl) method. If none is set, it will be implicitly created when the first node is created. All nodes created by this factory will have this DocumentImpl instance as owner document.

This has several important consequences:


Field Summary
protected  DocumentImpl document
           
 
Constructor Summary
OMDOMFactory()
           
OMDOMFactory(DocumentImpl doc)
           
 
Method Summary
 OMAttribute createOMAttribute(java.lang.String localName, OMNamespace ns, java.lang.String value)
           
 OMComment createOMComment(OMContainer parent, java.lang.String content)
           
 OMDocType createOMDocType(OMContainer parent, java.lang.String content)
           
 OMDocument createOMDocument()
           
 OMDocument createOMDocument(OMXMLParserWrapper builder)
           
 OMSourcedElement createOMElement(OMDataSource source, javax.xml.namespace.QName qname)
          Unsupported.
 OMSourcedElement createOMElement(OMDataSource source, java.lang.String localName, OMNamespace ns)
           
 OMElement createOMElement(OMDataSource source, java.lang.String localName, OMNamespace ns, OMContainer parent)
           
 OMElement createOMElement(javax.xml.namespace.QName qname)
          Create an OMElement with the given QName

If the QName contains a prefix, we will ensure that an OMNamespace is created mapping the given namespace to the given prefix.

 OMElement createOMElement(javax.xml.namespace.QName qname, OMContainer parent)
          Creates a new OMDOM Element node and adds it to the given parent.
 OMElement createOMElement(java.lang.String localName, OMNamespace ns)
           
 OMElement createOMElement(java.lang.String localName, OMNamespace ns, OMContainer parent)
           
 OMElement createOMElement(java.lang.String localName, OMNamespace ns, OMContainer parent, OMXMLParserWrapper builder)
          Creates an OMElement with the builder.
 OMElement createOMElement(java.lang.String localName, java.lang.String namespaceURI, java.lang.String namespacePrefix)
          Creates an OMElement.
 OMNamespace createOMNamespace(java.lang.String uri, java.lang.String prefix)
          Creates a new OMNamespace.
 OMProcessingInstruction createOMProcessingInstruction(OMContainer parent, java.lang.String piTarget, java.lang.String piData)
           
 OMText createOMText(java.lang.Object dataHandler, boolean optimize)
          Creates a new OMDOM Text node with the given datahandler and the given MTOM optimization configuration and returns it.
 OMText createOMText(OMContainer parent, char[] charArary, int type)
           
 OMText createOMText(OMContainer parent, OMText source)
           
 OMText createOMText(OMContainer parent, javax.xml.namespace.QName text)
           
 OMText createOMText(OMContainer parent, javax.xml.namespace.QName text, int type)
           
 OMText createOMText(OMContainer parent, java.lang.String text)
           
 OMText createOMText(OMContainer parent, java.lang.String text, int type)
           
 OMText createOMText(OMContainer parent, java.lang.String s, java.lang.String mimeType, boolean optimize)
          Creates an OMDOM Text node, adds it to the give parent element and returns it.
 OMText createOMText(java.lang.String s)
          Creates a OMDOM Text node carrying the given value.
 OMText createOMText(java.lang.String contentID, DataHandlerProvider dataHandlerProvider, boolean optimize)
           
 OMText createOMText(java.lang.String text, int type)
          Creates a Character node of the given type.
 OMText createOMText(java.lang.String contentID, OMContainer parent, OMXMLParserWrapper builder)
           
 OMText createOMText(java.lang.String text, java.lang.String mimeType, boolean optimize)
          Creates a new OMDOM Text node with the value of the given text value along with the MTOM optimization parameters and returns it.
 DocumentImpl getDocument()
           
 void setDocument(DocumentImpl document)
          Configure this factory to use the given document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

protected DocumentImpl document
Constructor Detail

OMDOMFactory

public OMDOMFactory()

OMDOMFactory

public OMDOMFactory(DocumentImpl doc)
Method Detail

createOMDocument

public OMDocument createOMDocument()
Specified by:
createOMDocument in interface OMFactory

setDocument

public void setDocument(DocumentImpl document)
Configure this factory to use the given document. Use with care.

Parameters:
document -

createOMElement

public OMElement createOMElement(java.lang.String localName,
                                 OMNamespace ns)
Specified by:
createOMElement in interface OMFactory

createOMElement

public OMElement createOMElement(java.lang.String localName,
                                 OMNamespace ns,
                                 OMContainer parent)
                          throws OMDOMException
Specified by:
createOMElement in interface OMFactory
Throws:
OMDOMException

createOMElement

public OMElement createOMElement(java.lang.String localName,
                                 OMNamespace ns,
                                 OMContainer parent,
                                 OMXMLParserWrapper builder)
Creates an OMElement with the builder.

Specified by:
createOMElement in interface OMFactory

createOMElement

public OMElement createOMElement(OMDataSource source,
                                 java.lang.String localName,
                                 OMNamespace ns,
                                 OMContainer parent)

createOMElement

public OMSourcedElement createOMElement(OMDataSource source,
                                        java.lang.String localName,
                                        OMNamespace ns)
Specified by:
createOMElement in interface OMFactory

createOMElement

public OMSourcedElement createOMElement(OMDataSource source,
                                        javax.xml.namespace.QName qname)
Unsupported.

Specified by:
createOMElement in interface OMFactory

createOMElement

public OMElement createOMElement(java.lang.String localName,
                                 java.lang.String namespaceURI,
                                 java.lang.String namespacePrefix)
Creates an OMElement.

Specified by:
createOMElement in interface OMFactory
See Also:
OMFactory.createOMElement(String, String, String)

createOMElement

public OMElement createOMElement(javax.xml.namespace.QName qname,
                                 OMContainer parent)
                          throws OMException
Creates a new OMDOM Element node and adds it to the given parent.

Specified by:
createOMElement in interface OMFactory
Throws:
OMException
See Also:
createOMElement(String, OMNamespace, OMContainer), OMFactory.createOMElement( javax.xml.namespace.QName, org.apache.axiom.om.OMContainer)

createOMElement

public OMElement createOMElement(javax.xml.namespace.QName qname)
                          throws OMException
Create an OMElement with the given QName

If the QName contains a prefix, we will ensure that an OMNamespace is created mapping the given namespace to the given prefix. If no prefix is passed, we'll create a generated one.

Specified by:
createOMElement in interface OMFactory
Parameters:
qname -
Returns:
the new OMElement.
Throws:
OMException

createOMNamespace

public OMNamespace createOMNamespace(java.lang.String uri,
                                     java.lang.String prefix)
Creates a new OMNamespace.

Specified by:
createOMNamespace in interface OMFactory
See Also:
OMFactory.createOMNamespace(String, String)

createOMText

public OMText createOMText(OMContainer parent,
                           java.lang.String text)
Specified by:
createOMText in interface OMFactory

createOMText

public OMText createOMText(OMContainer parent,
                           javax.xml.namespace.QName text)
Specified by:
createOMText in interface OMFactory

createOMText

public OMText createOMText(OMContainer parent,
                           javax.xml.namespace.QName text,
                           int type)
Specified by:
createOMText in interface OMFactory

createOMText

public OMText createOMText(OMContainer parent,
                           java.lang.String text,
                           int type)
Specified by:
createOMText in interface OMFactory

createOMText

public OMText createOMText(OMContainer parent,
                           OMText source)
Specified by:
createOMText in interface OMFactory

createOMText

public OMText createOMText(OMContainer parent,
                           char[] charArary,
                           int type)
Specified by:
createOMText in interface OMFactory

createOMText

public OMText createOMText(java.lang.String s)
Creates a OMDOM Text node carrying the given value.

Specified by:
createOMText in interface OMFactory
See Also:
OMFactory.createOMText(String)

createOMText

public OMText createOMText(java.lang.String text,
                           int type)
Creates a Character node of the given type.

Specified by:
createOMText in interface OMFactory
See Also:
OMFactory.createOMText(String, int)

createOMText

public OMText createOMText(java.lang.String text,
                           java.lang.String mimeType,
                           boolean optimize)
Creates a new OMDOM Text node with the value of the given text value along with the MTOM optimization parameters and returns it.

Specified by:
createOMText in interface OMFactory
See Also:
OMFactory.createOMText(String, String, boolean)

createOMText

public OMText createOMText(java.lang.Object dataHandler,
                           boolean optimize)
Creates a new OMDOM Text node with the given datahandler and the given MTOM optimization configuration and returns it.

Specified by:
createOMText in interface OMFactory
See Also:
OMFactory.createOMText(Object, boolean)

createOMText

public OMText createOMText(java.lang.String contentID,
                           DataHandlerProvider dataHandlerProvider,
                           boolean optimize)
Specified by:
createOMText in interface OMFactory

createOMText

public OMText createOMText(OMContainer parent,
                           java.lang.String s,
                           java.lang.String mimeType,
                           boolean optimize)
Creates an OMDOM Text node, adds it to the give parent element and returns it.

Specified by:
createOMText in interface OMFactory
See Also:
OMFactory.createOMText(OMContainer, String, String, boolean)

createOMText

public OMText createOMText(java.lang.String contentID,
                           OMContainer parent,
                           OMXMLParserWrapper builder)
Specified by:
createOMText in interface OMFactory

createOMAttribute

public OMAttribute createOMAttribute(java.lang.String localName,
                                     OMNamespace ns,
                                     java.lang.String value)
Specified by:
createOMAttribute in interface OMFactory

createOMDocType

public OMDocType createOMDocType(OMContainer parent,
                                 java.lang.String content)
Specified by:
createOMDocType in interface OMFactory

createOMProcessingInstruction

public OMProcessingInstruction createOMProcessingInstruction(OMContainer parent,
                                                             java.lang.String piTarget,
                                                             java.lang.String piData)
Specified by:
createOMProcessingInstruction in interface OMFactory

createOMComment

public OMComment createOMComment(OMContainer parent,
                                 java.lang.String content)
Specified by:
createOMComment in interface OMFactory

getDocument

public DocumentImpl getDocument()

createOMDocument

public OMDocument createOMDocument(OMXMLParserWrapper builder)
Specified by:
createOMDocument in interface OMFactory


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