Class FastPageParser
- java.lang.Object
-
- com.opensymphony.module.sitemesh.parser.FastPageParser
-
- All Implemented Interfaces:
PageParser
public final class FastPageParser extends Object implements 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 Modifier and Type Class Description private classFastPageParser.TagDeprecated.
-
Field Summary
Fields Modifier and Type Field Description private static intBODY_HASHDeprecated.private static intCONTENT_HASHDeprecated.private static intFRAME_HASHDeprecated.private static intFRAMESET_HASHDeprecated.private static intHEAD_HASHDeprecated.private static intHTML_HASHDeprecated.private static intMETA_HASHDeprecated.private static intPARAMETER_HASHDeprecated.private static intSLASH_BODY_HASHDeprecated.private static intSLASH_HEAD_HASHDeprecated.private static intSLASH_HTML_HASHDeprecated.private static intSLASH_TITLE_HASHDeprecated.private static intSLASH_XML_HASHDeprecated.private static intSLASH_XMP_HASHDeprecated.private static intSTATE_CDATADeprecated.private static intSTATE_COMMENTDeprecated.private static intSTATE_DOCTYPEDeprecated.private static intSTATE_EOFDeprecated.private static intSTATE_SCRIPTDeprecated.private static intSTATE_TAGDeprecated.private static intSTATE_TAG_QUOTEDeprecated.private static intSTATE_TEXTDeprecated.private static intTAG_STATE_BODYDeprecated.private static intTAG_STATE_HEADDeprecated.private static intTAG_STATE_HTMLDeprecated.private static intTAG_STATE_NONEDeprecated.private static intTAG_STATE_TITLEDeprecated.private static intTAG_STATE_XMLDeprecated.private static intTAG_STATE_XMPDeprecated.private static intTITLE_HASHDeprecated.private static intTOKEN_CDATADeprecated.private static intTOKEN_COMMENTDeprecated.private static intTOKEN_DOCTYPEDeprecated.private static intTOKEN_EMPTYTAGDeprecated.private static intTOKEN_EOFDeprecated.private static intTOKEN_NONEDeprecated.private static intTOKEN_SCRIPTDeprecated.private static intTOKEN_TAGDeprecated.private static intTOKEN_TEXTDeprecated.private static intXML_HASHDeprecated.private static intXMP_HASHDeprecated.
-
Constructor Summary
Constructors Constructor Description FastPageParser()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private FastPageinternalParse(Reader reader)Deprecated.Pageparse(char[] data)Deprecated.This builds a Page.Pageparse(Reader reader)Deprecated.private static FastPageParser.TagparseProperties(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.TagparseTag(FastPageParser.Tag tag, CharArray buf)Deprecated.Populates aFastPageParser.Tagobject using data from the suppliedCharArray.private static booleanshouldWriteToHead(int state, int laststate)Deprecated.private static voidwriteTag(int state, int laststate, boolean hide, CharArray _head, CharArray _buffer, CharArray _body)Deprecated.
-
-
-
Field Detail
-
TOKEN_NONE
private static final int TOKEN_NONE
Deprecated.- See Also:
- Constant Field Values
-
TOKEN_EOF
private static final int TOKEN_EOF
Deprecated.- See Also:
- Constant Field Values
-
TOKEN_TEXT
private static final int TOKEN_TEXT
Deprecated.- See Also:
- Constant Field Values
-
TOKEN_TAG
private static final int TOKEN_TAG
Deprecated.- See Also:
- Constant Field Values
-
TOKEN_COMMENT
private static final int TOKEN_COMMENT
Deprecated.- See Also:
- Constant Field Values
-
TOKEN_CDATA
private static final int TOKEN_CDATA
Deprecated.- See Also:
- Constant Field Values
-
TOKEN_SCRIPT
private static final int TOKEN_SCRIPT
Deprecated.- See Also:
- Constant Field Values
-
TOKEN_DOCTYPE
private static final int TOKEN_DOCTYPE
Deprecated.- See Also:
- Constant Field Values
-
TOKEN_EMPTYTAG
private static final int TOKEN_EMPTYTAG
Deprecated.- See Also:
- Constant Field Values
-
STATE_EOF
private static final int STATE_EOF
Deprecated.- See Also:
- Constant Field Values
-
STATE_TEXT
private static final int STATE_TEXT
Deprecated.- See Also:
- Constant Field Values
-
STATE_TAG
private static final int STATE_TAG
Deprecated.- See Also:
- Constant Field Values
-
STATE_COMMENT
private static final int STATE_COMMENT
Deprecated.- See Also:
- Constant Field Values
-
STATE_TAG_QUOTE
private static final int STATE_TAG_QUOTE
Deprecated.- See Also:
- Constant Field Values
-
STATE_CDATA
private static final int STATE_CDATA
Deprecated.- See Also:
- Constant Field Values
-
STATE_SCRIPT
private static final int STATE_SCRIPT
Deprecated.- See Also:
- Constant Field Values
-
STATE_DOCTYPE
private static final int STATE_DOCTYPE
Deprecated.- See Also:
- Constant Field Values
-
TAG_STATE_NONE
private static final int TAG_STATE_NONE
Deprecated.- See Also:
- Constant Field Values
-
TAG_STATE_HTML
private static final int TAG_STATE_HTML
Deprecated.- See Also:
- Constant Field Values
-
TAG_STATE_HEAD
private static final int TAG_STATE_HEAD
Deprecated.- See Also:
- Constant Field Values
-
TAG_STATE_TITLE
private static final int TAG_STATE_TITLE
Deprecated.- See Also:
- Constant Field Values
-
TAG_STATE_BODY
private static final int TAG_STATE_BODY
Deprecated.- See Also:
- Constant Field Values
-
TAG_STATE_XML
private static final int TAG_STATE_XML
Deprecated.- See Also:
- Constant Field Values
-
TAG_STATE_XMP
private static final int TAG_STATE_XMP
Deprecated.- See Also:
- Constant Field Values
-
SLASH_XML_HASH
private static final int SLASH_XML_HASH
Deprecated.- See Also:
- Constant Field Values
-
XML_HASH
private static final int XML_HASH
Deprecated.- See Also:
- Constant Field Values
-
SLASH_XMP_HASH
private static final int SLASH_XMP_HASH
Deprecated.- See Also:
- Constant Field Values
-
XMP_HASH
private static final int XMP_HASH
Deprecated.- See Also:
- Constant Field Values
-
HTML_HASH
private static final int HTML_HASH
Deprecated.- See Also:
- Constant Field Values
-
SLASH_HTML_HASH
private static final int SLASH_HTML_HASH
Deprecated.- See Also:
- Constant Field Values
-
HEAD_HASH
private static final int HEAD_HASH
Deprecated.- See Also:
- Constant Field Values
-
TITLE_HASH
private static final int TITLE_HASH
Deprecated.- See Also:
- Constant Field Values
-
SLASH_TITLE_HASH
private static final int SLASH_TITLE_HASH
Deprecated.- See Also:
- Constant Field Values
-
PARAMETER_HASH
private static final int PARAMETER_HASH
Deprecated.- See Also:
- Constant Field Values
-
META_HASH
private static final int META_HASH
Deprecated.- See Also:
- Constant Field Values
-
SLASH_HEAD_HASH
private static final int SLASH_HEAD_HASH
Deprecated.- See Also:
- Constant Field Values
-
FRAMESET_HASH
private static final int FRAMESET_HASH
Deprecated.- See Also:
- Constant Field Values
-
FRAME_HASH
private static final int FRAME_HASH
Deprecated.- See Also:
- Constant Field Values
-
BODY_HASH
private static final int BODY_HASH
Deprecated.- See Also:
- Constant Field Values
-
SLASH_BODY_HASH
private static final int SLASH_BODY_HASH
Deprecated.- See Also:
- Constant Field Values
-
CONTENT_HASH
private static final int CONTENT_HASH
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
parse
public Page parse(char[] data) throws IOException
Deprecated.Description copied from interface:PageParserThis builds a Page.- Specified by:
parsein interfacePageParser- Throws:
IOException
-
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
private FastPageParser.Tag parseTag(FastPageParser.Tag tag, CharArray buf)
Deprecated.Populates aFastPageParser.Tagobject 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
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. 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.
-
-