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
  • Field Details

  • Constructor Details

    • FastPageParser

      public FastPageParser()
      Deprecated.
  • Method Details

    • parse

      public Page parse(char[] data) throws IOException
      Deprecated.
      Description copied from interface: PageParser
      This builds a Page.
      Specified by:
      parse in interface PageParser
      Throws:
      IOException
    • parse

      public Page parse(Reader reader)
      Deprecated.
    • internalParse

      private FastPage internalParse(Reader reader)
      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

      private FastPageParser.Tag parseTag(FastPageParser.Tag tag, CharArray buf)
      Deprecated.
      Populates a FastPageParser.Tag object using data from the supplied CharArray. 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 to parseTag(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.