sphinx 的注解

<span style="font-size:24px;">1,	public @interface S4Property</span>
<span style="font-size:24px;">解释:本注释是用来说明(注释)其它注释的, 本注释是一般性注释,并且它没有任何的attribute。被这个注释所说明的注释是一个具体性的注释用来注释sphinx的property(属性),以便对某属性进行默认设置。
2,	public @interface S4Component
解释:这是一个被@S4Property说明的注释,它有3个attribute,分布为type,defaultClass,mandatory。即:Class<? extends Configurable> type();
Class<? extends Configurable> defaultClass() default Configurable.class;
boolean mandatory() default true;
从中我们可以看出本注释注释的是sphinx中的component(可配置的)的类型及是否有托管。通过本注释我们可以对component的类类型进行默认设置。如在component中设置component时,我们可以不用再xml对component中的component在进行定义。
3,	public @interface S4Integer
解释:本注释用于对属性的所需的整形值进行默认。它有3个attribute和一个field:
public static final int NOT_DEFINED = -918273645;
int defaultValue() default NOT_DEFINED;
int[] range() default {-Integer.MAX_VALUE, Integer.MAX_VALUE};
boolean mandatory() default true;
4,	public @interface S4ComponentList
解释:本注释用来说明component和component list。可使我们不用通过xml和runtime对component和component list 进行默认设置。本注释用来在可以包含component和component list的component类对component和component list进行默认设置,这样我们就可以不用通过xml和runtime来设置。例如本注释可以用于:recognizer,front-end 中。
本注释包含3个attribute:
Class<? extends Configurable> type();
Class<? extends Configurable>[] defaultList() default {};
boolean beTolerant() default false; If this flag is set the ConfigurationManager will not fail if some elements of the list couldn't be instantitated.
5,	public @interface S4Double
解释:S4Double与S4Integer有相同的作用,只是S4Double是用于Double数据类型的属性值。
6,	public @interface S4Boolean
解释:@S4Boolean用于对布尔属性值进行默认设置。它只有一个attribute为:boolean defaultValue();
7,	public @interface S4String
解释:@S4String用于对字符串属性值进行默认设置。
8,	public @interface S4StringList
解释:public @interface S4StringList {} ,其是个空的annotation,并不能提供默认设置的能力,只是用于着重特定元素,以及系统对特定元素检查。
9,	public @interface ConfCategory
解释:本注释能够用于对类打标签。我们能够通过所打的标签对那些类进行排序,并把它们让入于图形系统设计的模块类别中。本注释有一个attribute为:String[] value();即我们的标签即为字符串。我们通过对value进行赋值来实现。</span>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值