[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Field signature usage
alesj
do-not-reply at jboss.com
Mon Mar 17 10:10:45 EDT 2008
"adrian at 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.
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());
| }
|
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).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137066#4137066
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137066
More information about the jboss-dev-forums
mailing list