Package org.apache.axiom.om
Interface OMFactory
-
- All Known Subinterfaces:
SOAPFactory
public interface OMFactoryClass OMFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OMAttributecreateOMAttribute(String localName, OMNamespace ns, String value)OMCommentcreateOMComment(OMContainer parent, String content)Creates a comment.OMDocTypecreateOMDocType(OMContainer parent, String content)Creates DocType/DTD.OMDocumentcreateOMDocument()Creates a new OMDocument.OMDocumentcreateOMDocument(OMXMLParserWrapper builder)OMElementcreateOMElement(String localName, String namespaceURI, String namespacePrefix)Create an element with the given name.OMElementcreateOMElement(String localName, OMNamespace ns)Create an element with the given name.OMElementcreateOMElement(String localName, OMNamespace ns, OMContainer parent)OMElementcreateOMElement(String localName, OMNamespace ns, OMContainer parent, OMXMLParserWrapper builder)OMElementcreateOMElement(QName qname)Create an element with the givenQName.OMElementcreateOMElement(QName qname, OMContainer parent)Create an OMElement with the given QName under the given parent.OMSourcedElementcreateOMElement(OMDataSource source, String localName, OMNamespace ns)Construct element with arbitrary data source.OMSourcedElementcreateOMElement(OMDataSource source, QName qname)Construct element with arbitrary data source.OMNamespacecreateOMNamespace(String uri, String prefix)Create anOMNamespaceinstance or retrieve an existing one if the factory supports pooling.OMProcessingInstructioncreateOMProcessingInstruction(OMContainer parent, String piTarget, String piData)Creates a PI.OMTextcreateOMText(Object dataHandler, boolean optimize)OMTextcreateOMText(String s)OMTextcreateOMText(String s, int type)OMTextcreateOMText(String s, String mimeType, boolean optimize)OMTextcreateOMText(String contentID, DataHandlerProvider dataHandlerProvider, boolean optimize)Create a binaryOMTextnode supporting deferred loading of the content.OMTextcreateOMText(String contentID, OMContainer parent, OMXMLParserWrapper builder)OMTextcreateOMText(OMContainer parent, char[] charArary, int type)OMTextcreateOMText(OMContainer parent, String text)Creates a newOMTextnode with the given value and appends it to the given parent element.OMTextcreateOMText(OMContainer parent, String text, int type)OMTextcreateOMText(OMContainer parent, String s, String mimeType, boolean optimize)OMTextcreateOMText(OMContainer parent, QName text)OMTextcreateOMText(OMContainer parent, QName text, int type)OMTextcreateOMText(OMContainer parent, OMText source)Create OMText node that is a copy of the source text nodeOMMetaFactorygetMetaFactory()Get theOMMetaFactoryfrom which this factory was obtained.
-
-
-
Method Detail
-
getMetaFactory
OMMetaFactory getMetaFactory()
Get theOMMetaFactoryfrom which this factory was obtained.- Returns:
- the meta factory
-
createOMDocument
OMDocument createOMDocument()
Creates a new OMDocument.
-
createOMDocument
OMDocument createOMDocument(OMXMLParserWrapper builder)
-
createOMElement
OMElement createOMElement(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 benullns- the namespace, ornullif the element has no namespace- Returns:
- the newly created element
-
createOMElement
OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent) throws OMException
- Parameters:
localName-ns-parent- the parent to which the newly created element will be added; this may benull, in which case the behavior of the method is the same ascreateOMElement(String, OMNamespace)- Returns:
- the newly created element
- Throws:
OMException
-
createOMElement
OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent, OMXMLParserWrapper builder)
- Parameters:
localName-ns- - this can be nullparent-builder-
-
createOMElement
OMSourcedElement createOMElement(OMDataSource source, 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, 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 sourceqname- the name of the element produced by the data source
-
createOMElement
OMElement createOMElement(String localName, String namespaceURI, String namespacePrefix)
Create an element with the given name.- Parameters:
localName- the local part of the name; must not benullnamespaceURI- the namespace URI, or the empty string if the element has no namespace; must not benullnamespacePrefix-- Returns:
- the newly created OMElement.
- Throws:
IllegalArgumentException- ifnamespaceURIisnull
-
createOMElement
OMElement createOMElement(QName qname, OMContainer parent) throws OMException
Create an OMElement with the given QName under the given parent. 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 use whatever's already mapped in the parent, or create a generated one.- Parameters:
qname- the QName of the element to createparent- the parent to which the newly created element will be added; this may benull, in which case the behavior of the method is the same ascreateOMElement(QName)- Returns:
- Returns the new OMElement
- Throws:
OMException- if there's a namespace mapping problem
-
createOMElement
OMElement createOMElement(QName qname) throws OMException
Create an element with the givenQName. 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 theQNameto the given namespace URI. If neither a namespace URI nor a prefix is given, no namespace declaration will be added.- Parameters:
qname- theQNamedefining the name of the element to be created- Returns:
- the new element
- Throws:
OMException- TODO: when???
-
createOMNamespace
OMNamespace createOMNamespace(String uri, String prefix)
Create anOMNamespaceinstance or retrieve an existing one if the factory supports pooling.- Parameters:
uri- the namespace URI; must not benullprefix- the prefix- Returns:
- the
OMNamespaceinstance - Throws:
IllegalArgumentException- ifuriis null
-
createOMText
OMText createOMText(OMContainer parent, String text)
Creates a newOMTextnode with the given value and appends it to the given parent element.- Parameters:
parent-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, QName text)
- Parameters:
parent-text- - This text itself can contain a namespace inside it.
-
createOMText
OMText createOMText(OMContainer parent, 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, QName text, int type)
- Parameters:
parent-text- - This text itself can contain a namespace inside it.type-
-
createOMText
OMText createOMText(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(OMContainer parent, String s, String mimeType, boolean optimize)
-
createOMText
OMText createOMText(String contentID, DataHandlerProvider dataHandlerProvider, boolean optimize)
Create a binaryOMTextnode supporting deferred loading of the content.- Parameters:
contentID- the content ID identifying the binary content; may benulldataHandlerProvider- used to load theDataHandlerwhen requested from the returnedOMTextnodeoptimize- determines whether the binary content should be optimized- Returns:
- TODO
-
createOMText
OMText createOMText(String contentID, OMContainer parent, OMXMLParserWrapper builder)
-
createOMAttribute
OMAttribute createOMAttribute(String localName, OMNamespace ns, String value)
-
createOMDocType
OMDocType createOMDocType(OMContainer parent, String content)
Creates DocType/DTD.- Parameters:
parent-content-- Returns:
- Returns doctype.
-
createOMProcessingInstruction
OMProcessingInstruction createOMProcessingInstruction(OMContainer parent, String piTarget, String piData)
Creates a PI.- Parameters:
parent-piTarget-piData-- Returns:
- Returns OMProcessingInstruction.
-
createOMComment
OMComment createOMComment(OMContainer parent, String content)
Creates a comment.- Parameters:
parent-content-- Returns:
- Returns OMComment.
-
-