Class FastPageParser
java.lang.Object
com.opensymphony.module.sitemesh.parser.FastPageParser
- All Implemented Interfaces:
PageParser
Deprecated.
Use HTMLPageParser instead - it performs better and is more extensible.
Very fast PageParser implementation for parsing HTML.
Produces FastPage.
- Version:
- $Revision: 1.13 $
- Author:
- Victor Salaman
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated.private static final int
Deprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate FastPage
internalParse
(Reader reader) Deprecated.parse
(char[] data) Deprecated.This builds a Page.Deprecated.private static FastPageParser.Tag
parseProperties
(FastPageParser.Tag tag, CharArray buffer) Deprecated.This is called when we need to extract the properties for the tag from the tag's HTML.private FastPageParser.Tag
parseTag
(FastPageParser.Tag tag, CharArray buf) Deprecated.Populates aFastPageParser.Tag
object using data from the suppliedCharArray
.private static boolean
shouldWriteToHead
(int state, int laststate) Deprecated.private static void
writeTag
(int state, int laststate, boolean hide, CharArray _head, CharArray _buffer, CharArray _body) Deprecated.
-
Field Details
-
TOKEN_NONE
private static final int TOKEN_NONEDeprecated.- See Also:
-
TOKEN_EOF
private static final int TOKEN_EOFDeprecated.- See Also:
-
TOKEN_TEXT
private static final int TOKEN_TEXTDeprecated.- See Also:
-
TOKEN_TAG
private static final int TOKEN_TAGDeprecated.- See Also:
-
TOKEN_COMMENT
private static final int TOKEN_COMMENTDeprecated.- See Also:
-
TOKEN_CDATA
private static final int TOKEN_CDATADeprecated.- See Also:
-
TOKEN_SCRIPT
private static final int TOKEN_SCRIPTDeprecated.- See Also:
-
TOKEN_DOCTYPE
private static final int TOKEN_DOCTYPEDeprecated.- See Also:
-
TOKEN_EMPTYTAG
private static final int TOKEN_EMPTYTAGDeprecated.- See Also:
-
STATE_EOF
private static final int STATE_EOFDeprecated.- See Also:
-
STATE_TEXT
private static final int STATE_TEXTDeprecated.- See Also:
-
STATE_TAG
private static final int STATE_TAGDeprecated.- See Also:
-
STATE_COMMENT
private static final int STATE_COMMENTDeprecated.- See Also:
-
STATE_TAG_QUOTE
private static final int STATE_TAG_QUOTEDeprecated.- See Also:
-
STATE_CDATA
private static final int STATE_CDATADeprecated.- See Also:
-
STATE_SCRIPT
private static final int STATE_SCRIPTDeprecated.- See Also:
-
STATE_DOCTYPE
private static final int STATE_DOCTYPEDeprecated.- See Also:
-
TAG_STATE_NONE
private static final int TAG_STATE_NONEDeprecated.- See Also:
-
TAG_STATE_HTML
private static final int TAG_STATE_HTMLDeprecated.- See Also:
-
TAG_STATE_HEAD
private static final int TAG_STATE_HEADDeprecated.- See Also:
-
TAG_STATE_TITLE
private static final int TAG_STATE_TITLEDeprecated.- See Also:
-
TAG_STATE_BODY
private static final int TAG_STATE_BODYDeprecated.- See Also:
-
TAG_STATE_XML
private static final int TAG_STATE_XMLDeprecated.- See Also:
-
TAG_STATE_XMP
private static final int TAG_STATE_XMPDeprecated.- See Also:
-
SLASH_XML_HASH
private static final int SLASH_XML_HASHDeprecated.- See Also:
-
XML_HASH
private static final int XML_HASHDeprecated.- See Also:
-
SLASH_XMP_HASH
private static final int SLASH_XMP_HASHDeprecated.- See Also:
-
XMP_HASH
private static final int XMP_HASHDeprecated.- See Also:
-
HTML_HASH
private static final int HTML_HASHDeprecated.- See Also:
-
SLASH_HTML_HASH
private static final int SLASH_HTML_HASHDeprecated.- See Also:
-
HEAD_HASH
private static final int HEAD_HASHDeprecated.- See Also:
-
TITLE_HASH
private static final int TITLE_HASHDeprecated.- See Also:
-
SLASH_TITLE_HASH
private static final int SLASH_TITLE_HASHDeprecated.- See Also:
-
PARAMETER_HASH
private static final int PARAMETER_HASHDeprecated.- See Also:
-
META_HASH
private static final int META_HASHDeprecated.- See Also:
-
SLASH_HEAD_HASH
private static final int SLASH_HEAD_HASHDeprecated.- See Also:
-
FRAMESET_HASH
private static final int FRAMESET_HASHDeprecated.- See Also:
-
FRAME_HASH
private static final int FRAME_HASHDeprecated.- See Also:
-
BODY_HASH
private static final int BODY_HASHDeprecated.- See Also:
-
SLASH_BODY_HASH
private static final int SLASH_BODY_HASHDeprecated.- See Also:
-
CONTENT_HASH
private static final int CONTENT_HASHDeprecated.- See Also:
-
-
Constructor Details
-
FastPageParser
public FastPageParser()Deprecated.
-
-
Method Details
-
parse
Deprecated.Description copied from interface:PageParser
This builds a Page.- Specified by:
parse
in interfacePageParser
- Throws:
IOException
-
parse
Deprecated. -
internalParse
Deprecated. -
writeTag
private static void writeTag(int state, int laststate, boolean hide, CharArray _head, CharArray _buffer, CharArray _body) Deprecated. -
shouldWriteToHead
private static boolean shouldWriteToHead(int state, int laststate) Deprecated. -
parseTag
Deprecated.Populates aFastPageParser.Tag
object using data from the suppliedCharArray
. The supplied tag parameter is reset and reused - this avoids excess object creation which hwlps performance.- Returns:
- the same tag instance that was passed in, except it will be populated with a new name value (and the corresponding nameEndIdx value). However if the tag contained nathing but whitespace, this method will return null.
-
parseProperties
Deprecated.This is called when we need to extract the properties for the tag from the tag's HTML. We only call this when necessary since it has quite a lot of overhead.- Parameters:
tag
- the tag that is currently being processed. This should be the tag that was returned as a result of a call toparseTag(FastPageParser.Tag, CharArray)
(ie, it has the name and nameEndIdx fields set correctly for the tag in question. The properties field can be in an undefined state - it will get replaced regardless).buffer
- a CharArray containing the entire tag that is being parsed.- Returns:
- the same tag instance that was passed in, only it will now be populated with any properties that were specified in the tag's HTML.
-