org.loom.guice
Class LoomModule

java.lang.Object
  extended by com.google.inject.AbstractModule
      extended by org.loom.guice.LoomModule
All Implemented Interfaces:
com.google.inject.Module

public class LoomModule
extends com.google.inject.AbstractModule

Configures Loom using Guice. Extend this class to override the default config.


Constructor Summary
LoomModule(javax.servlet.ServletContext servletContext)
           
 
Method Summary
protected  void configure()
           
protected  void initActionMappingRepository()
           
protected  void initAnnotationProcessors()
           
protected  void initConverterFactory()
           
protected  void initDefaultCompiler(java.lang.String name, WebResourceType type)
           
protected  void initExceptionHandler()
           
protected  void initExpressionLanguageProxy()
           
protected  void initFileParameterFactory()
           
protected  void initFlashContextFactory()
           
protected  void initLocaleResolver()
           
protected  void initLookup()
           
protected  MessagesRepositoryFactory initMessagesRepositoryFactory()
          Initializes the MessagesRepositoryFactory instance
protected  void initNodeFactory()
           
protected  org.codehaus.jackson.map.ObjectMapper initObjectMapper()
           
protected  void initResolutionFactory()
           
protected  org.springframework.core.io.ResourceLoader initResourceLoader()
           
protected  void initServletContext()
           
protected  void initWebResourceBundleFactory()
           
 LoomModule withActionClasses(java.lang.Iterable<java.lang.Class<? extends Action>> actionClasses)
          Registers the action classes into the ActionMappingRepository
 LoomModule withDefaultLocale(java.util.Locale defaultLocale)
          Sets the default Locale to apply to requests if the user-selected locale is not supported by the application
 LoomModule withDevelopment(boolean development)
          Sets a development value.
 LoomModule withMessagesLocations(java.lang.String... messagesLocations)
          Sets the location of i18n messages.
 
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoomModule

public LoomModule(javax.servlet.ServletContext servletContext)
Method Detail

withDevelopment

public LoomModule withDevelopment(boolean development)
Sets a development value. If true, changes to messages.properties and web resources (css, js files) will be detected automatically, and if JRebel is present action classes will also be reloaded on-the-fly.

Returns:
this same instance

withDefaultLocale

public LoomModule withDefaultLocale(java.util.Locale defaultLocale)
Sets the default Locale to apply to requests if the user-selected locale is not supported by the application

Parameters:
defaultLocale - the default locale to apply. If unspecified, Locale.getDefault() will be used
Returns:
this same instance

withMessagesLocations

public LoomModule withMessagesLocations(java.lang.String... messagesLocations)
Sets the location of i18n messages.

Parameters:
messagesLocations - the locations of i18n messages, without the locale or ".properties" parts. Defaults to "classpath:resources/loom-messages", "WEB-INF/classes/resources/messages"
Returns:
this same instance

withActionClasses

public LoomModule withActionClasses(java.lang.Iterable<java.lang.Class<? extends Action>> actionClasses)
Registers the action classes into the ActionMappingRepository

Parameters:
actionClasses - the action classes to use
Returns:
this same instance

configure

protected void configure()
Specified by:
configure in class com.google.inject.AbstractModule

initServletContext

protected void initServletContext()

initResourceLoader

protected org.springframework.core.io.ResourceLoader initResourceLoader()

initActionMappingRepository

protected void initActionMappingRepository()

initConverterFactory

protected void initConverterFactory()

initExpressionLanguageProxy

protected void initExpressionLanguageProxy()

initExceptionHandler

protected void initExceptionHandler()

initFileParameterFactory

protected void initFileParameterFactory()

initResolutionFactory

protected void initResolutionFactory()

initFlashContextFactory

protected void initFlashContextFactory()

initLocaleResolver

protected void initLocaleResolver()

initMessagesRepositoryFactory

protected MessagesRepositoryFactory initMessagesRepositoryFactory()
Initializes the MessagesRepositoryFactory instance

Returns:
the initialized DefaultMessagesRepositoryFactory instance, in case further customizations are needed.

initNodeFactory

protected void initNodeFactory()

initObjectMapper

protected org.codehaus.jackson.map.ObjectMapper initObjectMapper()

initWebResourceBundleFactory

protected void initWebResourceBundleFactory()

initDefaultCompiler

protected void initDefaultCompiler(java.lang.String name,
                                   WebResourceType type)

initLookup

protected void initLookup()

initAnnotationProcessors

protected void initAnnotationProcessors()