|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--intradoc.common.ParseOutput
Holds current state of parsing. This class is used to optimize the parsing of a stream by doing its own buffering and buffer management.
| Field Summary | |
boolean |
m_failOnDecodeError
Set to true to cause an IOException to be thrown when a Unicode replacement character shows up. |
boolean |
m_hasTracedUnicodeReplacementCharacter
This is set by parser to note that it has already complained. |
boolean |
m_hasUnicodeReplacementCharacter
This is set to true by intradoc.common.Parser so it only complains once per file. |
boolean |
m_isEOF
Set to true if EOF is reached while reading in characters. |
boolean |
m_isXmlLiteralEscape
Turn to true if the escaping mechanism in literal strings uses the XML/HTML &XXX; approach. |
ParseLocationInfo |
m_markParseInfo
Start parse location of block currently being parsed. |
boolean |
m_noLiteralStrings
Turn to true if parsing should not respect rules for enclosing literal strings. |
int |
m_numPending
Number of characters waiting in pending output buffer waiting to be written. |
int |
m_numRead
Indicates how many bytes have been read in from the reader. |
int |
m_numWaiting
Indicates the number of characters temporarily being held in the output buffer that need to be written to the output writer. |
char[] |
m_outputBuf
Temporary buffer that holds data before it is sent to the pending buffer, from which it is sent to the output writer. |
ParseLocationInfo |
m_parseInfo
Parse location, used for tracking so that more information can be reported about errors. |
char[] |
m_pendingBuf
Buffer holding data pending write to output writer. |
int |
m_readOffset
Offset into read buffer where processing has started. |
boolean |
m_stopWriting
Temporarily suspend the output |
boolean |
m_traceOnDecodeError
Set to true to cause a tracing message to be created when a Unicode replacement character shows up. |
java.io.Writer |
m_writer
Output is written to. |
static int |
MAX_ALREADY_READ
Maximum read. |
static int |
MAX_PENDING
Pending maximum. |
static int |
OUTPUT_BUF_SIZE
Size of output buffer. |
| Constructor Summary | |
ParseOutput()
|
|
ParseOutput(ParseLocationInfo parseInfo)
|
|
| Method Summary | |
void |
clearPending()
Clears out any data that might be written to the output buffer. |
void |
copyToPending(boolean writeToOutput,
boolean excludeLast)
Copies over all the characters waiting to be sent to the output writer. |
void |
createMarkedParsingException(java.lang.String msg)
Similar to 'createParsingException(...)' except that it uses the saved location. |
void |
createParsingException(java.lang.String msg)
Creates an exception that reports a message and location at which error occurred. |
protected void |
initAttributes()
|
boolean |
isBufferEqualNoCase(char[] buf,
int len)
Method provides optimized comparison of byte buffer against a given string up to 'len' number of characters. |
void |
markParseLocation()
Used to save parse location for later reporting. |
int |
removeNextChar()
Gets the next byte that is not waiting and removes it. |
void |
reset()
|
void |
updateParseLocation(char ch)
Used to update Parse Location for a single character. |
void |
updateParseLocation(char[] buf,
int offset,
int numchars)
Used to update Parse Location. |
java.lang.String |
waitingBufferAsString()
Returns parsed tag between open and close tag elements. |
java.lang.String |
waitingBufferAsStringSuffix(int offset)
Returns parsed tag between open and close tag elements, but offsets from beginning of tag. |
void |
writePending()
Commits any remaining pending. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public boolean m_isXmlLiteralEscape
public boolean m_noLiteralStrings
public java.io.Writer m_writer
public char[] m_outputBuf
public char[] m_pendingBuf
public int m_readOffset
public int m_numPending
public int m_numWaiting
public int m_numRead
public ParseLocationInfo m_parseInfo
public ParseLocationInfo m_markParseInfo
public boolean m_isEOF
public boolean m_stopWriting
public boolean m_hasUnicodeReplacementCharacter
public boolean m_hasTracedUnicodeReplacementCharacter
public boolean m_traceOnDecodeError
public boolean m_failOnDecodeError
public static final int OUTPUT_BUF_SIZE
public static final int MAX_PENDING
public static final int MAX_ALREADY_READ
| Constructor Detail |
public ParseOutput()
public ParseOutput(ParseLocationInfo parseInfo)
| Method Detail |
protected void initAttributes()
public void reset()
public void copyToPending(boolean writeToOutput,
boolean excludeLast)
throws java.io.IOException
java.io.IOException
public void writePending()
throws java.io.IOException
java.io.IOExceptionpublic void clearPending()
public int removeNextChar()
public java.lang.String waitingBufferAsString()
public java.lang.String waitingBufferAsStringSuffix(int offset)
public boolean isBufferEqualNoCase(char[] buf,
int len)
public void updateParseLocation(char[] buf,
int offset,
int numchars)
public void updateParseLocation(char ch)
public void markParseLocation()
public void createParsingException(java.lang.String msg)
throws ParseSyntaxException
ParseSyntaxException
public void createMarkedParsingException(java.lang.String msg)
throws ParseSyntaxException
ParseSyntaxException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
(c) 1996-2005 All rights reserved. Stellent, Inc. |