本文整理汇总了Java中org.jf.dexlib2.iface.Annotation.getType方法的典型用法代码示例。如果您正苦于以下问题:Java Annotation.getType方法的具体用法?Java Annotation.getType怎么用?Java Annotation.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jf.dexlib2.iface.Annotation
的用法示例。
在下文中一共展示了Annotation.getType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMethodAnnotaionPrepareClasses
import org.jf.dexlib2.iface.Annotation; //导入方法依赖的package包/类
public static void getMethodAnnotaionPrepareClasses(DexDiffInfo dexDiffInfo, Set<String> prepareclasses){
for (DexBackedMethod method:dexDiffInfo.getModifiedMethods()){
Set<? extends Annotation>annotations = method.getAnnotations();
if (annotations == null){
continue;
}
for (Annotation annotation:annotations){
String type = annotation.getType();
if (type!= null&&type.startsWith("L")&&type.endsWith(";")){
prepareclasses.add(type.substring(1, type.length() - 1).replace('/', '.'));
System.out.println("prepare class: " + type);
}
Set<? extends AnnotationElement> elements = annotation.getElements();
for (AnnotationElement dexBackedAnnotationElement:elements){
if (dexBackedAnnotationElement.getValue() instanceof DexBackedArrayEncodedValue){
List<? extends EncodedValue> values = ((DexBackedArrayEncodedValue) dexBackedAnnotationElement.getValue()).getValue();
for (EncodedValue encodedValue:values) {
if (encodedValue instanceof TypeEncodedValue) {
prepareclasses.add(((TypeEncodedValue) encodedValue).getValue().substring(1, ((TypeEncodedValue) encodedValue).getValue().length() - 1).replace('/', '.'));
System.out.println("prepare class: " + ((TypeEncodedValue) encodedValue).getValue());
}
}
}else if (dexBackedAnnotationElement.getValue() instanceof DexBackedTypeEncodedValue){
String value = ((DexBackedTypeEncodedValue) dexBackedAnnotationElement.getValue()).getValue();
prepareclasses.add(value.substring(1, value.length() - 1).replace('/', '.'));
System.out.println("prepare class: " + value);
}
}
}
}
}
示例2: of
import org.jf.dexlib2.iface.Annotation; //导入方法依赖的package包/类
public static ImmutableAnnotation of(Annotation annotation) {
if (annotation instanceof ImmutableAnnotation) {
return (ImmutableAnnotation)annotation;
}
return new ImmutableAnnotation(
annotation.getVisibility(),
annotation.getType(),
annotation.getElements());
}
示例3: getType
import org.jf.dexlib2.iface.Annotation; //导入方法依赖的package包/类
@Nonnull @Override public CharSequence getType(@Nonnull Annotation annotation) {
return annotation.getType();
}
示例4: getType
import org.jf.dexlib2.iface.Annotation; //导入方法依赖的package包/类
@Override public CharSequence getType( Annotation annotation) {
return annotation.getType();
}