br.com.arsmachina.tapestrycrud.ioc
Class TapestryCrudIoCModule

java.lang.Object
  extended by br.com.arsmachina.tapestrycrud.ioc.TapestryCrudIoCModule

public class TapestryCrudIoCModule
extends Object

Tapestry-IoC module for Tapestry CRUD.

Author:
Thiago H. de Paula Figueiredo

Field Summary
static String TAPESTRY_CRUD_ASSET_PREFIX
          Path under with the Tapestry CRUDs assets will be accessed.
static String TAPESTRY_CRUD_COMPONENT_PREFIX
          Tapestry CRUD component prefix.
static String TAPESTRY_CRUD_VERSION
          Tapestry CRUD version.
 
Constructor Summary
TapestryCrudIoCModule()
           
 
Method Summary
static ActivationContextEncoderSource buildActivationContextEncoderSource(Map<Class,ActivationContextEncoder> contributions, EncoderSource encoderSource, PrimaryKeyEncoderSource primaryKeyEncoderSource, PrimaryKeyTypeService primaryKeyTypeService)
          Builds the ActivationContextEncoderSource service.
static EncoderSource buildEncoderSource(Map<Class,Encoder> contributions)
          Builds the EncoderSource service.
static LabelEncoderSource buildLabelEncoderSource(Map<Class,LabelEncoder> contributions, EncoderSource encoderSource)
          Builds the LabelSource service.
 PrimaryKeyEncoderFactory buildPrimaryKeyEncoderFactory(List<PrimaryKeyEncoderFactory> contributions, ChainBuilder chainBuilder)
          Builds the PrimaryKeyEncoderFactory service.
static PrimaryKeyEncoderSource buildPrimaryKeyEncoderSource(Map<Class,PrimaryKeyEncoder> contributions, EncoderSource encoderSource, PrimaryKeyEncoderFactory primaryKeyEncoderFactory)
          Builds the PrimaryKeyEncoderSource service.
 PrimaryKeyTypeService buildPrimaryKeyTypeService(List<PrimaryKeyTypeService> contributions, ChainBuilder chainBuilder)
          Builds the DefaultLabelEncoderFactory service.
static SelectModelFactory buildSelectModelFactory(Map<Class,SingleTypeSelectModelFactory> contributions)
          Builds the SelectModelFactory service.
static TapestryCrudModuleService buildTapestryCrudModuleService(Collection<TapestryCrudModule> contributions)
          Builds the ModuleService service.
static void contributeActivationContextEncoderSource(MappedConfiguration<Class,ActivationContextEncoder> contributions, br.com.arsmachina.module.service.EntitySource entitySource, br.com.arsmachina.module.service.ModuleService moduleService, TapestryCrudModuleService tapestryCrudModuleService, ObjectLocator objectLocator)
          Associates entity classes with their Controllers.
static void contributeClasspathAssetAliasManager(MappedConfiguration<String,String> configuration)
           
static void contributeComponentClassResolver(Configuration<LibraryMapping> configuration)
          Contributes the Tapestry CRUD components under the crud prefix.
static void contributeEncoderSource(MappedConfiguration<Class,Encoder> contributions, br.com.arsmachina.module.service.EntitySource entitySource, br.com.arsmachina.module.service.ModuleService moduleService, TapestryCrudModuleService tapestryCrudModuleService, ObjectLocator objectLocator)
          Associates entity classes with their Encoders.
static void contributeLabelEncoderSource(MappedConfiguration<Class,LabelEncoder> contributions, br.com.arsmachina.module.service.EntitySource entitySource, br.com.arsmachina.module.service.ModuleService moduleService, TapestryCrudModuleService tapestryCrudModuleService, ObjectLocator objectLocator)
          Associates entity classes with their LabelEncoders.
static void contributeModuleService(Configuration<br.com.arsmachina.module.Module> configuration, ClassNameLocator classNameLocator, String tapestryRootPackage, String daoImplementationSubpackage)
          Contributes the main (default module) to the ModuleService service.
static void contributePrimaryKeyEncoderSource(MappedConfiguration<Class,PrimaryKeyEncoder> contributions, br.com.arsmachina.module.service.EntitySource entitySource, br.com.arsmachina.module.service.ModuleService moduleService, TapestryCrudModuleService tapestryCrudModuleService, ObjectLocator objectLocator)
          Associates entity classes with their PrimaryKeyEncoders.
