Package dev.pxml.core.reader.tokenizer
Class Tokenizer
- java.lang.Object
-
- dev.pxml.core.reader.tokenizer.Tokenizer
-
- All Implemented Interfaces:
ITokenizer
public class Tokenizer extends java.lang.Object implements ITokenizer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptChar(char c)
char
currentChar()
int
currentColumnNumber()
int
currentLineNumber()
TextLocation
currentLocation()
java.lang.Object
getResource()
boolean
isAtChar(char c)
boolean
isAtSpaceOrTab()
boolean
isAtWhiteSpace()
boolean
isEof()
boolean
isNextChar(char c)
java.lang.String
peekCurrentNChars(int n)
char
peekNextChar()
java.lang.String
readAttributeValue()
java.lang.String
readComment()
java.lang.String
readName()
char
readNextChar()
java.lang.String
readQuotedAttributeValue()
java.lang.String
readText()
java.lang.String
readUnquotedAttributeValue()
boolean
skipComment()
boolean
skipSpacesAndTabs()
boolean
skipWhiteSpace()
-
-
-
Constructor Detail
-
Tokenizer
public Tokenizer(java.io.Reader reader, java.lang.Object resource) throws java.io.IOException
- Throws:
java.io.IOException
-
Tokenizer
public Tokenizer(java.lang.String string, java.lang.Object resource) throws java.io.IOException
- Throws:
java.io.IOException
-
Tokenizer
public Tokenizer(java.lang.String string) throws java.io.IOException
- Throws:
java.io.IOException
-
Tokenizer
public Tokenizer(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
isEof
public boolean isEof()
- Specified by:
isEof
in interfaceITokenizer
-
currentChar
public char currentChar()
- Specified by:
currentChar
in interfaceITokenizer
-
getResource
public java.lang.Object getResource()
- Specified by:
getResource
in interfaceITokenizer
-
currentLineNumber
public int currentLineNumber()
- Specified by:
currentLineNumber
in interfaceITokenizer
-
currentColumnNumber
public int currentColumnNumber()
- Specified by:
currentColumnNumber
in interfaceITokenizer
-
currentLocation
public TextLocation currentLocation()
- Specified by:
currentLocation
in interfaceITokenizer
-
isAtChar
public boolean isAtChar(char c)
- Specified by:
isAtChar
in interfaceITokenizer
-
isNextChar
public boolean isNextChar(char c) throws java.io.IOException
- Specified by:
isNextChar
in interfaceITokenizer
- Throws:
java.io.IOException
-
peekNextChar
public char peekNextChar() throws java.io.IOException
- Specified by:
peekNextChar
in interfaceITokenizer
- Throws:
java.io.IOException
-
peekCurrentNChars
public java.lang.String peekCurrentNChars(int n) throws java.io.IOException
- Specified by:
peekCurrentNChars
in interfaceITokenizer
- Throws:
java.io.IOException
-
acceptChar
public boolean acceptChar(char c) throws java.io.IOException
- Specified by:
acceptChar
in interfaceITokenizer
- Throws:
java.io.IOException
-
readNextChar
public char readNextChar() throws java.io.IOException
- Specified by:
readNextChar
in interfaceITokenizer
- Throws:
java.io.IOException
-
readName
public java.lang.String readName() throws java.io.IOException
- Specified by:
readName
in interfaceITokenizer
- Throws:
java.io.IOException
-
readText
public java.lang.String readText() throws java.io.IOException, PXMLDataException
- Specified by:
readText
in interfaceITokenizer
- Throws:
java.io.IOException
PXMLDataException
-
readAttributeValue
public java.lang.String readAttributeValue() throws java.io.IOException, PXMLDataException
- Specified by:
readAttributeValue
in interfaceITokenizer
- Throws:
java.io.IOException
PXMLDataException
-
readQuotedAttributeValue
public java.lang.String readQuotedAttributeValue() throws java.io.IOException, PXMLDataException
- Specified by:
readQuotedAttributeValue
in interfaceITokenizer
- Throws:
java.io.IOException
PXMLDataException
-
readUnquotedAttributeValue
public java.lang.String readUnquotedAttributeValue() throws java.io.IOException
- Specified by:
readUnquotedAttributeValue
in interfaceITokenizer
- Throws:
java.io.IOException
-
skipWhiteSpace
public boolean skipWhiteSpace() throws java.io.IOException
- Specified by:
skipWhiteSpace
in interfaceITokenizer
- Throws:
java.io.IOException
-
skipSpacesAndTabs
public boolean skipSpacesAndTabs() throws java.io.IOException
- Specified by:
skipSpacesAndTabs
in interfaceITokenizer
- Throws:
java.io.IOException
-
isAtWhiteSpace
public boolean isAtWhiteSpace()
- Specified by:
isAtWhiteSpace
in interfaceITokenizer
-
isAtSpaceOrTab
public boolean isAtSpaceOrTab()
- Specified by:
isAtSpaceOrTab
in interfaceITokenizer
-
readComment
public java.lang.String readComment() throws java.io.IOException, PXMLDataException
- Specified by:
readComment
in interfaceITokenizer
- Throws:
java.io.IOException
PXMLDataException
-
skipComment
public boolean skipComment() throws java.io.IOException, PXMLDataException
- Specified by:
skipComment
in interfaceITokenizer
- Throws:
java.io.IOException
PXMLDataException
-
-