Package com.sun.java.help.impl
Class DocumentParser
java.lang.Object
com.sun.java.help.impl.DocumentParser
- Direct Known Subclasses:
Parser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
callFlush
(char[] buf, int offset, int length) Invokes flush().protected abstract void
This method inserts a comment It should be overridden by the subclassprotected void
commentEOFError
(int resetTo) protected abstract void
This method emits a doctype.protected abstract String
documentAttribute
(String name) This method looks up a &xxx; sequence in the document properties (this is used for templates).protected void
eofError()
protected abstract void
This method inserts a parse error string into the document It should be overridden by the subclassprotected void
findCloseAngleForComment
(char c) protected abstract void
flush
(char[] buf, int offset, int length) This method creates a block of text for a document.protected void
generateError
(int offset) protected char
handleCommentOrDoctype
(char c) protected void
void
parse()
protected char
protected char
parseTag()
void
protected abstract void
This method emits a pi It should be overridden by the subclassprotected char
readChar()
protected char
scanIdentifier
(char c) protected char
scanQuotedString
(char c) void
setInput
(InputStream i, String encoding) void
void
setShouldCacheSource
(boolean state) protected void
setXmlEntities
(TagProperties attr) protected void
skipToCloseAngle
(char c) This method is called when parsing a tag and an error is encountered.protected char
skipWhite
(char c) protected abstract void
tag
(String name, TagProperties atts, boolean endTag, boolean emptyTag) This method emits a tag It should be overridden by the subclass
-
Field Details
-
source
-
-
Constructor Details
-
DocumentParser
***** Public interface ***** ***** -
DocumentParser
-
-
Method Details
-
setInput
-
setInput
- Throws:
UnsupportedEncodingException
-
setShouldCacheSource
public void setShouldCacheSource(boolean state) -
getDocumentSource
-
parse
- Throws:
IOException
-
parseText
- Throws:
IOException
-
callFlush
protected void callFlush(char[] buf, int offset, int length) Invokes flush(). This method is provided so that flush() can be protected -
flush
protected abstract void flush(char[] buf, int offset, int length) This method creates a block of text for a document. It should be overridden by the subclass -
comment
This method inserts a comment It should be overridden by the subclass -
tag
This method emits a tag It should be overridden by the subclass -
pi
This method emits a pi It should be overridden by the subclass -
doctype
This method emits a doctype. Internal subset information is discarded It should be overridden by the subclass -
documentAttribute
This method looks up a &xxx; sequence in the document properties (this is used for templates). A return of null means the proerty is undefined. It should be overridden by the subclass -
errorString
This method inserts a parse error string into the document It should be overridden by the subclass -
findCloseAngleForComment
- Throws:
IOException
-
handleCommentOrDoctype
- Throws:
IOException
-
setXmlEntities
-
parseTag
- Throws:
IOException
-
parseEscape
- Throws:
IOException
-
initEntities
protected void initEntities() -
scanIdentifier
- Throws:
IOException
-
scanQuotedString
- Throws:
IOException
-
skipWhite
- Throws:
IOException
-
readChar
- Throws:
IOException
-
skipToCloseAngle
This method is called when parsing a tag and an error is encountered. It skips to the closing angle bracket, treating the entire tag as error text. The generateError call at the end stuffs the full tag into the document as an error.- Throws:
IOException
-
generateError
protected void generateError(int offset) -
commentEOFError
protected void commentEOFError(int resetTo) -
eofError
protected void eofError()
-