org.apache.axiom.om
Interface OMFactory

All Known Subinterfaces:
SOAPFactory

public interface OMFactory

Class OMFactory


Method Summary
 OMAttribute createOMAttribute(java.lang.String localName, OMNamespace ns, java.lang.String value)
          Create an attribute with the given name and value.
 OMComment createOMComment(OMContainer parent, java.lang.String content)
          Creates a comment.
 OMDocType createOMDocType(OMContainer parent, java.lang.String content)
          Creates DocType/DTD.
 OMDocument createOMDocument()
          Creates a new OMDocument.
 OMDocument createOMDocument(OMXMLParserWrapper builder)
           
 OMSourcedElement createOMElement(OMDataSource source, javax.xml.namespace.QName qname)
          Construct element with arbitrary data source.
 OMSourcedElement createOMElement(OMDataSource source, java.lang.String localName, OMNamespace ns)
          Construct element with arbitrary data source.
 OMElement createOMElement(javax.xml.namespace.QName qname)
          Create an element with the given QName.
 OMElement createOMElement(javax.xml.namespace.QName qname, OMContainer parent)
          Create an element with the given QName and parent.
 OMElement createOMElement(java.lang.String localName, OMNamespace ns)
          Create an element with the given name.
 OMElement createOMElement(java.lang.String localName, OMNamespace ns, OMContainer parent)
          Create an element with the given name and parent.
 OMElement createOMElement(java.lang.String localName, OMNamespace ns, OMContainer parent, OMXMLParserWrapper builder)
           
 OMElement createOMElement(java.lang.String localName, java.lang.String namespaceURI, java.lang.String prefix)
          Create an element with the given name.
 OMNamespace createOMNamespace(java.lang.String uri, java.lang.String prefix)
          Create an OMNamespace instance or retrieve an existing one if the factory supports pooling.
 OMProcessingInstruction createOMProcessingInstruction(OMContainer parent, java.lang.String piTarget, java.lang.String piData)
          Creates a PI.
 OMText createOMText(java.lang.Object dataHandler, boolean optimize)
           
 OMText createOMText(OMContainer parent, char[] charArary, int type)
           
 OMText createOMText(OMContainer parent, OMText source)
          Create OMText node that is a copy of the source text node
 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)
          Creates a new OMText node with the given value and appends it to the given parent element.
 OMText createOMText(OMContainer parent, java.lang.String text, int type)
           
 OMText createOMText(OMContainer parent, java.lang.String s, java.lang.String mimeType, boolean optimize)
           
 OMText createOMText(java.lang.String s)
           
 OMText createOMText(java.lang.String contentID, DataHandlerProvider dataHandlerProvider, boolean optimize)
          Create a binary OMText node supporting deferred loading of the content.
 OMText createOMText(java.lang.String s, int type)
           
 OMText createOMText(java.lang.String contentID, OMContainer parent, OMXMLParserWrapper builder)
           
 OMText createOMText(java.lang.String s, java.lang.String mimeType, boolean optimize)
           
 OMMetaFactory getMetaFactory()
          Get the OMMetaFactory from which this factory was obtained.
 

Method Detail

getMetaFactory

OMMetaFactory getMetaFactory()
Get the OMMetaFactory from which this factory was obtained. More precisely, if the OMFactory instance has been obtained from a OMMetaFactory using OMMetaFactory.getOMFactory(), OMMetaFactory.getSOAP11Factory() or OMMetaFactory.getSOAP12Factory(), then the return value is the same as the original OMMetaFactory. Since OMAbstractFactory creates a single OMMetaFactory instance per Axiom implementation, this means that this method can be used to check if two OMFactory instances belong to the same Axiom implementation.

Returns:
the meta factory

createOMDocument

OMDocument createOMDocument()
Creates a new OMDocument.


createOMDocument

OMDocument createOMDocument(OMXMLParserWrapper builder)

createOMElement

OMElement createOMElement(java.lang.String localName,
                          OMNamespace ns)
Create an element with the given name. If a namespace is given, a namespace declaration will be added automatically to the newly created element.

