Nested Attributes in Delphi (Continued)

我与影子孤独终老i 提交于 2019-12-11 01:42:47

问题


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).

回答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")}
)


来源:https://stackoverflow.com/questions/8637044/nested-attributes-in-delphi-continued

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!