For this example I'm getting the field annotations of all declared fields in my declared domain classes, using the doWithApplicationContext closure that comes with all plugins:
def doWithApplicationContext = { applicationContext ->
for(GrailsDomainClass domainClass in application.domainClasses) {
println "DOMAIN CLASS ${domainClass}: "
domainClass.clazz.declaredFields.each{
field ->
if(field.declaredAnnotations){
println "${field.name} has the following annotations: ${field.declaredAnnotations} "
//Do some more processing
}
}
}
}
0 comentarios:
Publicar un comentario