本文整理匯總了Java中com.google.gwt.core.ext.typeinfo.JClassType.isAnnotation方法的典型用法代碼示例。如果您正苦於以下問題:Java JClassType.isAnnotation方法的具體用法?Java JClassType.isAnnotation怎麽用?Java JClassType.isAnnotation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.core.ext.typeinfo.JClassType
的用法示例。
在下文中一共展示了JClassType.isAnnotation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createAnnotationValues
import com.google.gwt.core.ext.typeinfo.JClassType; //導入方法依賴的package包/類
public static String createAnnotationValues(TypeOracle typeOracle,
Annotation annotation, TreeLogger logger){
StringBuilder sb = new StringBuilder();
JClassType classType = typeOracle.findType(ReflectionUtils.getQualifiedSourceName(annotation.annotationType()));
if (classType != null){
sb.append("org.lirazs.gbackbone.reflection.client.impl.AnnotationValues.toAnnotation(new org.lirazs.gbackbone.reflection.client.impl.AnnotationValues(");
sb.append("\"" + classType.getQualifiedSourceName() + "\", new Object[]{");
JAnnotationType annoType = classType.isAnnotation();
// JAnnotationMethod[] methods = annoType.getMethods();
JAnnotationMethod[] methods = (JAnnotationMethod[]) annoType.getMethods();
int index = 0;
for (JAnnotationMethod method : methods) {
Object value = null;
try {
value = annotation.annotationType().getMethod(method.getName(), new Class[]{}).invoke(annotation);
if (index > 0)
sb.append(", ");
sb.append(annoValueToCode(typeOracle, value, logger));
index ++;
} catch (Exception e){
throw new CheckedExceptionWrapper(e);
}
}
sb.append("}))");
}else{
logger.log(Type.ERROR, "Annotation (" + ReflectionUtils.getQualifiedSourceName(annotation.annotationType()) + ") not exists in compiled client source code, please ensure this class is exists and included in your module(.gwt.xml) file. GWTENT reflection process will ignore it and continue. ");
}
return sb.toString();
}