r01f.locale
Class I18NMessageAnnotationGuiceHandler

java.lang.Object
  extended by r01f.locale.I18NMessageAnnotationGuiceHandler
All Implemented Interfaces:
com.google.inject.spi.TypeListener

public class I18NMessageAnnotationGuiceHandler
extends java.lang.Object
implements com.google.inject.spi.TypeListener

Handle que se encarga de escuchar los eventos que lanza Guice justo ANTES de que devuelva un objeto En este caso, se "inspecciona" el objeto para ver si hay que inyectar un bundle de mensajes. Cuando una clase "necesita" un bundle de mensajes, basta con: 1.- Anotar un miembro del tipo I18NService con la anotacion @I18NMessageBundle (ver I18NService) 2.- Solicitar a guice la creación de la clase En caso de que guice se encargue de la creación de la clase que necesita un bundle, se llama al método hear de esta clase para que se encargue de inyectar con el bundle.


Constructor Summary
I18NMessageAnnotationGuiceHandler()
           
 
Method Summary
(package private) static boolean _isValidBundleChain(java.lang.String[] theBundleChain)
           
<I> void
hear(com.google.inject.TypeLiteral<I> type, com.google.inject.spi.TypeEncounter<I> encounter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

I18NMessageAnnotationGuiceHandler

public I18NMessageAnnotationGuiceHandler()
Method Detail

hear

public <I> void hear(com.google.inject.TypeLiteral<I> type,
                     com.google.inject.spi.TypeEncounter<I> encounter)
Specified by:
hear in interface com.google.inject.spi.TypeListener

_isValidBundleChain

static final boolean _isValidBundleChain(java.lang.String[] theBundleChain)