org.apache.taglibs.io
Class TransformerTagSupport

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.taglibs.io.AbstractBodyTag
              extended by org.apache.taglibs.io.TransformerTagSupport
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag, PipeConsumer
Direct Known Subclasses:
PipeTag

public abstract class TransformerTagSupport
extends AbstractBodyTag
implements PipeConsumer

An abstract base class for a text based transformation tags which take some input and produces some output. Both input and output can be specified via attributes and scriplet expressions or via contained 'pipeline aware' tags.

Version:
$Revision$
Author:
James Strachan
See Also:
Serialized Form

Field Summary
protected static boolean CLOSE_READER
           
 
Fields inherited from class org.apache.taglibs.io.AbstractBodyTag
TRACE, WARN
 
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
TransformerTagSupport()
           
 
Method Summary
 int doAfterBody()
           
 int doStartTag()
           
protected  PipeConsumer getConsumer()
           
 void release()
           
 void setReader(java.io.Reader reader)
           
 void setWriter(java.io.Writer writer)
           
protected abstract  void transform(java.io.Reader reader, java.io.Writer writer)
          Perform some arbitrary transformation
 
Methods inherited from class org.apache.taglibs.io.AbstractBodyTag
handleException, warn, warn
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doEndTag, doInitBody, getBodyContent, getPreviousOut, 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
 

Field Detail

CLOSE_READER

protected static final boolean CLOSE_READER
See Also:
Constant Field Values
Constructor Detail

TransformerTagSupport

public TransformerTagSupport()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.BodyTagSupport

setReader

public void setReader(java.io.Reader reader)
Specified by:
setReader in interface PipeConsumer

setWriter

public void setWriter(java.io.Writer writer)

getConsumer

protected PipeConsumer getConsumer()

transform

protected abstract void transform(java.io.Reader reader,
                                  java.io.Writer writer)
                           throws java.io.IOException,
                                  javax.servlet.jsp.JspException
Perform some arbitrary transformation

Throws:
java.io.IOException
javax.servlet.jsp.JspException


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.