you can inject Stage in your classes too:
@Inject
public Foo(Stage stage) {
  this.stage = stage
}

On Tue, Sep 1, 2009 at 1:06 AM, Max Bowsher <m...@f2s.com> wrote:

> Pablo Fernandez wrote:
> > Hi,
> >
> > I'd like to know the stage (PRODUCTION, DEVELOPMENT) that my injector
> > is in.
> >
> > I basically want to do something like this
> >
> > boolean indentXml = Injector.CURRENT_STAGE != PRODUCTION
> > bind(Boolean.class).annotatedWith(Names.named("xml.indent")).toInstance
> > (indentXml);
>
>
> See AbstractModule#currentStage().
>
> Max.
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to google-guice@googlegroups.com
To unsubscribe from this group, send email to 
google-guice+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to