EchoPoint
1.0

echopoint.ui.template.taghandlers
Class HtmlBodyCssStripper

java.lang.Object
  extended byechopoint.ui.template.taghandlers.HtmlBodyCssStripper
All Implemented Interfaces:
java.io.Serializable, TagHandler

public class HtmlBodyCssStripper
extends java.lang.Object
implements TagHandler, java.io.Serializable

The HtmlBodyCssStripper tag handler removes all traces of the HTML and BODY tags during parsing. This allows full HTML files to be included as fragments into further enclosing HTML. This handler will extract CSS links (via LINK tags), META tags and also STYLE tags and place them into the TemplateParseContext. This fix up allows for CSS support that were otherwise wihtin the HTML section.

See Also:
Serialized Form

Constructor Summary
HtmlBodyCssStripper()
           
 
Method Summary
 void executeTag(ParseContext context, PositionReader input, boolean parseTime)
          Does not execution and hence no content is placed in these positions
 long getLineNumber()
          Returns the line number at which this tag handler was invoked.
 java.lang.String getNameProperty()
          Called to get the identification tag attribute property called "name".
 java.util.Map getProperties()
          Called to get a Map of tag attribute properties and their values.
 long getTagLength()
          Get the length of the area in the sourcefile.
 long getTagStart()
          Get start position of the area in the sourcefile this handler processes.
 SGMLTag parseTag(CompilationContext context, PositionReader input, long startPosition, SGMLTag startTag)
          Parse the HTML, BODY tag or both.
 void postParsePostProperties(CompilationContext context)
          This method is called after the tag has been compiled and AFTER any tag properties have been processed.
 void postParsePreProperties(CompilationContext context)
          This method is called after the tag has been compiled but BEFORE any tag properties have been processed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlBodyCssStripper

public HtmlBodyCssStripper()
Method Detail

executeTag

public void executeTag(ParseContext context,
                       PositionReader input,
                       boolean parseTime)
                throws java.lang.Exception
Does not execution and hence no content is placed in these positions

Specified by:
executeTag in interface TagHandler
Throws:
java.lang.Exception - anything can happen .. and throw an Exception which is caught in PageParser

getTagLength

public long getTagLength()
Get the length of the area in the sourcefile. The area this handler processes is skipped in the inputfile.

Specified by:
getTagLength in interface TagHandler

getTagStart

public long getTagStart()
Get start position of the area in the sourcefile this handler processes.

Specified by:
getTagStart in interface TagHandler

parseTag

public SGMLTag parseTag(CompilationContext context,
                        PositionReader input,
                        long startPosition,
                        SGMLTag startTag)
                 throws java.io.IOException
Parse the HTML, BODY tag or both.

Specified by:
parseTag in interface TagHandler
Parameters:
context - The CompilationContext involved
input - The PositionReader, located after the Name token of the Tag
startPosition - The Position parsing of this token began
startTag - the SGMLTag found in the file.
Throws:
java.io.IOException

getProperties

public java.util.Map getProperties()
Description copied from interface: TagHandler
Called to get a Map of tag attribute properties and their values. The keys of the of the map are expected to be the tag attribute property names and the values are expected top be the tag attribute property values.

Specified by:
getProperties in interface TagHandler
See Also:
TagHandler.getProperties()

getNameProperty

public java.lang.String getNameProperty()
Description copied from interface: TagHandler
Called to get the identification tag attribute property called "name". This may not be present and hence this method could return null.

Specified by:
getNameProperty in interface TagHandler
See Also:
TagHandler.getNameProperty()

getLineNumber

public long getLineNumber()
Description copied from interface: TagHandler
Returns the line number at which this tag handler was invoked. This can be obtained from the PositionReader at parse time.

Specified by:
getLineNumber in interface TagHandler
Returns:
the line number at which this tag handler was invoked
See Also:
TagHandler.getLineNumber()

postParsePreProperties

public void postParsePreProperties(CompilationContext context)
Description copied from interface: TagHandler
This method is called after the tag has been compiled but BEFORE any tag properties have been processed. This allows the tag handler to do some things before actual (and potentially repeated) execution.

Specified by:
postParsePreProperties in interface TagHandler
Parameters:
context - The CompilationContext involved
See Also:
TagHandler.postParsePreProperties(CompilationContext)

postParsePostProperties

public void postParsePostProperties(CompilationContext context)
Description copied from interface: TagHandler
This method is called after the tag has been compiled and AFTER any tag properties have been processed. This allows the tag handler to do some things before actual (and potentially repeated) execution.

Specified by:
postParsePostProperties in interface TagHandler
Parameters:
context - The CompilationContext involved
See Also:
TagHandler.postParsePostProperties(echopoint.template.CompilationContext)

EchoPoint
1.0