Created
October 25, 2013 14:04
-
-
Save namuan/7155187 to your computer and use it in GitHub Desktop.
Find annotation of groovy class fields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ApiCampaign a = new ApiCampaign() | |
a.properties.each { property -> | |
a.class.declaredFields.find { field -> | |
if (field.name == property.key && SupportedApiVersion in field.declaredAnnotations*.annotationType()) { | |
def parameter = field.getAnnotation(SupportedApiVersion) | |
println "Property with name " + property.key + " with parameter " + parameter.atLeast() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment