Package de.pdark.decentxml
Class Token
- java.lang.Object
-
- de.pdark.decentxml.Token
-
public class Token extends java.lang.ObjectA piece of XML.
-
-
Field Summary
Fields Modifier and Type Field Description private intendOffsetprivate XMLSourcesourceprivate intstartOffsetprivate XMLTokenizer.Typetype
-
Constructor Summary
Constructors Constructor Description Token()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetEndOffset()The position after the last character of the token (matching the definition ofString.substring(start,end)java.lang.StringgetEscapedText()Return the text with all special characters (like line feed, new line, null bytes, characters in the unicode range) escaped.java.lang.StringgetPrefixWhiteSpace()XMLSourcegetSource()intgetStartOffset()The position in the source at which the token beginsjava.lang.StringgetText()Return the string of text which this token represents in the XMLSourceXMLTokenizer.TypegetType()voidsetEndOffset(int endOffset)voidsetSource(XMLSource source)voidsetStartOffset(int startOffset)voidsetType(XMLTokenizer.Type type)java.lang.StringtoString()
-
-
-
Field Detail
-
source
private XMLSource source
-
type
private XMLTokenizer.Type type
-
startOffset
private int startOffset
-
endOffset
private int endOffset
-
-
Method Detail
-
setSource
public void setSource(XMLSource source)
-
getSource
public XMLSource getSource()
-
getText
public java.lang.String getText()
Return the string of text which this token represents in the XMLSource- Returns:
- the text or
nullif there is no source
-
getEscapedText
public java.lang.String getEscapedText()
Return the text with all special characters (like line feed, new line, null bytes, characters in the unicode range) escaped.The result of this method can use used directly in a Java String.
- Returns:
- the text (without quotes) or
nullif there is no source
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setType
public void setType(XMLTokenizer.Type type)
-
getType
public XMLTokenizer.Type getType()
-
setStartOffset
public void setStartOffset(int startOffset)
-
getStartOffset
public int getStartOffset()
The position in the source at which the token begins
-
setEndOffset
public void setEndOffset(int endOffset)
-
getEndOffset
public int getEndOffset()
The position after the last character of the token (matching the definition ofString.substring(start,end)
-
getPrefixWhiteSpace
public java.lang.String getPrefixWhiteSpace()
-
-