org.jdom
Class CDATA

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

public class CDATA
extends java.lang.Object
implements java.io.Serializable, java.lang.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  java.lang.String text
          Text of the CDATA
 
Constructor Summary
protected CDATA()
           Default, no-args constructor for implementations to use if needed.
  CDATA(java.lang.String text)
           This creates the CDATA with the supplied text.
 
Method Summary
 java.lang.Object clone()
           This will return a clone of this CDATA.
 boolean equals(java.lang.Object ob)
           This tests for equality of this CDATA to the supplied Object.
 java.lang.String getSerializedForm()
           This will return the CDATA in XML format, usable in an XML document.
 java.lang.String getText()
           This returns the textual data within the CDATA.
 int hashCode()
           This returns the hash code for this CDATA.
 void setText(java.lang.String text)
           This will set the value of the CDATA.
 java.lang.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 java.lang.String text
Text of the CDATA
Constructor Detail

CDATA

protected CDATA()

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


CDATA

public CDATA(java.lang.String text)

This creates the CDATA with the supplied text.

Parameters:
text - String content of CDATA.
Method Detail

getText

public java.lang.String getText()

This returns the textual data within the CDATA.

Returns:
String - text of CDATA.

setText

public void setText(java.lang.String text)

This will set the value of the CDATA.

Parameters:
text - String text for CDATA.
Returns:
CDATA - this CDATA modified.

toString

public final java.lang.String toString()

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

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

getSerializedForm

public final java.lang.String getSerializedForm()

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

Returns:
String - the serialized form of the CDATA.

equals

public final boolean equals(java.lang.Object ob)

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

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

hashCode

public final int hashCode()

This returns the hash code for this CDATA.

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

clone

public final java.lang.Object clone()

This will return a clone of this CDATA.

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


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