org.jdom
Class CDATA

java.lang.Object
  |
  +--org.jdom.CDATA

public class CDATA
extends Object
implements Serializable, Cloneable

CDATA defines behavior for an XML CDATA section, modeled in Java. Methods allow the user to obtain the text of the CDATA.

Version:
1.0
Author:
Dan Schaffer, Brett McLaughlin, Jason Hunter
See Also:
Serialized Form

Field Summary
protected  String text
          Text of the CDATA
 
Constructor Summary
protected CDATA()
           Default, no-args constructor for implementations to use if needed.
  CDATA(String text)
           This creates the CDATA with the supplied text.
 
Method Summary
 Object clone()
           This will return a clone of this CDATA.
 boolean equals(Object ob)
           This tests for equality of this CDATA to the supplied Object.
 String getSerializedForm()
          Deprecated. Deprecated in Beta7, use XMLOutputter.outputString(CDATA) instead
 String getText()
           This returns the textual data within the CDATA.
 int hashCode()
           This returns the hash code for this CDATA.
 String toString()
           This returns a String representation of the CDATA, suitable for debugging.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

text

protected String text
Text of the CDATA
Constructor Detail

CDATA

protected CDATA()

Default, no-args constructor for implementations to use if needed.


CDATA

public CDATA(String text)

This creates the CDATA with the supplied text.

Parameters:
text - String content of CDATA.
Throws:
IllegalDataException - if the given text string is invalid in a CDATA section.
Method Detail

getText

public String getText()

This returns the textual data within the CDATA.

Returns:
String - text of CDATA.

toString

public String toString()

This returns a String representation of the CDATA, suitable for debugging. If the XML representation of the CDATA is desired, XMLOutputter.outputString(CDATA) should be used.

Overrides:
toString in class Object
Returns:
String - information about the Attribute

equals

public final boolean equals(Object ob)

This tests for equality of this CDATA to the supplied Object.

Overrides:
equals in class Object
Parameters:
ob - Object to compare to.
Returns:
boolean - whether the Comment is equal to the supplied Object.

hashCode

public final int hashCode()

This returns the hash code for this CDATA.

Overrides:
hashCode in class Object
Returns:
int - hash code.

clone

public Object clone()

This will return a clone of this CDATA.

Overrides:
clone in class Object
Returns:
Object - clone of this CDATA.

getSerializedForm

public final String getSerializedForm()
Deprecated. Deprecated in Beta7, use XMLOutputter.outputString(CDATA) instead

This will return the CDATA in XML format, usable in an XML document.

Returns:
String - the serialized form of the CDATA.


Copyright © 2001 Jason Hunter, Brett McLaughlin. All Rights Reserved.