Package de.pdark.decentxml
Class Token
java.lang.Object
de.pdark.decentxml.Token
A piece of XML.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private XMLSource
private int
private XMLTokenizer.Type
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
The position after the last character of the token (matching the definition ofString.substring(start,end)
Return the text with all special characters (like line feed, new line, null bytes, characters in the unicode range) escaped.int
The position in the source at which the token beginsgetText()
Return the string of text which this token represents in the XMLSourcegetType()
void
setEndOffset
(int endOffset) void
void
setStartOffset
(int startOffset) void
setType
(XMLTokenizer.Type type) toString()
-
Field Details
-
source
-
type
-
startOffset
private int startOffset -
endOffset
private int endOffset
-
-
Constructor Details
-
Token
public Token()
-
-
Method Details
-
setSource
-
getSource
-
getText
Return the string of text which this token represents in the XMLSource- Returns:
- the text or
null
if there is no source
-
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
null
if there is no source
-
toString
-
setType
-
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
-