org.apache.tapestry.valid
Class RenderString

java.lang.Object
  extended byorg.apache.tapestry.valid.RenderString
All Implemented Interfaces:
IRender, java.io.Serializable

public class RenderString
extends java.lang.Object
implements IRender, java.io.Serializable

A wrapper around String that allows the String to be renderred. This is primarily used to present error messages.

Author:
Howard Lewis Ship
See Also:
Serialized Form

Constructor Summary
RenderString(java.lang.String string)
           
RenderString(java.lang.String string, boolean raw)
           
 
Method Summary
 java.lang.String getString()
           
 boolean isRaw()
           
 void render(IMarkupWriter writer, IRequestCycle cycle)
          Renders the String to the writer.
 java.lang.String toString()
          Returns the string that would be rendered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RenderString

public RenderString(java.lang.String string)

RenderString

public RenderString(java.lang.String string,
                    boolean raw)
Parameters:
string - the string to render
raw - if true, the String is rendered as-is, with no filtering. If false (the default), the String is filtered.
Method Detail

render

public void render(IMarkupWriter writer,
                   IRequestCycle cycle)
Renders the String to the writer. Does nothing if the string is null. If raw is true, uses IMarkupWriter.printRaw(String), otherwise IMarkupWriter.print(String).

Specified by:
render in interface IRender

getString

public java.lang.String getString()

isRaw

public boolean isRaw()

toString

public java.lang.String toString()
Returns the string that would be rendered. This is part of the contract for error renderers used with validation ... must provide a user-presentable toString() that does not include any markup.