br.com.arsmachina.tapestrycrud.base
Class BasePage<T,K extends Serializable>

java.lang.Object
  extended by br.com.arsmachina.tapestrycrud.base.BasePage<T,K>
Type Parameters:
T - the entity class related to this encoder.
K - the type of the class' primary key property.
All Implemented Interfaces:
CrudPage<T,K>
Direct Known Subclasses:
BaseEditPage, BaseListPage

public abstract class BasePage<T,K extends Serializable>
extends Object
implements CrudPage<T,K>

Class that implements some common infrastructure for listing and editing pages. This class is not

Author:
Thiago H. de Paula Figueiredo

Constructor Summary
BasePage()
          Single constructor of this class.
 
Method Summary
protected  boolean filterReadOnlyComponentsInBeanModel()
          Used by #getBeanModel() to filter read only components or not.
protected
<V,X extends Serializable>
ActivationContextEncoder<V>
getActivationContextEncoder(Class<V> clasz)
          Returns the ActivationContextEncoder for a given class.
 br.com.arsmachina.controller.Controller<T,K> getController()
          Returns the value of the controller property.
 Class<T> getEntityClass()
          Returns the entity type.
 Zone getFormZone()
          Returns the Zone that surrounds the form.
protected
<V> LabelEncoder<V>
getLabelEncoder(Class<V> clasz)
          Returns the LabelEncoder for a given class.
 String getMessage()
          Returns the value of the message property.
 Messages getMessages()
          Returns the value of the messages property.
 Class<K> getPrimaryKeyClass()
          Returns the type of the entity's primary key field.
protected
<V,X extends Serializable>
PrimaryKeyEncoder<X,V>
getPrimaryKeyEncoder(Class<V> clasz)
          Returns the PrimaryKeyEncoder for a given class.
protected  SelectModelFactory getSelectModelFactory()
          Returns the value of the selectModelFactory property.
protected
<V> ValueEncoder<V>
getValueEncoder(Class<V> clasz)
          Returns the ValueEncoder for a given class.
protected  boolean returnZoneOnXHR()
          Used by #returnFromRemove() to know whether it must return a Zone or a Block.
 void setMessage(String message)
          Changes the value of the message property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePage

public BasePage()
Single constructor of this class.

Method Detail

filterReadOnlyComponentsInBeanModel

protected boolean filterReadOnlyComponentsInBeanModel()
Used by #getBeanModel() to filter read only components or not. This implementation returns true.

Returns:
a boolean.

getValueEncoder

protected <V> ValueEncoder<V> getValueEncoder(Class<V> clasz)
Returns the ValueEncoder for a given class.

Type Parameters:
V - the class.
Parameters:
clasz - a Class;
Returns:
a ValueEncoder.

getLabelEncoder

protected <V> LabelEncoder<V> getLabelEncoder(Class<V> clasz)
Returns the LabelEncoder for a given class.

Type Parameters:
V - the class.
Parameters:
clasz - a Class;
Returns:
a LabelEncoder.

getActivationContextEncoder

protected <V,X extends Serializable> ActivationContextEncoder<V> getActivationContextEncoder(Class<V> clasz)
Returns the ActivationContextEncoder for a given class.

Type Parameters:
V - the class.
Parameters:
clasz - a Class;
Returns:
an ActivationContextEncoder.

getPrimaryKeyEncoder

protected <V,X extends Serializable> PrimaryKeyEncoder<X,V> getPrimaryKeyEncoder(Class<V> clasz)
Returns the PrimaryKeyEncoder for a given class.

Type Parameters:
V - the class.
X - the class' primary key field type.
Parameters:
clasz - a Class;
Returns:
a PrimaryKeyEncoder.

getMessage

public String getMessage()
Description copied from interface: CrudPage
Returns the value of the message property.

Specified by:
getMessage in interface CrudPage<T,K extends Serializable>
Returns:
a String.
See Also:
CrudPage.getMessage()

setMessage

public void setMessage(String message)
Description copied from interface: CrudPage
Changes the value of the message property.

Specified by:
setMessage in interface CrudPage<T,K extends Serializable>
Parameters:
message - a String.
See Also:
CrudPage.setMessage(java.lang.String)

getController

public final br.com.arsmachina.controller.Controller<T,K> getController()
Returns the value of the controller property.

Returns:
a Controller.

getEntityClass

public final Class<T> getEntityClass()
Description copied from interface: CrudPage
Returns the entity type.

Specified by:
getEntityClass in interface CrudPage<T,K extends Serializable>
Returns:
a Class.

getPrimaryKeyClass

public final Class<K> getPrimaryKeyClass()
Description copied from interface: CrudPage
Returns the type of the entity's primary key field.

Specified by:
getPrimaryKeyClass in interface CrudPage<T,K extends Serializable>
Returns:
a Class.

getMessages

public final Messages getMessages()
Returns the value of the messages property.

Returns:
a Messages.

getFormZone

public Zone getFormZone()
Returns the Zone that surrounds the form.

Returns:
a Zone.

returnZoneOnXHR

protected boolean returnZoneOnXHR()
Used by #returnFromRemove() to know whether it must return a Zone or a Block. This implementation returns true.

Returns:
a boolean.

getSelectModelFactory

protected final SelectModelFactory getSelectModelFactory()
Returns the value of the selectModelFactory property.

Returns:
a SelectModelFactory.


Copyright © 2008-2009 Thiago H. de Paula Figueiredo. All Rights Reserved.