本文整理汇总了Java中org.motechproject.mds.annotations.UIDisplayable类的典型用法代码示例。如果您正苦于以下问题:Java UIDisplayable类的具体用法?Java UIDisplayable怎么用?Java UIDisplayable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UIDisplayable类属于org.motechproject.mds.annotations包,在下文中一共展示了UIDisplayable类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import org.motechproject.mds.annotations.UIDisplayable; //导入依赖的package包/类
@Override
protected void process(AnnotatedElement element) {
Class<?> classType = MemberUtil.getCorrectType(element);
if (null != classType) {
UIDisplayable annotation = ReflectionsUtil.getAnnotationClassLoaderSafe(element, classType, UIDisplayable.class);
if (null != annotation) {
String fieldName = MemberUtil.getFieldName(element);
Long position = annotation.position();
if (DEFAULT_VALUE.equals(position)) {
// assign negative value, but respect order in which field appeared in processor
put(fieldName, Long.MIN_VALUE + getElements().size());
} else if (getElements().containsValue(position)) {
LOGGER.error("The annotation has the position value which is already used. Assigning default value");
// assign negative value, but respect order in which field appeared in processor
put(fieldName, Long.MIN_VALUE + getElements().size());
} else {
put(fieldName, position);
}
}
} else {
LOGGER.warn("Field type is unknown in: {}", element);
}
}
示例2: getAnnotationType
import org.motechproject.mds.annotations.UIDisplayable; //导入依赖的package包/类
@Override
public Class<UIDisplayable> getAnnotationType() {
return UIDisplayable.class;
}
示例3: shouldReturnCorrectAnnotation
import org.motechproject.mds.annotations.UIDisplayable; //导入依赖的package包/类
@Test
public void shouldReturnCorrectAnnotation() throws Exception {
assertEquals(UIDisplayable.class, processor.getAnnotationType());
}