org.mmbase.bridge.jsp.taglib
Class WriterHelper

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.mmbase.bridge.jsp.taglib.WriterHelper
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

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

Tags that are Writers can use the this class. It's a pitty that they can't extend, but that's life.

Version:
$Id: WriterHelper.java,v 1.47 2004/03/23 21:42:46 michiel Exp $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
static boolean IMPLICITLIST
           
static boolean NOIMPLICITLIST
           
 
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
WriterHelper(ContextReferrerTag tag)
           
 
Method Summary
 int doAfterBody()
          Sets the bodycontent (to be used in doEndTag)
 int doEndTag()
          A basic doEndTag for Writers.
 java.lang.String getEscape()
          Gets specified escaper (as a string) or null (if not set)
 java.lang.String getJspvar()
           
protected  java.io.Writer getPageString(java.io.Writer w)
          Returns a string which can be written to the page.
 java.lang.String getString()
           
 java.lang.Object getValue()
           
 int getVartype()
           
 Attribute getWrite()
           
 void haveBody()
          To be called by subtags.
 boolean isWrite()
           
 void overrideWrite(boolean w)
          There is a default behavior for what should happen if the 'write' attribute is not set.
 void release()
           
 void setEscape(Attribute e)
          For implementation of the escape attribute.
 void setJspvar(javax.servlet.jsp.PageContext p)
          Deprecated. jspvar will be set by setValue then
 void setJspvar(java.lang.String j)
           
 void setValue(java.lang.Object v)
          Sets the vartype for this variable (used for jspvar as well as for taglib var).
 void setValue(java.lang.Object v, boolean noImplicitList)
           
 void setVartype(java.lang.String t)
           
 void setWrite(Attribute w)
          For implementation of the write attribute.
 void setWrite(java.lang.Boolean b)
          Deprecated. Use setWrite(Attribute)
 void useEscaper(boolean ue)
          Some writer tags produce very specific content, and take care of escaping themselves (UrlTag).
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, doStartTag, 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

NOIMPLICITLIST

public static boolean NOIMPLICITLIST

IMPLICITLIST

public static boolean IMPLICITLIST
Constructor Detail

WriterHelper

public WriterHelper(ContextReferrerTag tag)
Method Detail

setWrite

public void setWrite(Attribute w)
For implementation of the write attribute.


getWrite

public Attribute getWrite()
Since:
MMBase-1.7

setEscape

public void setEscape(Attribute e)
For implementation of the escape attribute.

Since:
MMBase-1.7

getEscape

public java.lang.String getEscape()
                           throws javax.servlet.jsp.JspTagException
Gets specified escaper (as a string) or null (if not set)

Throws:
javax.servlet.jsp.JspTagException
Since:
MMBase-1.7

setWrite

public void setWrite(java.lang.Boolean b)
Deprecated. Use setWrite(Attribute)


overrideWrite

public void overrideWrite(boolean w)
There is a default behavior for what should happen if the 'write' attribute is not set. if you want to override this, then call this function.


useEscaper

public void useEscaper(boolean ue)
Some writer tags produce very specific content, and take care of escaping themselves (UrlTag). They turn off escaping (on default).


isWrite

public boolean isWrite()
                throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

setJspvar

public void setJspvar(java.lang.String j)

setJspvar

public void setJspvar(javax.servlet.jsp.PageContext p)
               throws javax.servlet.jsp.JspTagException
Deprecated. jspvar will be set by setValue then

Throws:
javax.servlet.jsp.JspTagException

getJspvar

public java.lang.String getJspvar()

setValue

public void setValue(java.lang.Object v)
              throws javax.servlet.jsp.JspTagException
Sets the vartype for this variable (used for jspvar as well as for taglib var). Some 'casting' functionality is present here.

Throws:
javax.servlet.jsp.JspTagException

setValue

public void setValue(java.lang.Object v,
                     boolean noImplicitList)
              throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

getValue

public java.lang.Object getValue()

setVartype

public void setVartype(java.lang.String t)
                throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

getVartype

public int getVartype()

getPageString

protected java.io.Writer getPageString(java.io.Writer w)
                                throws javax.servlet.jsp.JspTagException,
                                       java.io.IOException
Returns a string which can be written to the page.

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

haveBody

public void haveBody()
To be called by subtags. Even if they don't produce output, they say that the tag had a body.


getString

public java.lang.String getString()

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Sets the bodycontent (to be used in doEndTag)

Throws:
javax.servlet.jsp.JspException
Since:
MMBase-1.7

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspTagException
A basic doEndTag for Writers. It decides if to write or not.

Throws:
javax.servlet.jsp.JspTagException

release

public void release()


MMBase build 1.7.1.20041002