static void contributeSelectModelFactory(MappedConfiguration<Class,SingleTypeSelectModelFactory> contributions, br.com.arsmachina.module.service.ControllerSource controllerSource, br.com.arsmachina.module.service.EntitySource entitySource, LabelEncoderSource labelEncoderSource)
          Associates entity classes with their SelectModels.
static void contributeTapestryCrudModuleService(Configuration<TapestryCrudModule> contributions, br.com.arsmachina.module.service.ModuleService moduleService, ClassNameLocator classNameLocator, String daoImplementationSubpackage)
          Builds the ModuleService service.
static void contributeValueEncoderSource(MappedConfiguration<Class,ValueEncoderFactory> configuration, EncoderSource encoderSource, br.com.arsmachina.module.service.EntitySource entitySource, PrimaryKeyEncoderSource primaryKeyEncoderSource, PrimaryKeyTypeService primaryKeyTypeService, TypeCoercer typeCoercer)
          Contributes all (Class, Encoder pairs registered in EncoderSource to ValueEncoderSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAPESTRY_CRUD_COMPONENT_PREFIX

public static final String TAPESTRY_CRUD_COMPONENT_PREFIX
Tapestry CRUD component prefix.

See Also:
Constant Field Values

TAPESTRY_CRUD_VERSION

public static final String TAPESTRY_CRUD_VERSION
Tapestry CRUD version.

See Also:
Constant Field Values

TAPESTRY_CRUD_ASSET_PREFIX

public static final String TAPESTRY_CRUD_ASSET_PREFIX
Path under with the Tapestry CRUDs assets will be accessed.

See Also:
Constant Field Values
Constructor Detail

TapestryCrudIoCModule

public TapestryCrudIoCModule()
Method Detail

contributeTapestryCrudModuleService

public static void contributeTapestryCrudModuleService(Configuration<TapestryCrudModule> contributions,
                                                       br.com.arsmachina.module.service.ModuleService moduleService,
                                                       ClassNameLocator classNameLocator,
                                                       @Inject@Symbol(value="application-module.dao-implementation-package")
                                                       String daoImplementationSubpackage)
Builds the ModuleService service.

Parameters:
contributions - a Map.

buildTapestryCrudModuleService

public static TapestryCrudModuleService buildTapestryCrudModuleService(Collection<TapestryCrudModule> contributions)
Builds the ModuleService service.

Parameters:
contributions - a Map.
Returns:
an ControllerSource.

contributeValueEncoderSource

public static void contributeValueEncoderSource(MappedConfiguration<Class,ValueEncoderFactory> configuration,
                                                EncoderSource encoderSource,
                                                br.com.arsmachina.module.service.EntitySource entitySource,
                                                PrimaryKeyEncoderSource primaryKeyEncoderSource,
                                                PrimaryKeyTypeService primaryKeyTypeService,
                                                TypeCoercer typeCoercer)
Contributes all (Class, Encoder pairs registered in EncoderSource to ValueEncoderSource. If no Encoder is found for a given entity class, if a PrimaryKeyEncoder is found, a ValueEncoderFactory is automatically created using the PrimaryKeyEncoder.

Parameters:
configuration -
encoderSource -

buildActivationContextEncoderSource

public static ActivationContextEncoderSource buildActivationContextEncoderSource(Map<Class,ActivationContextEncoder> contributions,
                                                                                 EncoderSource encoderSource,
                                                                                 PrimaryKeyEncoderSource primaryKeyEncoderSource,
                                                                                 PrimaryKeyTypeService primaryKeyTypeService)
Builds the ActivationContextEncoderSource service.

Parameters:
contributions - a Map.
Returns:
an ActivationContextEncoderSource.

buildLabelEncoderSource

public static LabelEncoderSource buildLabelEncoderSource(Map<Class,LabelEncoder> contributions,
                                                         EncoderSource encoderSource)
Builds the LabelSource service.

Parameters:
contributions - a Map.
Returns:
an ActivationContextEncoderSource.

buildPrimaryKeyEncoderSource

public static PrimaryKeyEncoderSource buildPrimaryKeyEncoderSource(Map<Class,PrimaryKeyEncoder> contributions,
                                                                   EncoderSource encoderSource,
                                                                   PrimaryKeyEncoderFactory primaryKeyEncoderFactory)
Builds the PrimaryKeyEncoderSource service.

Parameters:
contributions - a Map.
encoderSource - an EncoderSource.
primaryKeyEncoderFactory - a PrimaryKeyEncoderFactory.
Returns:
an PrimaryKeyEncoderSource.

buildEncoderSource

public static EncoderSource buildEncoderSource(Map<Class,Encoder> contributions)
Builds the EncoderSource service.

Parameters:
contributions - a Map.
Returns:
an EncoderSource.

buildSelectModelFactory

public static SelectModelFactory buildSelectModelFactory(Map<Class,SingleTypeSelectModelFactory> contributions)
Builds the SelectModelFactory service.

Parameters:
contributions - a Map.
Returns:
a SelectModelFactory.

contributeComponentClassResolver

public static void contributeComponentClassResolver(Configuration<LibraryMapping> configuration)
Contributes the Tapestry CRUD components under the crud prefix.

Parameters:
configuration - a Configuration.

contributeClasspathAssetAliasManager

public static void contributeClasspathAssetAliasManager(MappedConfiguration<String,String> configuration)

contributeModuleService

public static void contributeModuleService(Configuration<br.com.arsmachina.module.Module> configuration,
                                           ClassNameLocator classNameLocator,
                                           @Inject@Symbol(value="tapestry.app-package")
                                           String tapestryRootPackage,
                                           @Inject@Symbol(value="application-module.dao-implementation-package")
                                           String daoImplementationSubpackage)
Contributes the main (default module) to the ModuleService service.

Parameters:
configuration - a Configuration of Modules.

contributeSelectModelFactory

public static void contributeSelectModelFactory(MappedConfiguration<Class,SingleTypeSelectModelFactory> contributions,
                                                br.com.arsmachina.module.service.ControllerSource controllerSource,
                                                br.com.arsmachina.module.service.EntitySource entitySource,
                                                LabelEncoderSource labelEncoderSource)
Associates entity classes with their SelectModels.

Parameters:
contributions - a MappedConfiguration.

contributeEncoderSource

public static void contributeEncoderSource(MappedConfiguration<Class,Encoder> contributions,
                                           br.com.arsmachina.module.service.EntitySource entitySource,
                                           br.com.arsmachina.module.service.ModuleService moduleService,
                                           TapestryCrudModuleService tapestryCrudModuleService,
                                           ObjectLocator objectLocator)
Associates entity classes with their Encoders.

Parameters:
contributions - a MappedConfiguration.

contributeActivationContextEncoderSource

public static void contributeActivationContextEncoderSource(MappedConfiguration<Class,ActivationContextEncoder> contributions,
                                                            br.com.arsmachina.module.service.EntitySource entitySource,
                                                            br.com.arsmachina.module.service.ModuleService moduleService,
                                                            TapestryCrudModuleService tapestryCrudModuleService,
                                                            ObjectLocator objectLocator)
Associates entity classes with their Controllers.

Parameters:
contributions - a MappedConfiguration.

contributeLabelEncoderSource

public static void contributeLabelEncoderSource(MappedConfiguration<Class,LabelEncoder> contributions,
                                                br.com.arsmachina.module.service.EntitySource entitySource,
                                                br.com.arsmachina.module.service.ModuleService moduleService,
                                                TapestryCrudModuleService tapestryCrudModuleService,
                                                ObjectLocator objectLocator)
Associates entity classes with their LabelEncoders.

Parameters:
contributions - a MappedConfiguration.

contributePrimaryKeyEncoderSource

public static void contributePrimaryKeyEncoderSource(MappedConfiguration<Class,PrimaryKeyEncoder> contributions,
                                                     br.com.arsmachina.module.service.EntitySource entitySource,
                                                     br.com.arsmachina.module.service.ModuleService moduleService,
                                                     TapestryCrudModuleService tapestryCrudModuleService,
                                                     ObjectLocator objectLocator)
Associates entity classes with their PrimaryKeyEncoders.

Parameters:
contributions - a MappedConfiguration.

buildPrimaryKeyEncoderFactory

public PrimaryKeyEncoderFactory buildPrimaryKeyEncoderFactory(List<PrimaryKeyEncoderFactory> contributions,
                                                              ChainBuilder chainBuilder)
Builds the PrimaryKeyEncoderFactory service.

Parameters:
contributions - a List of PrimaryKeyEncoderFactory.
chainBuilder - a ChainBuilder.
Returns:
a DAOFactory.

buildPrimaryKeyTypeService

public PrimaryKeyTypeService buildPrimaryKeyTypeService(List<PrimaryKeyTypeService> contributions,
                                                        ChainBuilder chainBuilder)
Builds the DefaultLabelEncoderFactory service.

Parameters:
contributions - a List of PrimaryKeyTypeService.
chainBuilder - a ChainBuilder.
Returns:
a PrimaryKeyTypeService.


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