This content has been marked as final.
Show 3 replies
-
1. Re: General BeanInfo annotation visitor helper?
adrian.brock Mar 6, 2008 4:24 AM (in response to starksm64)"scott.stark@jboss.org" wrote:
For the AbstractManagedObjectFactory refactoring, and deployment template factory I'm working on, there is the common task of finding annotations from a root BeanInfo. Do we have general BeanInfo visitor helper? Worth creating it?
I don't understand what you are tring to do?
You can't in general visit BeanInfo because it is not a graph, the types
can be self referencing either directly or transitively. Any "visit' would loop forever. ;-)
e.g. simple example from the JDKpublic class Class extends Object {} public class Object { Class getClass(); }
The closest thing to a "visitor" (its not actually a visitor)
is the WeakTypeCache used to build the ClassInfo, etc. -
2. Re: General BeanInfo annotation visitor helper?
starksm64 Mar 6, 2008 10:22 AM (in response to starksm64)Its a graph with cycles, still has a simple graph style visitor pattern for a spanning tree. What I'm looking for is something like:
interface BeanInfoVisitor { /** return true if the bean should be visited */ boolean visit(BeanInfo bean); void visit(BeanInfo bean, ClassInfo info); void visit(BeanInfo bean, PropertyInfo info); void visit(BeanInfo bean, MethodInfo info); }
-
3. Re: General BeanInfo annotation visitor helper?
adrian.brock Mar 6, 2008 10:54 AM (in response to starksm64)Nothing like that exists. There is somethiing similar in Ales's annotation adapter
but it serves a different purpose.