Issue 244: Public methods matcher
http://code.google.com/p/google-guice/issues/detail?id=244

New issue report by limpbizkit:
From: Pierre Monestie <[EMAIL PROTECTED]>
Subject: Re: BytecodeGen

Reading the doc, you guys specify that this will only work if the methods
intercepted are public. I would suggest, for Guice, to provide a Method
interceptor matcher that matches only public methods so that people don't
make the mistake intercpeting package-private methods....

Something like:
public static Matcher<AnnotatedElement>
publicMethodAnnotatedWith(final Class<? extends Annotation>
annotationType) {
                return new AnnotatedWithType(annotationType){
                        public boolean matches(AnnotatedElement element) {
                                boolean v=
element.getAnnotation(annotationType) != null;
                                if (!v)return v;
                                if (!(element instanceof Method)){
                                        return false;
                                }else{
                                        Method method=(Method)element;

v=Modifier.isPublic(method.getModifiers());
                                        if (!v){
                                                log.error("Method is not
public, will not intercept");
                                        }
                                        return v;
                                }

                        }
                };
        }


Issue attributes:
        Status: New
        Owner: limpbizkit
        Labels: Type-Enhancement Priority-Low

-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to