enum 的封装 VCN支持吗? 不支持的话以后会支持吗?主要是这样可以避免用户传入一些奇怪的参数。
纯枚举类型暂时不支持;但是可以通过在类中定义常量值;实现类型化参数;例如:
public class 配置类型{
public static final int 类型一 = 0;
public static final int 类型二 = 1;
public static final int 类型三 = 2;
}
然后在类库配置文件中;将该类添加为纯数据类型节点:
<class name="配置类型" comment="数据配置类型;使用时只需要类名.常量名">
<constant name="类型一" type="整数型" value="0" comment="常量:类型一。" />
<constant name="类型二" type="整数型" value="1" comment="常量:类型二。" />
<constant name="类型三" type="整数型" value="2" comment="常量:类型三。" />
</class>