2

This question refers to this prior one posted here on SO by Christian Metzler.

My only very limited experience regarding annotion consists of using CustomAttribute introduced in recent Delphi versions.

My question:

  • Are there any other languages implementing nested attributes features (for annotation purpose).
Community
  • 1
  • 1
menjaraz
  • 7,551
  • 4
  • 41
  • 81
  • 1
    Please ask your two questions separately. Although they're both related to the topic of nested attributes, they're not related to *each other*. You'll get better answers to each of them if you post them separately, and you'll get more reputation points. Edit this question to ask just one of your questions, and then make a new post for the other question. – Rob Kennedy Dec 26 '11 at 16:57
  • @Rob Kennedy: Edit made. I withdraw the 2nd (conditional) question. – menjaraz Dec 26 '11 at 19:12

1 Answers1

1

In the Java programming language it is possible to declare nested annotation types.

Example references:

http://javahowto.blogspot.com/2006/07/java-annotations-with-no-target.html

http://www.trevorpounds.com/blog/?p=314

Here is an example from the javax.persistence.EntityResult docs, with 3 nested annotations at 3 different levels:

@SqlResultSetMapping(name="OrderResults",
 entities={
     @EntityResult(entityClass=com.acme.Order.class, fields={
         @FieldResult(name="id", column="order_id"),
         @FieldResult(name="quantity", column="order_quantity"),
         @FieldResult(name="item", column="order_item")})},
 columns={
     @ColumnResult(name="item_name")}
)
mjn
  • 36,362
  • 28
  • 176
  • 378