让我们再讨论几个注释类型的例子。
类型系统包含注释类型及其特征。
The type system contains information about annotation types and their features.
首先,派生的方面可以选择注释类型。
抽象注释类型的更多例子。
元数据功能也可以指定一种定义注释类型的方法。
Optionally, a metadata facility can specify a way to define annotation types.
它并没有多么地不同凡响,对注释类型更是如此。
This isn't anything remarkable, or even specific to annotation types.
之后,元数据功能可以检查注释实例的注释类型。
The metadata facility can then check annotation instances against the annotation types.
这个枚举定义了注释类型可应用的不同程序元素。
This enum defines the various program elements that an annotation type can target. Listing 9 show the ElementType enum in its entirety.
下一个标准注释类型是Deprecated 。
所幸的是,Tiger还允许定义自己的注释类型。
Fortunately, Tiger also lets you define your own annotation types.
不过,您将发现多个注释都可能使用相同的注释类型。
However, you'll find that several of your annotations might all use the same annotation type.
经常甚至频繁地使用标准注释类型是一种较好的做法。
It's a great idea to use the standard annotation types often, and even heavily.
TODOItems注释类型有一个具有值的变量。
The TODOItems annotation type has a single variable that takes a value.
注释类型看起来很像普通的类,但是有一些特有的性质。
An annotation type looks a lot like an ordinary class, but it has some unique properties.
每个注释类型定义了一组与之关联的固定名称。
Each annotation type defines a fixed set of names associated with that annotation.
尽管清单3看起来很奇怪,但这是注释类型所要求的格式。
As odd as Listing 3 might look, it's what you need in annotation types.
注释类型中的数据成员被设置成使用有限的信息进行工作。
Data members in annotation types are set up to work using limited information.
最明显的元注释就是允许何种程序元素具有定义的注释类型。
The most obvious meta-annotation is one that allows you to indicate which program elements can have annotations of the defined type.
新规则中使用的注释类型必须成为uima类型系统的一部分。
The annotation types used in the new rules must exist as part of the UIMA type system.
清单6中的GroupTODO注释类型中添加了几个新的变量。
The GroupTODO annotation type in Listing 6 adds several new variables.
但是在编写自己的注释类型时,注释类型的目的并不总是显而易见的。
However, as you move into writing your own annotation types, the purpose of your annotation types isn't always self-evident.
请使用注释者方面方法,参与只发生在对注释类型的共同理解这一级别。
With the annotator aspect approach, the participation occurs only at the level of a Shared understanding of annotation type.
与类指定一个创建对象的模版很相像,注释类型指定创建注释实例的模版。
Annotation types specify a template to create annotation instances, much the same way classes specify a template to create objects.
理想情况是,注释类型应当表示程序元素的抽象功能,而不是它们预期的消费。
Ideally, annotation types should represent abstract characteristics of a program element and not their expected consumption.
元数据正日益变得有帮助,您肯定会提出非常适用于自己的应用程序的注释类型。
Metadata is increasingly useful, and you'll certainly come up with annotation types that are perfect for your own applications.
清单3定义了一个名为value的字符串,该注释类型能够接受它。
Listing 3 defines a string named value that the annotation type can accept. You then use the annotation type as in Listing 4.
正如将在下面三个部分了解到的,Tiger的基本注释类型的使用都极其简单。
As you'll learn in the next three sections, Tiger's basic annotation types are extremely simple to use.
使用这个选项卡指定哪个注释类型包含分析结果(例如,类型Company)。
Use this TAB to specify which annotation type contains the analysis result, (for example, the type Company).
您可以使用4种预定义的注释类型(称为元注释)对您的注释进行注释。
You can use four predefined annotation types — referred to as meta-annotations — to annotate your annotations.
这就要求您为注释类型提供某种元数据,以便编译器保证按照预期的目的使用注释。
This requires you to supply some sort of metadata on your annotation type, so that the compiler can enforce the annotation's intended functionality.
应用推荐