Package org.htmlunit.cyberneko
Class HTMLScanner.CurrentEntity
- java.lang.Object
-
- org.htmlunit.cyberneko.HTMLScanner.CurrentEntity
-
- Enclosing class:
- HTMLScanner
static final class HTMLScanner.CurrentEntity extends java.lang.ObjectCurrent entity.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringbaseSystemIdBase system identifier.(package private) char[]buffer_Character buffer.private intcharacterOffset_Character offset in the file.private intcolumnNumber_Column number.(package private) java.lang.Stringencoding_Encoding.private booleanendReached_(package private) intlength_Length of characters read into character buffer.private intlineNumber_Line number.java.lang.StringliteralSystemIdLiteral system identifier.(package private) intoffset_Offset into character buffer.java.lang.StringpublicIdPublic identifier.private java.io.Readerreader_Character stream.(package private) java.lang.StringsystemIdExpanded system identifier.java.lang.StringversionXML version.
-
Constructor Summary
Constructors Constructor Description CurrentEntity(java.io.Reader reader, int readerBufferSize, java.lang.String encoding, java.lang.String publicId, java.lang.String baseSystemId, java.lang.String literalSystemId, java.lang.String systemId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcloseQuietly()private voiddebugBufferIfNeeded(java.lang.String prefix)Prints the contents of the character buffer to standard out.private voiddebugBufferIfNeeded(java.lang.String prefix, java.lang.String suffix)Prints the contents of the character buffer to standard out.(package private) intgetCharacterOffset()(package private) intgetColumnNumber()(package private) chargetCurrentChar()intgetLineNumber()(package private) chargetNextChar()(package private) booleanhasNext()Indicates if there are characters left.(package private) voidincLine()(package private) voidincLine(int nbLines)(package private) intload(int loadOffset)Loads a new chunk of data into the buffer and returns the number of characters loaded or -1 if no additional characters were loaded.(package private) intloadWholeBuffer()(package private) java.lang.StringnextContent(int len)Reads the next characters WITHOUT impacting the buffer content up to current offset.(package private) intread()(package private) intreadPreservingBufferContent()(package private) voidresetBuffer(XMLString xmlBuffer, int lineNumber, int columnNumber, int characterOffset)(package private) voidrewind()Goes back, canceling the effect of the previous read() call.(package private) voidrewind(int i)(package private) voidsetStream(java.io.Reader inputStreamReader, java.lang.String encoding)(package private) booleanskip(java.lang.String expectedInUpperCase)(package private) booleanskipMarkup(boolean balance)(package private) intskipNewlines()(package private) booleanskipSpaces()
-
-
-
Field Detail
-
reader_
private java.io.Reader reader_
Character stream.
-
encoding_
java.lang.String encoding_
Encoding.
-
publicId
public final java.lang.String publicId
Public identifier.
-
baseSystemId
public final java.lang.String baseSystemId
Base system identifier.
-
literalSystemId
public final java.lang.String literalSystemId
Literal system identifier.
-
systemId
final java.lang.String systemId
Expanded system identifier.
-
version
public final java.lang.String version
XML version.- See Also:
- Constant Field Values
-
lineNumber_
private int lineNumber_
Line number.
-
columnNumber_
private int columnNumber_
Column number.
-
characterOffset_
private int characterOffset_
Character offset in the file.
-
buffer_
char[] buffer_
Character buffer.
-
offset_
int offset_
Offset into character buffer.
-
length_
int length_
Length of characters read into character buffer.
-
endReached_
private boolean endReached_
-
-
Method Detail
-
getCurrentChar
char getCurrentChar()
-
getNextChar
char getNextChar()
- Returns:
- the current character and moves to next one.
-
closeQuietly
void closeQuietly()
-
hasNext
boolean hasNext()
Indicates if there are characters left.
-
load
int load(int loadOffset) throws java.io.IOException
Loads a new chunk of data into the buffer and returns the number of characters loaded or -1 if no additional characters were loaded.- Parameters:
loadOffset- The offset at which new characters should be loaded.- Returns:
- count
- Throws:
java.io.IOException- in case of io problems
-
loadWholeBuffer
int loadWholeBuffer() throws java.io.IOException- Throws:
java.io.IOException
-
read
int read() throws java.io.IOException
- Throws:
java.io.IOException
-
nextContent
java.lang.String nextContent(int len) throws java.io.IOExceptionReads the next characters WITHOUT impacting the buffer content up to current offset.- Parameters:
len- the number of characters to read- Returns:
- the read string (length may be smaller if EOF is encountered)
- Throws:
java.io.IOException- in case of io problems
-
readPreservingBufferContent
int readPreservingBufferContent() throws java.io.IOException- Throws:
java.io.IOException
-
debugBufferIfNeeded
private void debugBufferIfNeeded(java.lang.String prefix)
Prints the contents of the character buffer to standard out.
-
debugBufferIfNeeded
private void debugBufferIfNeeded(java.lang.String prefix, java.lang.String suffix)Prints the contents of the character buffer to standard out.
-
setStream
void setStream(java.io.Reader inputStreamReader, java.lang.String encoding)
-
rewind
void rewind()
Goes back, canceling the effect of the previous read() call.
-
rewind
void rewind(int i)
-
incLine
void incLine()
-
incLine
void incLine(int nbLines)
-
getLineNumber
public int getLineNumber()
-
resetBuffer
void resetBuffer(XMLString xmlBuffer, int lineNumber, int columnNumber, int characterOffset)
-
getColumnNumber
int getColumnNumber()
-
getCharacterOffset
int getCharacterOffset()
-
skip
boolean skip(java.lang.String expectedInUpperCase) throws java.io.IOException- Throws:
java.io.IOException
-
skipMarkup
boolean skipMarkup(boolean balance) throws java.io.IOException- Throws:
java.io.IOException
-
skipSpaces
boolean skipSpaces() throws java.io.IOException- Throws:
java.io.IOException
-
skipNewlines
int skipNewlines() throws java.io.IOException- Throws:
java.io.IOException
-
-