All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.jclark.xml.parse.CharacterDataEvent

public interface CharacterDataEvent
Information about character data. There is no guarantee that consecutive characters will be reported in the same CharacterDataEvent. Surrogate pairs are guaranteed not to be split across CharacterDataEvents. Line boundaries are normalized to '\n' (ASCII code 10).

See Also:
characterData

Method Index

 o copyChars(char[], int)
Copies the character data into the specified character array starting at index off.
 o getLength()
Returns the length in chars of the character data.
 o getLengthMax()
Returns an upper bound on the length of the character data.
 o isReference()
Returns true if the character was a result of a character reference or a predefined entity reference.
 o writeChars(Writer)
Writes the character data to the specified Writer.

Methods

 o getLength
 public abstract int getLength()
Returns the length in chars of the character data. A character represented by a pair of surrogate chars counts as 2 chars.

 o getLengthMax
 public abstract int getLengthMax()
Returns an upper bound on the length of the character data. The value returned is guaranteed to be greater than or equal the value returned by getLength. This can be used to ensure that the buffer passed to copyChars is large enough; it is typically much faster to use getLengthMax than getLength for this.

 o copyChars
 public abstract int copyChars(char cbuf[],
                               int off)
Copies the character data into the specified character array starting at index off. The length of the array must be sufficient to hold all the character data.

Returns:
the number of characters of data (the same as returned by getLength)
 o writeChars
 public abstract void writeChars(Writer writer) throws IOException
Writes the character data to the specified Writer.

 o isReference
 public abstract boolean isReference()
Returns true if the character was a result of a character reference or a predefined entity reference. If this returns true, then getLength and getLengthMax will return, unless the referenced character is represented as a surrogate pair in which case 2 will be returned.


All Packages  Class Hierarchy  This Package  Previous  Next  Index