br.com.arsmachina.tapestrycrud.module
Class DefaultTapestryCrudModule

java.lang.Object
  extended by br.com.arsmachina.module.AbstractModule
      extended by br.com.arsmachina.tapestrycrud.module.DefaultTapestryCrudModule
All Implemented Interfaces:
TapestryCrudModule

public class DefaultTapestryCrudModule
extends br.com.arsmachina.module.AbstractModule
implements TapestryCrudModule

Default TapestryCrudModule implementation.

Author:
Thiago H. de Paula Figueiredo

Constructor Summary
DefaultTapestryCrudModule(String name, String rootPackage, ClassNameLocator classNameLocator, String daoImplementationSubpackage)
          Single constructor of this class.
 
Method Summary
<T> Class<? extends ActivationContextEncoder<T>>
getActivationContextEncoderClass(Class<T> entityClass)
          Returns the activation context encoder class corresponding to a given entity class.
protected  String getActivationContextEncoderClassName(Class<?> entityClass)
          Returns the fully-qualified name of the activation context encoder for a given entity class.
<T> Class<? extends Encoder<T,?>>
getEncoderClass(Class<T> entityClass)
          Returns the encoder class corresponding to a given entity class.
protected  String getEncoderClassName(Class<?> entityClass)
          Returns the fully-qualified name of the encoder for a given entity class.
<T> Class<? extends LabelEncoder<T>>
getLabelEncoderClass(Class<T> entityClass)
          Returns the label encoder class corresponding to a given entity class.
protected  String getLabelEncoderClassName(Class<?> entityClass)
          Returns the fully-qualified name of the label encoder for a given entity class.
<T> Class<? extends PrimaryKeyEncoder<?,T>>
getPrimaryKeyEncoderClass(Class<T> entityClass)
          Returns the label encoder class corresponding to a given entity class.
protected  String getPrimaryKeyEncoderClassName(Class<?> entityClass)
          Returns the fully-qualified name of the primary key encoder for a given entity class.
 String toString()
           
 
Methods inherited from class br.com.arsmachina.module.AbstractModule
getClass, getClass, getClassNameLocator, getName, getRootPackage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface br.com.arsmachina.tapestrycrud.module.TapestryCrudModule
getName
 

Constructor Detail

DefaultTapestryCrudModule

public DefaultTapestryCrudModule(String name,
                                 String rootPackage,
                                 ClassNameLocator classNameLocator,
                                 String daoImplementationSubpackage)
Single constructor of this class.

Parameters:
name - a String containing the module name. It cannot be null.
rootPackage - a String containing the module parent package. It cannot be null.
classNameLocator - a ClassNameLocator. It cannot be null.
daoImplementationSubpackage - a String. It cannot be null.
Method Detail

getActivationContextEncoderClass

public <T> Class<? extends ActivationContextEncoder<T>> getActivationContextEncoderClass(Class<T> entityClass)
Description copied from interface: TapestryCrudModule
Returns the activation context encoder class corresponding to a given entity class.

Specified by:
getActivationContextEncoderClass in interface TapestryCrudModule
Type Parameters:
T - the entity type.
Parameters:
entityClass - a Class instance. It cannot be null.
Returns:
an ActivationContextEncoder or null (if no corresponding one is found).

getEncoderClass

public <T> Class<? extends Encoder<T,?>> getEncoderClass(Class<T> entityClass)
Description copied from interface: TapestryCrudModule
Returns the encoder class corresponding to a given entity class.

Specified by:
getEncoderClass in interface TapestryCrudModule
Type Parameters:
T - the entity type.
Parameters:
entityClass - a Class instance. It cannot be null.
Returns:
an Encoder or null (if no corresponding one is found).

getLabelEncoderClass

public <T> Class<? extends LabelEncoder<T>> getLabelEncoderClass(Class<T> entityClass)
Description copied from interface: TapestryCrudModule
Returns the label encoder class corresponding to a given entity class.

Specified by:
getLabelEncoderClass in interface TapestryCrudModule
Type Parameters:
T - the entity type.
Parameters:
entityClass - a Class instance. It cannot be null.
Returns:
a LabelEncoder or null (if no corresponding one is found).

getPrimaryKeyEncoderClass

public <T> Class<? extends PrimaryKeyEncoder<?,T>> getPrimaryKeyEncoderClass(Class<T> entityClass)
Description copied from interface: TapestryCrudModule
Returns the label encoder class corresponding to a given entity class.

Specified by:
getPrimaryKeyEncoderClass in interface TapestryCrudModule
Type Parameters:
T - the entity type.
Parameters:
entityClass - a Class instance. It cannot be null.
Returns:
a PrimaryKeyEncoder or null (if no corresponding one is found).

getActivationContextEncoderClassName

protected String getActivationContextEncoderClassName(Class<?> entityClass)
Returns the fully-qualified name of the activation context encoder for a given entity class.

Parameters:
clasz - a Class. It cannot be null.
Returns:
a String or null (if no corresponding one is found).

getEncoderClassName

protected String getEncoderClassName(Class<?> entityClass)
Returns the fully-qualified name of the encoder for a given entity class.

Parameters:
clasz - a Class. It cannot be null.
Returns:
a String or null (if no corresponding one is found).

getLabelEncoderClassName

protected String getLabelEncoderClassName(Class<?> entityClass)
Returns the fully-qualified name of the label encoder for a given entity class.

Parameters:
clasz - a Class. It cannot be null.
Returns:
a String or null (if no corresponding one is found).

getPrimaryKeyEncoderClassName

protected String getPrimaryKeyEncoderClassName(Class<?> entityClass)
Returns the fully-qualified name of the primary key encoder for a given entity class.

Parameters:
clasz - a Class. It cannot be null.
Returns:
a String or null (if no corresponding one is found).

toString

public String toString()
Overrides:
toString in class br.com.arsmachina.module.AbstractModule


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