org.japano
Class View

java.lang.Object
  extended by org.japano.View
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class View
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Holds the URI and the attributes and messages for the current view. The view itself is generated by the JSP compiler.

Version:
$Id: View.java,v 1.9 2005/11/26 01:47:32 fforw Exp $ SourceForge.net Logo
Author:
Sven Helmberger ( sven dot helmberger at gmx dot de )
See Also:
Serialized Form

Nested Class Summary
static class View.Message
          A Message that can be added to a view.
 
Constructor Summary
View(java.lang.String URI)
           
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.Object value)
          Adds an attribute to this view.
 void addMessage(java.lang.Class actionClass, java.lang.String paramName, java.lang.String message, java.lang.String fieldId)
          Adds a new message to the view which can be display with the MessageList tag.
 java.util.Map attributes()
          Returns a copy of this view's attributes.
 void clearMessages()
           
 java.lang.Object clone()
           
 java.lang.String getURI()
           
 java.util.List messages()
          Returns an iterator over all messages.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

View

public View(java.lang.String URI)
Method Detail

getURI

public java.lang.String getURI()

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.Object value)
Adds an attribute to this view.

Parameters:
name - name of the attribute
value - attribute value.

attributes

public java.util.Map attributes()
Returns a copy of this view's attributes.

Returns:
copy of attributes

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.

addMessage

public void addMessage(java.lang.Class actionClass,
                       java.lang.String paramName,
                       java.lang.String message,
                       java.lang.String fieldId)
Adds a new message to the view which can be display with the MessageList tag.


messages

public java.util.List messages()
Returns an iterator over all messages. Must be invoked inside a block which is synchronized on the view to be thread safe.

Returns:
iterator returning View.Message elements.

clearMessages

public void clearMessages()

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object