Closed julman99 closed 9 years ago
:+1: Merging the getAnnotatedFields and Methods to Members is nice! Only problem is that if the consumer needs to know the type, may have to do an instanceof, but generally it will only need the annotation, so, should not be a problem.
@joaocpsantos, the thing is that it is an abstract class, and then there are two implementations, MethodInspector
and FieldInspector
, each of these return the appropriate class. AnnotationInspector
is just to encapsulate the cache logic because it is quite complicated and it was duplicated
During development of #16 I noticed that we had different logics around the project to retrieve annotated fields or methods from a class.
This PR unifies all that logic in a new abstract class called
AnnotationInspector
. This class is based on the previous FieldInspector, but now it does not have anysynchronized
keyword and takes advantage of theConcurrentMap.putIfAbsent
method.Also,
AnnotationInspector
allows mapping of the fields to an arbitrary class, useful for theMappedMethod
type we use to handle@ExposeMehtodResult