• Post Reply Bookmark Topic Watch Topic
  • New Topic

Nested Annotation @Target question  RSS feed

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!