org.mmbase.bridge.jsp.taglib
Class WriterHelper

java.lang.Object
  extended byorg.mmbase.bridge.jsp.taglib.WriterHelper

public class WriterHelper
extends java.lang.Object

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.2.6 2005/06/15 15:46:43 rob Exp $
Author:
Michiel Meeuwissen

Field Summary
static boolean IMPLICITLIST
           
static boolean NOIMPLICITLIST
           
 
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 overrideNoImplicitList()
           
 void overrideWrite(boolean w)
          There is a default behavior for what should happen if the 'write' attribute is not set.
 void release()
           
 void setBodyContent(javax.servlet.jsp.tagext.BodyContent bc)
          Deprecated. body-content is requested from thisTag
 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 setPageContext(javax.servlet.jsp.PageContext pc)
          Deprecated. page-context is requested from thisTag
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


overrideNoImplicitList

public void overrideNoImplicitList()

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

setBodyContent

public void setBodyContent(javax.servlet.jsp.tagext.BodyContent bc)
Deprecated. body-content is requested from thisTag


setPageContext

public void setPageContext(javax.servlet.jsp.PageContext pc)
Deprecated. page-context is requested from thisTag


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.4.20050922