oracle.xml.parser.v2
Class NodeFactory

java.lang.Object
  |
  +--oracle.xml.parser.v2.NodeFactory

public class NodeFactory
extends java.lang.Object
implements java.io.Serializable

This class specifies methods to create various nodes of the DOM tree built during parsing. Applications can override these methods to create their own custom classes to be added to the DOM tree while parsing. Applications have to register their own NodeFactory using the XMLParser's setNodeFactory() method. If a null pointer is returned by these methods, then the node will not be added to the DOM tree.

See Also:
DOMParser.setNodeFactory(oracle.xml.parser.v2.NodeFactory), Serialized Form

Constructor Summary
NodeFactory()
           
 
Method Summary
TypeMethod
 XMLAttr createAttribute(java.lang.String tag, java.lang.String text)
          Creates an attribute node with the specified tag, and text.
 XMLAttr createAttribute(java.lang.String localName, java.lang.String prefix, java.lang.String namespaceURI, java.lang.String value)
           
 XMLCDATA createCDATASection(java.lang.String text)
          Creates a CDATA node with the specified text.
 XMLComment createComment(java.lang.String text)
          Creates a comment node with the specified text.
 XMLDocument createDocument()
          Creates a document node.
 XMLDocumentFragment createDocumentFragment()
          Creates a document fragment node with the specified tag.
 XMLElement createElement(java.lang.String tag)
          Creates an Element node with the specified tag.
 XMLElement createElementNS(java.lang.String localName, java.lang.String prefix, java.lang.String namespaceURI)
          Creates an Element node with the specified local name,prefix , namespaceURI.
 XMLEntityReference createEntityReference(java.lang.String tag)
          Creates an entity reference node with the specified tag.
 XMLPI createProcessingInstruction(java.lang.String tag, java.lang.String text)
          Creates a PI node with the specified tag, and text.
 XMLText createTextNode(java.lang.String text)
          Creates a text node with the specified text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeFactory

public NodeFactory()
Method Detail

createElement

public XMLElement createElement(java.lang.String tag)
Creates an Element node with the specified tag.
Parameters:
tag - The name of the element.
Returns:
The created element.

createElementNS

public XMLElement createElementNS(java.lang.String localName,
                                  java.lang.String prefix,
                                  java.lang.String namespaceURI)
Creates an Element node with the specified local name,prefix , namespaceURI.
Parameters:
The - local name of the element, prefix of the element, namespaceURI of the element
Returns:
The created element.

createDocument

public XMLDocument createDocument()
Creates a document node. This method cannot return a null pointer.
Returns:
The created element.

createTextNode

public XMLText createTextNode(java.lang.String text)
Creates a text node with the specified text.
Parameters:
text - The text associated with the node.
Returns:
The created text node.

createCDATASection

public XMLCDATA createCDATASection(java.lang.String text)
Creates a CDATA node with the specified text.
Parameters:
text - The text associated with the node.
Returns:
The created CDATA node.

createComment

public XMLComment createComment(java.lang.String text)
Creates a comment node with the specified text.
Parameters:
text - The text associated with the node.
Returns:
The created comment node.

createProcessingInstruction

public XMLPI createProcessingInstruction(java.lang.String tag,
                                         java.lang.String text)
Creates a PI node with the specified tag, and text.
Parameters:
tag - The name of the node.
text - The text associated with the node.
Returns:
The created PI node.

createAttribute

public XMLAttr createAttribute(java.lang.String tag,
                               java.lang.String text)
Creates an attribute node with the specified tag, and text.
Parameters:
tag - The name of the node.
text - The text associated with the node.
Returns:
The created attribute node.

createAttribute

public XMLAttr createAttribute(java.lang.String localName,
                               java.lang.String prefix,
                               java.lang.String namespaceURI,
                               java.lang.String value)

createDocumentFragment

public XMLDocumentFragment createDocumentFragment()
Creates a document fragment node with the specified tag.
Parameters:
tag - The name of the node.
Returns:
The created document fragment node.

createEntityReference

public XMLEntityReference createEntityReference(java.lang.String tag)
Creates an entity reference node with the specified tag.
Parameters:
tag - The name of the node.
Returns:
The created entity reference node.