Parameters:
localName - the local part of the name; must not be null
ns - the namespace, or null if the element has no namespace
Returns:
the newly created element
Throws:
java.lang.IllegalArgumentException - if an attempt is made to create a prefixed element with an empty namespace name

createOMElement

OMElement createOMElement(java.lang.String localName,
                          OMNamespace ns,
                          OMContainer parent)
                          throws OMException
Create an element with the given name and parent. If the specified OMNamespace has a namespace URI but a null prefix, the method will reuse an existing prefix if a namespace declaration with a matching namespace URI is in scope on the parent or generate a new prefix if no such namespace declaration exists.

If a new prefix is generated or if the specified prefix and namespace URI are not bound in the scope of the parent element, the method will add an appropriate namespace declaration to the new element. Note that this may also occur if null is passed as OMNamespace parameter. In that case, if there is a default namespace declaration with a non empty namespace URI in the scope of the parent element, a namespace declaration needs to be added to the newly created element to override the default namespace.

Parameters:
localName -
ns -
parent - the parent to which the newly created element will be added; this may be null, in which case the behavior of the method is the same as createOMElement(String, OMNamespace)
Returns:
the newly created element
Throws:
OMException
java.lang.IllegalArgumentException - if an attempt is made to create a prefixed element with an empty namespace name

createOMElement

OMElement createOMElement(java.lang.String localName,
                          OMNamespace ns,
                          OMContainer parent,
                          OMXMLParserWrapper builder)
Parameters:
localName -
ns - - this can be null
parent -
builder -

createOMElement

OMSourcedElement createOMElement(OMDataSource source,
                                 java.lang.String localName,
                                 OMNamespace ns)
Construct element with arbitrary data source. This is an optional operation which may not be supported by all factories.

Parameters:
source -
localName -
ns -

createOMElement

OMSourcedElement createOMElement(OMDataSource source,
                                 javax.xml.namespace.QName qname)
Construct element with arbitrary data source. This is an optional operation which may not be supported by all factories.

Parameters:
source - the data source
qname - the name of the element produced by the data source

createOMElement

OMElement createOMElement(java.lang.String localName,
                          java.lang.String namespaceURI,
                          java.lang.String prefix)
Create an element with the given name. If a namespace is given, a namespace declaration will be added automatically to the newly created element.

Parameters:
localName - the local part of the name; must not be null
namespaceURI - the namespace URI, or the empty string if the element has no namespace; must not be null
prefix - the namespace prefix, or null if a prefix should be generated
Returns:
the newly created OMElement.
Throws:
java.lang.IllegalArgumentException - if namespaceURI is null or if an attempt is made to create a prefixed element with an empty namespace name

createOMElement

OMElement createOMElement(javax.xml.namespace.QName qname,
                          OMContainer parent)
Create an element with the given QName and parent. If a namespace URI is given but no prefix, the method will use an appropriate prefix if a corresponding namespace declaration is in scope on the parent or generate a new prefix if no corresponding namespace declaration is in scope. If a new prefix is generated or if the specified prefix and namespace URI are not bound in the scope of the parent element, the method will add an appropriate namespace declaration to the new element.

Parameters:
qname - the QName defining the name of the element to be created
parent - the parent to which the newly created element will be added; this may be null, in which case the behavior of the method is the same as createOMElement(QName)
Returns:
the new element
Throws:
java.lang.IllegalArgumentException - if an attempt is made to create a prefixed element with an empty namespace name

createOMElement

OMElement createOMElement(javax.xml.namespace.QName qname)
Create an element with the given QName. If a namespace URI is given but no prefix, the method will automatically generate a prefix for the element. If a namespace URI is given, the method will also add a namespace declaration to the element, binding the auto-generated prefix or the prefix given in the QName to the given namespace URI. If neither a namespace URI nor a prefix is given, no namespace declaration will be added.

Parameters:
qname - the QName defining the name of the element to be created
Returns:
the new element
Throws:
java.lang.IllegalArgumentException - if an attempt is made to create a prefixed element with an empty namespace name

createOMNamespace

OMNamespace createOMNamespace(java.lang.String uri,
                              java.lang.String prefix)
