com.ivata.mask.web.tag.format
Class FormatTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended bycom.ivata.mask.web.tag.format.FormatTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class FormatTag
extends javax.servlet.jsp.tagext.BodyTagSupport

This class wraps the HTMLFormatter class, so that you can call HTMLFormatter.format as a JSP tag.

Tag attributes:

attribute reqd. param. class description
formatter false com.ivata.html.format.HTMLFormatter Sets the formatter which actually does the formatting.

Since:
2002-06-20
Version:
$Revision: 1.2 $
Author:
Colin MacLeod colin.macleod@ivata.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
FormatTag()
           
 
Method Summary
 int doAfterBody()
          Here the contents of the tag are formatted using the HTMLFormatter provided.
 int doStartTag()
          This method is called when the JSP engine encounters the start tag, after the attributes are processed.
 void setFormatter(HTMLFormatter formatterParam)
          Set the HTMLFormatter object which actually does all the hard work.
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doEndTag, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

FormatTag

public FormatTag()
Method Detail

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException

Here the contents of the tag are formatted using the HTMLFormatter provided.

This method is called after the JSP engine processes the body content of the tag.

Returns:
SKIP_BODY since the JSP engine should not evaluate the tag body again.
Throws:
javax.servlet.jsp.JspException - encapsulates any exception when calling out.println. writeTagBodyContent}.

doStartTag

public int doStartTag()

This method is called when the JSP engine encounters the start tag, after the attributes are processed.

Scripting variables (if any) have their values set here.

Returns:
EVAL_BODY_BUFFERED since the body is always evaluated once.

setFormatter

public void setFormatter(HTMLFormatter formatterParam)

Set the HTMLFormatter object which actually does all the hard work. We just wrap HTMLFormatter.format in a JSP tag.

Parameters:
formatterParam - HTMLFormatter used to format the tag body.


Copyright © 2001-2005 ivata limited. All Rights Reserved.