By way of example, let me take your post apart.... ;-)
"alesj" wrote : "adrian(a)jboss.org" wrote :
| | If you've done the field properties correctly, then this should just be
| | a case of using propertyInfo.get(Underlying)Annotations()
| | i.e. no getters/setters means use the field to get the annotations, but this
| | is all hidden from the caller - they are "property annotations"
| I'll still need that AnnotatedElementMetaDataLoader field change, for non-public
fields.
|
Why? Is that your implementation choice, it is a fundamental requirement
for this to work? etc. State the problem not the solution.
anonymous wrote :
| It's the way I do annotation lookup in AbstractBeanAnnotationAdapter, going over
MetaData to do the lookup:
|
| | FieldInfo field = pi.getFieldInfo();
| | if (field != null)
| | {
| | Signature sis = new FieldSignature(field);
| | MetaData cmdr = retrieval.getComponentMetaData(sis);
| | if (cmdr != null)
| | {
| | for(AnnotationPlugin plugin : fieldAnnotationPlugins)
| | {
| | if (isApplyPhase)
| | plugin.applyAnnotation(field, cmdr, visitor);
| | else
| | plugin.cleanAnnotation(field, cmdr, visitor);
| | }
| | }
| | else if (trace)
| | log.trace("No annotations for field " +
field.getName());
| | }
| | [/code
| |
This shows you using the MetaData Repository (MDR)
not the field annotations. So if there's an issue, it is with the population
of the repository not this code.
I don't understand how the code you show has any relation
to field annotaions, since it doesn't use that api (at least directly).
And as I said above, I don't know this code and certainly can't assertain
how it works from a partial code snippet.
anonymous wrote :
| If the field is non-public and the mode is non-standard, this field will be a part of
propertys, but I don't want to distinct between underlying annotations and instance
annotations (which are only in metadata, right).
The conclusion is true, but what relevance that fact has to the rest of the sentence
is unclear to me. You need to "join the dots" :-)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137076#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...