BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.apache.xalan.stree
Class Parent

java.lang.Object
  |
  +--weblogic.apache.xml.utils.UnImplNode
        |
        +--weblogic.apache.xalan.stree.Child
              |
              +--weblogic.apache.xalan.stree.Parent
Direct Known Subclasses:
DocImpl, ElementImpl

public class Parent
extends Child

Class representing a parent node. A parent is also a child unless it is the root node.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.


Field Summary
protected  int m_childCount
          Number of children of this node.
protected  int m_posInChildList
          The position of this node in its parent's children list
 
Fields inherited from class weblogic.apache.xalan.stree.Child
m_doc, m_parent
 
Constructor Summary
Parent(DocumentImpl doc)
          Constructor Parent
 
Method Summary
 org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
          Append a child to the child list.
 void dispatchCharactersEvent(org.xml.sax.ContentHandler ch)
          Handle a Characters event
 Child getChild(int i)
          Get the nth child.
 int getChildCount()
          Get the number of children this node currently contains.
 int getChildUID(int pos)
           Get the position of the child of an element in the document.
 org.w3c.dom.Node getFirstChild()
          The first child of this node.
 org.w3c.dom.Node getLastChild()
          The last child of this node.
 boolean hasChildNodes()
          This is a convenience method to allow easy determination of whether a node has any children.
 boolean isComplete()
          Return if this node has had all it's children added, i.e.
 void setComplete(boolean isComplete)
          Set that this node's child list is complete, i.e.
protected  void throwParseError(java.lang.Exception e)
          Throw a ParseError exception
 
Methods inherited from class weblogic.apache.xalan.stree.Child
getAttributes, getLevel, getLocalName, getNamespaceURI, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTagName, getTransformer, getUid, isNamespaceNode, isSupported, setAttribute, setDoc, setLevel, setParent, setUid, throwIfParseError
 
Methods inherited from class weblogic.apache.xml.utils.UnImplNode
appendData, cloneNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, error, error, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildNodes, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getLength, getNodeName, getNodeType, getNodeValue, getOwnerElement, getSpecified, hasAttribute, hasAttributeNS, hasAttributes, importNode, insertBefore, insertData, item, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, replaceData, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setNodeValue, setPrefix, setValue, splitText, substringData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_posInChildList

protected int m_posInChildList
The position of this node in its parent's children list

m_childCount

protected int m_childCount
Number of children of this node. This number also includes attribute nodes
Constructor Detail

Parent

public Parent(DocumentImpl doc)
Constructor Parent

Parameters:
doc - Document object
Method Detail

getChildCount

public int getChildCount()
Get the number of children this node currently contains. Note that this will only return the number of children added so far. If the isComplete property is false, it is likely that more children will be added. DON'T CALL THIS FUNCTION IF YOU CAN HELP IT!!!

Returns:
number of children this node currently contains

hasChildNodes

public boolean hasChildNodes()
This is a convenience method to allow easy determination of whether a node has any children.

Returns:
true if the node has any children, false if the node has no children.
Overrides:
hasChildNodes in class Child

getChildUID

public int getChildUID(int pos)
Get the position of the child of an element in the document. Note that this is assuming an index starting at 1

Parameters:
pos - Position of the child in this parent's children list
Returns:
the position of this child in the document or -1 if the child is not found

getChild

public Child getChild(int i)
               throws java.lang.ArrayIndexOutOfBoundsException,
                      java.lang.NullPointerException
Get the nth child.

Parameters:
i - the index of the child.
Returns:
The child node at the specified position or null if none found
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index is out of bounds.
java.lang.NullPointerException - if there are no children.

getFirstChild

public org.w3c.dom.Node getFirstChild()
The first child of this node. If there is no such node, this returns null.

Returns:
The first child of this parent or null if none found
Overrides:
getFirstChild in class Child

getLastChild

public org.w3c.dom.Node getLastChild()
The last child of this node. If there is no such node, this returns null.

Returns:
The last child of this parent
Overrides:
getLastChild in class Child

appendChild

public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
                             throws org.w3c.dom.DOMException
Append a child to the child list.

Parameters:
newChild - Must be a weblogic.apache.xalan.stree.Child.
Returns:
The node we just added to this parent's children list
Throws:
java.lang.ClassCastException - if the newChild isn't a weblogic.apache.xalan.stree.Child.
org.w3c.dom.DOMException -  
Overrides:
appendChild in class UnImplNode

isComplete

public boolean isComplete()
Return if this node has had all it's children added, i.e. if a endElement event has occured.

Returns:
whether this node has had all it's children added or not
Overrides:
isComplete in class Child

setComplete

public void setComplete(boolean isComplete)
Set that this node's child list is complete, i.e. an endElement event has occured.

Parameters:
isComplete - flag indicating whether this node has had all it's children added
Overrides:
setComplete in class Child

throwParseError

protected void throwParseError(java.lang.Exception e)
Throw a ParseError exception

Parameters:
e - The original exception
Overrides:
throwParseError in class Child

dispatchCharactersEvent

public void dispatchCharactersEvent(org.xml.sax.ContentHandler ch)
                             throws org.xml.sax.SAXException
Handle a Characters event

Parameters:
ch - Content handler to handle SAX events
Throws:
SAXException - if the content handler characters event throws a SAXException.
Overrides:
dispatchCharactersEvent in class Child

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.