org.mmbase.bridge.jsp.taglib
Class WriterHelper

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

public class WriterHelper
extends 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.85 2006/07/08 16:43:35 michiel Exp $
Author:
Michiel Meeuwissen

Field Summary
static boolean IMPLICITLIST
           
static boolean NOIMPLICITLIST
           
static String STACK_ATTRIBUTE
           
static int TYPE_STRING
           
 
Constructor Summary
WriterHelper(ContextReferrerTag tag)
           
 
Method Summary
 int doAfterBody()
           
 int doEndTag()
          A basic doEndTag for Writers.
 String getEscape()
          Gets specified escaper (as a string) or null (if not set)
 CharTransformer getEscaper()
           
 String getJspvar()
           
protected  Writer getPageString(Writer w)
          Returns a string which can be written to the page.
 String getString()
           
 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 setEscape(Attribute e)
          For implementation of the escape attribute.
 void setJspvar(PageContext p)
          Deprecated. jspvar will be set by setValue then
 void setJspvar(String j)
           
 void setListdelimiter(Attribute l)
           
 void setValue(Object v)
          Sets the vartype for this variable (used for jspvar as well as for taglib var).
 void setValue(Object v, boolean noImplicitList)
           
 void setValueOnly(Object v, boolean noImplicitList)
          Sets only the value in the helper, withouth setting the _Stack
 void setVartype(String t)
           
 void setWrite(Attribute w)
          For implementation of the write attribute.
 void setWrite(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 final boolean NOIMPLICITLIST
See Also:
Constant Field Values

IMPLICITLIST

public static final boolean IMPLICITLIST
See Also:
Constant Field Values

STACK_ATTRIBUTE

public static final String STACK_ATTRIBUTE
See Also:
Constant Field Values

TYPE_STRING

public static final int TYPE_STRING
See Also:
Constant Field Values
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

setWrite

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


overrideNoImplicitList

public void overrideNoImplicitList()

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 JspTagException
Throws:
JspTagException

setJspvar

public void setJspvar(String j)

setJspvar

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

Throws:
JspTagException

getJspvar

public String getJspvar()

setValue

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

Throws:
JspTagException

getEscape

public String getEscape()
                 throws JspTagException
Gets specified escaper (as a string) or null (if not set)

Throws:
JspTagException
Since:
MMBase-1.7

getEscaper

public CharTransformer getEscaper()
                           throws JspTagException
Throws:
JspTagException
Since:
MMBase-1.8

setValueOnly

public void setValueOnly(Object v,
                         boolean noImplicitList)
                  throws JspTagException
Sets only the value in the helper, withouth setting the _Stack

Throws:
JspTagException
Since:
MMBase-1.8

setValue

public void setValue(Object v,
                     boolean noImplicitList)
              throws JspTagException
Throws:
JspTagException

getValue

public Object getValue()

setVartype

public void setVartype(String t)
                throws JspTagException
Throws:
JspTagException

setListdelimiter

public final void setListdelimiter(Attribute l)
Since:
MMBase-1.8

getVartype

public int getVartype()

getPageString

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

Throws:
JspTagException
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 String getString()

doAfterBody

public int doAfterBody()
                throws JspTagException
Throws:
JspTagException
Since:
MMBase-1.7

doEndTag

public int doEndTag()
             throws JspTagException
A basic doEndTag for Writers. It decides if to write or not, and then does that or not. It also pops the _-stack, and releases the members for gc.

Throws:
JspTagException

release

public void release()


MMBase build 1.8.1.20060716