本文整理汇总了Java中org.objectweb.asm.TypePath类的典型用法代码示例。如果您正苦于以下问题:Java TypePath类的具体用法?Java TypePath怎么用?Java TypePath使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TypePath类属于org.objectweb.asm包,在下文中一共展示了TypePath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitTypeAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitTypeAnnotation(int typeRef,
TypePath typePath, String desc, boolean visible) {
TypeAnnotationNode an = new TypeAnnotationNode(typeRef, typePath, desc);
if (visible) {
if (visibleTypeAnnotations == null) {
visibleTypeAnnotations = new ArrayList<TypeAnnotationNode>(1);
}
visibleTypeAnnotations.add(an);
} else {
if (invisibleTypeAnnotations == null) {
invisibleTypeAnnotations = new ArrayList<TypeAnnotationNode>(1);
}
invisibleTypeAnnotations.add(an);
}
return an;
}
示例2: visitLocalVariableAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
TypePath typePath, Label[] start, Label[] end, int[] index,
String desc, boolean visible) {
LocalVariableAnnotationNode an = new LocalVariableAnnotationNode(
typeRef, typePath, getLabelNodes(start), getLabelNodes(end),
index, desc);
if (visible) {
if (visibleLocalVariableAnnotations == null) {
visibleLocalVariableAnnotations = new ArrayList<LocalVariableAnnotationNode>(
1);
}
visibleLocalVariableAnnotations.add(an);
} else {
if (invisibleLocalVariableAnnotations == null) {
invisibleLocalVariableAnnotations = new ArrayList<LocalVariableAnnotationNode>(
1);
}
invisibleLocalVariableAnnotations.add(an);
}
return an;
}
示例3: visitTryCatchAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitTryCatchAnnotation(int typeRef,
TypePath typePath, String desc, boolean visible) {
TryCatchBlockNode tcb = tryCatchBlocks.get((typeRef & 0x00FFFF00) >> 8);
TypeAnnotationNode an = new TypeAnnotationNode(typeRef, typePath, desc);
if (visible) {
if (tcb.visibleTypeAnnotations == null) {
tcb.visibleTypeAnnotations = new ArrayList<TypeAnnotationNode>(
1);
}
tcb.visibleTypeAnnotations.add(an);
} else {
if (tcb.invisibleTypeAnnotations == null) {
tcb.invisibleTypeAnnotations = new ArrayList<TypeAnnotationNode>(
1);
}
tcb.invisibleTypeAnnotations.add(an);
}
return an;
}
示例4: visitLocalVariableAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public Printer visitLocalVariableAnnotation(int typeRef, TypePath typePath,
Label[] start, Label[] end, int[] index, String desc,
boolean visible) {
buf.setLength(0);
buf.append(tab2).append("LOCALVARIABLE @");
appendDescriptor(FIELD_DESCRIPTOR, desc);
buf.append('(');
text.add(buf.toString());
Textifier t = createTextifier();
text.add(t.getText());
buf.setLength(0);
buf.append(") : ");
appendTypeReference(typeRef);
buf.append(", ").append(typePath);
for (int i = 0; i < start.length; ++i) {
buf.append(" [ ");
appendLabel(start[i]);
buf.append(" - ");
appendLabel(end[i]);
buf.append(" - ").append(index[i]).append(" ]");
}
buf.append(visible ? "\n" : " // invisible\n");
text.add(buf.toString());
return t;
}
示例5: begin
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public void begin(final String name, final Attributes attrs) {
String desc = attrs.getValue("desc");
boolean visible = Boolean.valueOf(attrs.getValue("visible"))
.booleanValue();
int typeRef = Integer.parseInt(attrs.getValue("typeRef"));
TypePath typePath = TypePath.fromString(attrs.getValue("typePath"));
Object v = peek();
if (v instanceof ClassVisitor) {
push(((ClassVisitor) v).visitTypeAnnotation(typeRef, typePath,
desc, visible));
} else if (v instanceof FieldVisitor) {
push(((FieldVisitor) v).visitTypeAnnotation(typeRef, typePath,
desc, visible));
} else if (v instanceof MethodVisitor) {
push(((MethodVisitor) v).visitTypeAnnotation(typeRef, typePath,
desc, visible));
}
}
示例6: visitTypeAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
public ASMifier visitTypeAnnotation(final String method, final int typeRef,
final TypePath typePath, final String desc, final boolean visible) {
buf.setLength(0);
buf.append("{\n").append("av0 = ").append(name).append(".")
.append(method).append("(");
buf.append(typeRef);
if (typePath == null) {
buf.append(", null, ");
} else {
buf.append(", TypePath.fromString(\"").append(typePath).append("\"), ");
}
appendConstant(desc);
buf.append(", ").append(visible).append(");\n");
text.add(buf.toString());
ASMifier a = createASMifier("av", 0);
text.add(a.getText());
text.add("}\n");
return a;
}
示例7: visitTypeAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitTypeAnnotation(final int typeRef,
final TypePath typePath, final String desc, final boolean visible) {
checkState();
int sort = typeRef >>> 24;
if (sort != TypeReference.CLASS_TYPE_PARAMETER
&& sort != TypeReference.CLASS_TYPE_PARAMETER_BOUND
&& sort != TypeReference.CLASS_EXTENDS) {
throw new IllegalArgumentException("Invalid type reference sort 0x"
+ Integer.toHexString(sort));
}
checkTypeRefAndPath(typeRef, typePath);
CheckMethodAdapter.checkDesc(desc, false);
return new CheckAnnotationAdapter(super.visitTypeAnnotation(typeRef,
typePath, desc, visible));
}
示例8: visitTryCatchAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public Printer visitTryCatchAnnotation(int typeRef, TypePath typePath,
String desc, boolean visible) {
buf.setLength(0);
buf.append(tab2).append("TRYCATCHBLOCK @");
appendDescriptor(FIELD_DESCRIPTOR, desc);
buf.append('(');
text.add(buf.toString());
Textifier t = createTextifier();
text.add(t.getText());
buf.setLength(0);
buf.append(") : ");
appendTypeReference(typeRef);
buf.append(", ").append(typePath);
buf.append(visible ? "\n" : " // invisible\n");
text.add(buf.toString());
return t;
}
示例9: visitTypeAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
/**
* Prints a disassembled view of the given type annotation.
*
* @param typeRef
* a reference to the annotated type. See {@link TypeReference}.
* @param typePath
* the path to the annotated type argument, wildcard bound, array
* element type, or static inner type within 'typeRef'. May be
* <tt>null</tt> if the annotation targets 'typeRef' as a whole.
* @param desc
* the class descriptor of the annotation class.
* @param visible
* <tt>true</tt> if the annotation is visible at runtime.
* @return a visitor to visit the annotation values.
*/
public Textifier visitTypeAnnotation(final int typeRef,
final TypePath typePath, final String desc, final boolean visible) {
buf.setLength(0);
buf.append(tab).append('@');
appendDescriptor(FIELD_DESCRIPTOR, desc);
buf.append('(');
text.add(buf.toString());
Textifier t = createTextifier();
text.add(t.getText());
buf.setLength(0);
buf.append(") : ");
appendTypeReference(typeRef);
buf.append(", ").append(typePath);
buf.append(visible ? "\n" : " // invisible\n");
text.add(buf.toString());
return t;
}
示例10: visitTypeAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitTypeAnnotation(final int typeRef,
final TypePath typePath, final String desc, final boolean visible) {
checkEndMethod();
int sort = typeRef >>> 24;
if (sort != TypeReference.METHOD_TYPE_PARAMETER
&& sort != TypeReference.METHOD_TYPE_PARAMETER_BOUND
&& sort != TypeReference.METHOD_RETURN
&& sort != TypeReference.METHOD_RECEIVER
&& sort != TypeReference.METHOD_FORMAL_PARAMETER
&& sort != TypeReference.THROWS) {
throw new IllegalArgumentException("Invalid type reference sort 0x"
+ Integer.toHexString(sort));
}
CheckClassAdapter.checkTypeRefAndPath(typeRef, typePath);
CheckMethodAdapter.checkDesc(desc, false);
return new CheckAnnotationAdapter(super.visitTypeAnnotation(typeRef,
typePath, desc, visible));
}
示例11: visitInsnAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitInsnAnnotation(final int typeRef,
final TypePath typePath, final String desc, final boolean visible) {
checkStartCode();
checkEndCode();
int sort = typeRef >>> 24;
if (sort != TypeReference.INSTANCEOF && sort != TypeReference.NEW
&& sort != TypeReference.CONSTRUCTOR_REFERENCE
&& sort != TypeReference.METHOD_REFERENCE
&& sort != TypeReference.CAST
&& sort != TypeReference.CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
&& sort != TypeReference.METHOD_INVOCATION_TYPE_ARGUMENT
&& sort != TypeReference.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
&& sort != TypeReference.METHOD_REFERENCE_TYPE_ARGUMENT) {
throw new IllegalArgumentException("Invalid type reference sort 0x"
+ Integer.toHexString(sort));
}
CheckClassAdapter.checkTypeRefAndPath(typeRef, typePath);
CheckMethodAdapter.checkDesc(desc, false);
return new CheckAnnotationAdapter(super.visitInsnAnnotation(typeRef,
typePath, desc, visible));
}
示例12: visitTypeAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitTypeAnnotation(int typeRef,
TypePath typePath, String desc, boolean visible) {
AnnotationVisitor av = super.visitTypeAnnotation(typeRef, typePath,
remapper.mapDesc(desc), visible);
return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
}
示例13: visitTypeAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitTypeAnnotation(int typeRef,
TypePath typePath, String desc, boolean visible) {
AnnotationVisitor av = super.visitTypeAnnotation(typeRef, typePath,
remapper.mapDesc(desc), visible);
return av == null ? av : new AnnotationRemapper(av, remapper);
}
示例14: visitLocalVariableAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitLocalVariableAnnotation(final int typeRef,
final TypePath typePath, final Label[] start, final Label[] end,
final int[] index, final String desc, final boolean visible) {
fsmCursor.transition("visitLocalVariableAnnotation");
final AnnotationVisitor annotationVisitor = super
.visitLocalVariableAnnotation(typeRef, typePath, start, end, index,
desc, visible);
return annotationVisitor; // TODO: add CheckAnnotationVisitorFsm
}
示例15: visitInsnAnnotation
import org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitInsnAnnotation(int typeRef,
TypePath typePath, String desc, boolean visible) {
AnnotationVisitor av = super.visitInsnAnnotation(typeRef, typePath,
remapper.mapDesc(desc), visible);
return av == null ? av : new AnnotationRemapper(av, remapper);
}