Create an OMNamespace instance or retrieve an existing one if the factory supports pooling.

Parameters:
uri - the namespace URI; must not be null
prefix - the prefix
Returns:
the OMNamespace instance
Throws:
java.lang.IllegalArgumentException - if uri is null

createOMText

OMText createOMText(OMContainer parent,
                    java.lang.String text)
Creates a new OMText node with the given value and appends it to the given parent element.

Parameters:
parent - the parent to which the newly created text node will be added; this may be null, in which case the behavior of the method is the same as createOMText(String)
text -
Returns:
Returns OMText.

createOMText

OMText createOMText(OMContainer parent,
                    OMText source)
Create OMText node that is a copy of the source text node

Parameters:
parent -
source -
Returns:
TODO

createOMText

OMText createOMText(OMContainer parent,
                    javax.xml.namespace.QName text)
Parameters:
parent -
text - - This text itself can contain a namespace inside it.

createOMText

OMText createOMText(OMContainer parent,
                    java.lang.String text,
                    int type)
Parameters:
parent -
text -
type - - this should be either of XMLStreamConstants.CHARACTERS, XMLStreamConstants.CDATA, XMLStreamConstants.SPACE, XMLStreamConstants.ENTITY_REFERENCE
Returns:
Returns OMText.

createOMText

OMText createOMText(OMContainer parent,
                    char[] charArary,
                    int type)

createOMText

OMText createOMText(OMContainer parent,
                    javax.xml.namespace.QName text,
                    int type)
Parameters:
parent -
text - - This text itself can contain a namespace inside it.
type -

createOMText

OMText createOMText(java.lang.String s)
Parameters:
s -
Returns:
Returns OMText.

createOMText

OMText createOMText(java.lang.String s,
                    int type)
Parameters:
s -
type - - OMText node can handle SPACE, CHARACTERS, CDATA and ENTITY REFERENCES. For Constants, use either XMLStreamConstants or constants found in OMNode.
Returns:
Returns OMText.

createOMText

OMText createOMText(java.lang.String s,
                    java.lang.String mimeType,
                    boolean optimize)

createOMText

OMText createOMText(java.lang.Object dataHandler,
                    boolean optimize)

createOMText

OMText createOMText(OMContainer parent,
                    java.lang.String s,
                    java.lang.String mimeType,
                    boolean optimize)

createOMText

OMText createOMText(java.lang.String contentID,
                    DataHandlerProvider dataHandlerProvider,
                    boolean optimize)
Create a binary OMText node supporting deferred loading of the content.

Parameters:
contentID - the content ID identifying the binary content; may be null
dataHandlerProvider - used to load the DataHandler when requested from the returned OMText node
optimize - determines whether the binary content should be optimized
Returns:
TODO

createOMText

OMText createOMText(java.lang.String contentID,
                    OMContainer parent,
                    OMXMLParserWrapper builder)

createOMAttribute

OMAttribute createOMAttribute(java.lang.String localName,
                              OMNamespace ns,
                              java.lang.String value)
Create an attribute with the given name and value. If the provided OMNamespace object has a null prefix, then a prefix will be generated, except if the namespace URI is the empty string, in which case the result is the same as if a null OMNamespace was given.

Parameters:
localName -
ns -
value -
Returns:
the newly created attribute
Throws:
java.lang.IllegalArgumentException - if an attempt is made to create a prefixed attribute with an empty namespace name

createOMDocType

OMDocType createOMDocType(OMContainer parent,
                          java.lang.String content)
Creates DocType/DTD.

Parameters:
parent -
content -
Returns:
Returns doctype.

createOMProcessingInstruction

OMProcessingInstruction createOMProcessingInstruction(OMContainer parent,
                                                      java.lang.String piTarget,
                                                      java.lang.String piData)
Creates a PI.

Parameters:
parent -
piTarget -
piData -
Returns:
Returns OMProcessingInstruction.

createOMComment

OMComment createOMComment(OMContainer parent,
                          java.lang.String content)
Creates a comment.

Parameters:
parent -
content -
Returns:
Returns OMComment.


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