XML for Java Compatibility API 2.0.11

com.ibm.xml.parser
Class GeneralReference

java.lang.Object
  |
  +--com.ibm.xml.parser.Child
        |
        +--com.ibm.xml.parser.Parent
              |
              +--com.ibm.xml.parser.GeneralReference
Direct Known Subclasses:
TreeFactory.TreeGeneralReference

public class GeneralReference
extends Parent
implements org.w3c.dom.EntityReference

GeneralReference implements EntityReference as defined by the Document Object Model (DOM). This class represents general entity references (&foo;) occured in character data or attribute values.

GeneralReferences do NOT include character references(e.g. "<" is referenced as "&#60;").

The object tree produced by the XML4J parser doesn't include GeneralReference Nodes if the parser is configured as setExpandEntityReferences(false);.

Version:
Revision: 71 1.5 src/com/ibm/xml/parser/GeneralReference.java, parser, xml4j2, xml4j2_0_11
See Also:
Parent, Child, Parser.setExpandEntityReferences(boolean), ReferenceHandler, Serialized Form

Fields inherited from class com.ibm.xml.parser.Child
ATTDEF, ATTLIST, ELEMENT_DECL, NAME_ATTDEF, NAME_ATTLIST, NAME_CDATA, NAME_COMMENT, NAME_DOCFRAGMENT, NAME_DOCUMENT, NAME_ELEMENT_DECL, NAME_PSEUDONODE, NAME_TEXT, PSEUDONODE
 
Constructor Summary
GeneralReference(java.lang.String name)
          Constructor.
 
Method Summary
 void acceptPost(Visitor visitor)
          Implements the accept operation of the visitor design pattern when the end of a General Reference Node is recognized when traversing the document object tree.
 void acceptPre(Visitor visitor)
          Implements the accept operation of the visitor design pattern when the start of a General Reference Node is recognized when traversing the document object tree.
protected  void checkChildType(org.w3c.dom.Node child)
          Check whether child is allowed to be insered in this node or not.
 java.lang.Object clone()
          Clone this General Reference Node and its children using the appropriate factories.
 org.w3c.dom.Node cloneNode(boolean deep)
          This method is defined by DOM.
 void collectNamespaceAttributes()
          Call collectNamespaceAttributes() for each TXElement child.
 void collectNamespaceAttributes(org.w3c.dom.Node parent)
          Call collectNamespaceAttributes() for each TXElement child.
 boolean equals(org.w3c.dom.Node arg, boolean deep)
          This method is defined by DOM.
 java.lang.String getLanguage()
          Returns the XML language ID (the value of the xml:lang Attribute) in use for this General Reference Node.
 java.lang.String getName()
          Returns this General Reference's name.
 java.lang.String getNodeName()
          This method is defined by DOM.
 short getNodeType()
          Returns that this object is a EntityReference Node.
 void removeOverlappedNamespaceAttributes()
          Call removeOverlappedNamespaceAttributes() for each TXElement child.
 
Methods inherited from class com.ibm.xml.parser.Parent
addElement, appendChild, elements, expandEntityReferences, getChildNodes, getChildrenArray, getFirstChild, getFirstWithoutReference, getLastChild, getLastWithoutReference, getText, hasChildNodes, insert, insertAfter, insertBefore, insertFirst, insertLast, processAfterRemove, realInsert, removeChild, replaceChild
 
Methods inherited from class com.ibm.xml.parser.Child
clearDigest, getAttributes, getDigest, getFactory, getNextSibling, getNextWithoutReference, getNodeValue, getOwnerDocument, getParentNode, getParentWithoutReference, getPreviousSibling, getPreviousWithoutReference, getUserData, makeXPointer, print, print, searchAncestors, searchAncestors, setFactory, setNodeValue, setUserData, toXMLString, toXMLString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneralReference

public GeneralReference(java.lang.String name)
Constructor.
Parameters:
name - This General Reference's name. This is also the name of the entity being referred to by the General Reference.
Method Detail

clone

public java.lang.Object clone()
Clone this General Reference Node and its children using the appropriate factories.

This method is defined by Child.

Returns:
Cloned General Reference Node.
Overrides:
clone in class Child
See Also:
Child.clone()

cloneNode

public org.w3c.dom.Node cloneNode(boolean deep)

This method is defined by DOM.

Overrides:
cloneNode in class Child

equals

public boolean equals(org.w3c.dom.Node arg,
                      boolean deep)

This method is defined by DOM.

Overrides:
equals in class Child

getNodeType

public short getNodeType()
Returns that this object is a EntityReference Node.

This method is defined by DOM.

Returns:
EntityReference Node indicator.

getNodeName

public java.lang.String getNodeName()

This method is defined by DOM.


getName

public java.lang.String getName()
Returns this General Reference's name.
Returns:
The string that is this General Reference's name (should never be null).

getLanguage

public java.lang.String getLanguage()
Returns the XML language ID (the value of the xml:lang Attribute) in use for this General Reference Node. If this General Reference Node has no explicitly defined language Attribute, Parent Nodes will be recursively checked.
Returns:
The XML language ID, or null if all Parents have no language ID.

acceptPre

public void acceptPre(Visitor visitor)
               throws java.lang.Exception
Implements the accept operation of the visitor design pattern when the start of a General Reference Node is recognized when traversing the document object tree.
Parameters:
visitor - The implemention of the Visitor operation (toXMLString, digest, ...)
Throws:
java.lang.Exception - Thrown if this Node can not be visitted, or traversal modification is requested.
See Also:
Visitor, TreeTraversal, NonRecursivePreorderTreeTraversal, TreeTraversalException

acceptPost

public void acceptPost(Visitor visitor)
                throws java.lang.Exception
Implements the accept operation of the visitor design pattern when the end of a General Reference Node is recognized when traversing the document object tree.
Parameters:
visitor - The implemention of the Visitor operation (toXMLString, digest, ...)
Throws:
java.lang.Exception - Thrown if this Node can not be visitted, or traversal modification is requested.
See Also:
Visitor, TreeTraversal, NonRecursivePreorderTreeTraversal, TreeTraversalException

checkChildType

protected void checkChildType(org.w3c.dom.Node child)
                       throws org.w3c.dom.DOMException
Check whether child is allowed to be insered in this node or not. When not allowed, a DOMException with HIERARCHY_REQUEST_ERR is thrown.
Overrides:
checkChildType in class Parent

collectNamespaceAttributes

public void collectNamespaceAttributes()
Call collectNamespaceAttributes() for each TXElement child.
See Also:
TXDocument.isProcessNamespace(), TXElement.collectNamespaceAttributes()

collectNamespaceAttributes

public void collectNamespaceAttributes(org.w3c.dom.Node parent)
Call collectNamespaceAttributes() for each TXElement child.
See Also:
TXDocument.isProcessNamespace(), TXElement.collectNamespaceAttributes()

removeOverlappedNamespaceAttributes

public void removeOverlappedNamespaceAttributes()
Call removeOverlappedNamespaceAttributes() for each TXElement child.
See Also:
TXDocument.isProcessNamespace(), TXElement.removeOverlappedNamespaceAttributes()

XML for Java Compatibility API 2.0.11