What you are trying to do isn't going to work.

The @Named annotation in question is on the field where the injection took
place.  The object that got injected, or its class (SjcPiTimerSI) has no
clue *why* it got injected, so no general purpose utility method like you
have outlined is going to be able to learn what you're after.

Craig

On Thu, Jul 19, 2012 at 10:03 AM, MarvinToll.com <[email protected]>wrote:

> ** Newbie Alert **
>
> A class has the following field injection:
>
>     @Inject
>     @Named(SjcConstant.TIMER_PLUGIN)
>     private SjcPiTimerSI timerSI;
>
> I would like to subsequently find out the instance @Named value.
>
> For example, a Utility method similar to:
>
> public static String retrieveInstanceNamedName (SjcPiTimerSI thisInstance)
> {
>
> String instanceName;
>
>      *???*
>
> return instanceName;
> }
>
> Any thoughts/
>
> _Marvin
> http://PatternEnabled.com
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-guice/-/I-viPU_TteQJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>

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

Reply via email to