本文整理汇总了Java中org.simpleframework.xml.Default类的典型用法代码示例。如果您正苦于以下问题:Java Default类的具体用法?Java Default怎么用?Java Default使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Default类属于org.simpleframework.xml包,在下文中一共展示了Default类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extract
import org.simpleframework.xml.Default; //导入依赖的package包/类
/**
* This method is used to extract the annotations associated with
* the type. Annotations extracted include the <code>Root</code>
* annotation and the <code>Namespace</code> annotation as well as
* other annotations that are used to describe the type.
*
* @param type this is the type to extract the annotations from
*/
private void extract(Class type) {
for(Annotation label : labels) {
if(label instanceof Namespace) {
namespace(label);
}
if(label instanceof NamespaceList) {
scope(label);
}
if(label instanceof Root) {
root(label);
}
if(label instanceof Order) {
order(label);
}
if(label instanceof Default) {
access(label);
}
}
}
示例2: access
import org.simpleframework.xml.Default; //导入依赖的package包/类
/**
* This is used to set the optional <code>Default</code> annotation for
* the class. The default can only be set once, so if a super type also
* has a default annotation define it must be ignored.
*
* @param label this is the label used to define the defaults
*/
private void access(Annotation label) {
if(label != null) {
Default value = (Default)label;
required = value.required();
access = value.value();
}
}