Contents | Package | Class | Tree | Deprecated | Index | Help XML for Java 1.0.4
PREV | NEXT SHOW LISTS | HIDE LISTS

Class com.ibm.xml.parser.GeneralReference

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

public class GeneralReference
extends Parent
GeneralReference implements general references as defined by the Document Object Model (DOM).

There are two flavors of general references:

  1. Parsed entities: Parsed entities are declared in the internal or external DTD subsets, and are referenced one or more places in the document.
  2. Unparsed entities: Unparsed entities are used for embedding data that is not in XML format into the document. An example of an unparsed entitiy is an image.

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

The object tree produced by the XML4J parser does NOT include General Reference Nodes because general references are expanded. If an application is sensitive to the existence of parsed entities, it should implement the ReferenceHandler interface.

Version:
Revision: 05 1.6 src/com/ibm/xml/parser/GeneralReference.java, xml4jsrc, xml4j-jtcsv, xml4j_1_0_4
See Also:
Parent, Child, ReferenceHandler

Fields inherited from class com.ibm.xml.parser.Child
 ATTDEF, ATTLIST, DOCUMENTTYPE, ELEMENTDEFINITION, ENTITY, GENERALREFERENCE, NOTATION, 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.
java.lang.Object  clone()
Clone this General Reference Node and its children using the appropriate factories.
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.
int  getNodeType()
Returns that this object is a General Reference Node.
java.lang.String  getText()
Return all text associated with this Node and its children without considering entities.
 
Methods inherited from class com.ibm.xml.parser.Parent
 addElement, elements, getChildNodes, getChildrenArray, getFirstChild, hasChildNodes, insert, insertAfter, insertBefore, insertFirst, insertLast, removeChild, replaceChild
 
Methods inherited from class com.ibm.xml.parser.Child
 clearDigest, clone, getChildNodes, getDigest, getFactory, getFirstChild, getNextSibling, getParentNode, getPreviousSibling, getText, hasChildNodes, insertBefore, makeXPointer, print, print, removeChild, replaceChild, searchAncestors, searchAncestors, setFactory, toXMLString, toXMLString
 
Methods inherited from class java.lang.Object
 clone, 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:
clone

getNodeType

public int getNodeType()
Returns that this object is a General Reference Node.

This method is defined by DOM.

Returns:
General Reference Node indicator.

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).

getText

public java.lang.String getText()
Return all text associated with this Node and its children without considering entities.

This method is defined by Child.

Returns:
Text associated with all children, or "" if no children.
Overrides:
getText in class Child
See Also:
toXMLString

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

Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS