• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Nested Annotation @Target question

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm pretty new to Java 5, and am defining some annotations to be used as follows:

@BaseProperties({
@BaseProperty(name="formView", value="createPerson"),
@BaseProperty(name="successView", value="createSucceeded")
})
public class ExampleFormController extends SimpleFormController {
..
}

I know I can set the @Target of @BaseProperties to be ElementType.TYPE, but how can I define a suitable @Target of @BaseProperty - so it can only be used within the outer annotation?

I couldn't see a suitable value in ElementType?
 
Chris Nappin
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looking at the definition of various Java EE and Spring Annotations, I've come to the opinion that there is no meaningful @Target for a nested Annotation - seems to be a gap in the Java language?

If anyone knows otherwise please let me know!
reply
    Bookmark Topic Watch Topic
  • New Topic