[~steve], regarding classmate and its usage, you basically need a {{TypeResolver}} and a {{MemberResolver}}. To use the example from the classmate [readme|https://github.com/cowtowncoder/java-classmate]:
{code} ResolvedType arrayListType = typeResolver.resolve(ArrayList.class, String.class); MemberResolver memberResolver = new MemberResolver(typeResolver); ResolvedTypeWithMembers arrayListTypeWithMembers = memberResolver.resolve(arrayListType, null, null); ResolvedMethod[] arrayListMethods = arrayListTypeWithMembers.getMemberMethods(); {code}
This might be a good place to better understand what classmate does - http://www.cowtowncoder.com/blog/archives/2012/04/entry_471.html
Resolving must occur from the leaf nodes of the class hierarchy.
At the moment we resolve each configured class via classmate and keep the {{ResolvedTypeWithMembers}} instance around (in {{ConfiguredClass}}). When we then process attributes/properties we call {{ConfiguredClass#createMappedAttribute}} which does the type lookup via {{resolvedMember.getType().getErasedType()}}. If we have a collection type we do {{AnnotationParserHelper.resolveCollectionElementType}}. That's the basic idea. I think Gail as well as Strong modified/continued from this basic idea.
|