WebLogic Integration


com.bea.document
Class DocumentData

java.lang.Object
  |
  +--com.bea.document.DocumentData
Direct Known Subclasses:
BooleanDocumentData, NodeSetDocumentData, NumberDocumentData, RTreeDocumentData, StringDocumentData

public class DocumentData
extends java.lang.Object

A representation of data within a document. All data within a document must be in one of several pre-defined data types. These are:

TYPE_BOOLEAN - boolean data type having values true or false
TYPE_NODESET - a set of nodes as defined by the org.w3c.dom.NodeList.
TYPE_NULL - null data
TYPE_NUMBER - floating point data (implemented as double)
TYPE_RTREEFRAG - document fragment
TYPE_STRING - Unicode string (java.lang.String)
TYPE_UNKNOWN - Unknown type

For example, calling IDocument.getDocumentData(String path) with a path that refers to the root of a document, you will get a NodeSetDocumentData return value that contains the root element of the document. You can call toNodeSet() on this object to return a org.w3c.dom..NodeList which you can use to iterate over the single returned element.
You may create instances of the sublasses of this class, for use in IDocument methods such as addDocumentData().

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
IDocument.addDocumentData(String, DocumentData)

Field Summary
protected  weblogic.apache.xpath.objects.XObject m_xobj
           
static int TYPE_BOOLEAN
           
static int TYPE_NODESET
           
static int TYPE_NULL
           
static int TYPE_NUMBER
           
static int TYPE_RTREEFRAG
           
static int TYPE_STRING
           
static int TYPE_UNKNOWN
           
 
Constructor Summary
DocumentData()
           
DocumentData(weblogic.apache.xpath.objects.XObject xobj)
           
 
Method Summary
static DocumentData createDocumentData(weblogic.apache.xpath.objects.XObject xobj)
           
 java.lang.String dump()
          Create a string describing this document data (: ).
 java.lang.String dump(boolean includeType)
          Create a string describing this document data (: ).
 boolean equals(DocumentData data)
          Tell if two objects are functionally equal.
 int getType()
          Get the type for this document data.
 boolean greaterThan(DocumentData data)
          Tell if this object is greater than the other.
 boolean greaterThanOrEqual(DocumentData data)
          Tell if this object is greater than or equal to the other.
 boolean lessThan(DocumentData data)
          Tell if this object is less than the other.
 boolean lessThanOrEqual(DocumentData data)
          Tell if this object is less than or equal to the other.
 boolean toBoolean()
          Cast this document data to a boolean.
 org.w3c.dom.traversal.NodeIterator toNodeIterator()
          Cast this document data to a list that represents the nodes contained within it.
 org.w3c.dom.NodeList toNodeSet()
          Cast this document data to a list that represents the nodes contained within it.
 double toNumber()
          Cast this data to a number (double)
 java.lang.Object toObject()
          Return a java object that's closest to the represenation that should be handed to an extension.
 org.w3c.dom.DocumentFragment toRtree()
          Cast this document data to a document fragment
 java.lang.String toStr()
          Cast this document data to a string.
 java.lang.String toXML()
          Create a string describing this document data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_BOOLEAN

public static final int TYPE_BOOLEAN

TYPE_NODESET

public static final int TYPE_NODESET

TYPE_NULL

public static final int TYPE_NULL

TYPE_NUMBER

public static final int TYPE_NUMBER

TYPE_RTREEFRAG

public static final int TYPE_RTREEFRAG

TYPE_STRING

public static final int TYPE_STRING

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN

m_xobj

protected weblogic.apache.xpath.objects.XObject m_xobj
Constructor Detail

DocumentData

public DocumentData()

DocumentData

public DocumentData(weblogic.apache.xpath.objects.XObject xobj)
Method Detail

createDocumentData

public static DocumentData createDocumentData(weblogic.apache.xpath.objects.XObject xobj)
                                       throws javax.xml.transform.TransformerException

getType

public int getType()
Get the type for this document data.

toBoolean

public boolean toBoolean()
                  throws DocumentException
Cast this document data to a boolean.

toNodeSet

public org.w3c.dom.NodeList toNodeSet()
                               throws DocumentException
Cast this document data to a list that represents the nodes contained within it.

toNodeIterator

public org.w3c.dom.traversal.NodeIterator toNodeIterator()
                                                  throws DocumentException
Cast this document data to a list that represents the nodes contained within it.

toNumber

public double toNumber()
                throws DocumentException
Cast this data to a number (double)

toRtree

public org.w3c.dom.DocumentFragment toRtree()
                                     throws DocumentException
Cast this document data to a document fragment

toStr

public java.lang.String toStr()
                       throws DocumentException
Cast this document data to a string. If this DocumentData is of type TYPE_NODESET, this string will represent only the text content of Node objects in the nodeset. This means you will see only the text, and none of the XML markup for the nodes. To get a true XML representation, use toXML().

toXML

public java.lang.String toXML()
Create a string describing this document data. This method is similar to the toStr() method, except that nodeset type data will be rendered with XML markup intact.

dump

public java.lang.String dump()
Create a string describing this document data (: ).

dump

public java.lang.String dump(boolean includeType)
Create a string describing this document data (: ). ':' will be omitted if includeType is false.

Parameters:
includeType -  
Returns:
String representation of the data

equals

public boolean equals(DocumentData data)
               throws DocumentException
Tell if two objects are functionally equal.

greaterThan

public boolean greaterThan(DocumentData data)
                    throws DocumentException
Tell if this object is greater than the other.

greaterThanOrEqual

public boolean greaterThanOrEqual(DocumentData data)
                           throws DocumentException
Tell if this object is greater than or equal to the other.

lessThan

public boolean lessThan(DocumentData data)
                 throws DocumentException
Tell if this object is less than the other.

lessThanOrEqual

public boolean lessThanOrEqual(DocumentData data)
                        throws DocumentException
Tell if this object is less than or equal to the other.

toObject

public java.lang.Object toObject()
Return a java object that's closest to the represenation that should be handed to an extension.

WebLogic Integration

WebLogic Integration (WLI)