本文整理汇总了Java中jdk.internal.org.objectweb.asm.TypePath类的典型用法代码示例。如果您正苦于以下问题:Java TypePath类的具体用法?Java TypePath怎么用?Java TypePath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypePath类属于jdk.internal.org.objectweb.asm包,在下文中一共展示了TypePath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitTypeAnnotation
import jdk.internal.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: visitInsnAnnotation
import jdk.internal.org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitInsnAnnotation(int typeRef,
TypePath typePath, String desc, boolean visible) {
// Finds the last real instruction, i.e. the instruction targeted by
// this annotation.
AbstractInsnNode insn = instructions.getLast();
while (insn.getOpcode() == -1) {
insn = insn.getPrevious();
}
// Adds the annotation to this instruction.
TypeAnnotationNode an = new TypeAnnotationNode(typeRef, typePath, desc);
if (visible) {
if (insn.visibleTypeAnnotations == null) {
insn.visibleTypeAnnotations = new ArrayList<TypeAnnotationNode>(
1);
}
insn.visibleTypeAnnotations.add(an);
} else {
if (insn.invisibleTypeAnnotations == null) {
insn.invisibleTypeAnnotations = new ArrayList<TypeAnnotationNode>(
1);
}
insn.invisibleTypeAnnotations.add(an);
}
return an;
}
示例3: visitTryCatchAnnotation
import jdk.internal.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 jdk.internal.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;
}
示例5: visitTypeAnnotation
import jdk.internal.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));
}
示例6: visitLocalVariableAnnotation
import jdk.internal.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;
}
示例7: visitTypeAnnotation
import jdk.internal.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;
}
示例8: visitTypeAnnotation
import jdk.internal.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));
}
示例9: visitTryCatchAnnotation
import jdk.internal.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;
}
示例10: visitTypeAnnotation
import jdk.internal.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);
}
示例11: visitTryCatchAnnotation
import jdk.internal.org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitTryCatchAnnotation(int typeRef,
TypePath typePath, String desc, boolean visible) {
AnnotationVisitor av = super.visitTryCatchAnnotation(typeRef, typePath,
remapper.mapDesc(desc), visible);
return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
}
示例12: visitLocalVariableAnnotation
import jdk.internal.org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
TypePath typePath, Label[] start, Label[] end, int[] index,
String desc, boolean visible) {
AnnotationVisitor av = super.visitLocalVariableAnnotation(typeRef,
typePath, start, end, index, remapper.mapDesc(desc), visible);
return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
}
示例13: visitLocalVariableAnnotation
import jdk.internal.org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
TypePath typePath, Label[] start, Label[] end, int[] index,
String desc, boolean visible) {
Printer p = this.p.visitLocalVariableAnnotation(typeRef, typePath,
start, end, index, desc, visible);
AnnotationVisitor av = mv == null ? null : mv
.visitLocalVariableAnnotation(typeRef, typePath, start, end,
index, desc, visible);
return new TraceAnnotationVisitor(av, p);
}
示例14: visitLocalVariableAnnotation
import jdk.internal.org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
TypePath typePath, Label[] start, Label[] end, int[] index,
String desc, boolean visible) {
checkStartCode();
checkEndCode();
int sort = typeRef >>> 24;
if (sort != TypeReference.LOCAL_VARIABLE
&& sort != TypeReference.RESOURCE_VARIABLE) {
throw new IllegalArgumentException("Invalid type reference sort 0x"
+ Integer.toHexString(sort));
}
CheckClassAdapter.checkTypeRefAndPath(typeRef, typePath);
checkDesc(desc, false);
if (start == null || end == null || index == null
|| end.length != start.length || index.length != start.length) {
throw new IllegalArgumentException(
"Invalid start, end and index arrays (must be non null and of identical length");
}
for (int i = 0; i < start.length; ++i) {
checkLabel(start[i], true, "start label");
checkLabel(end[i], true, "end label");
checkUnsignedShort(index[i], "Invalid variable index");
int s = labels.get(start[i]).intValue();
int e = labels.get(end[i]).intValue();
if (e < s) {
throw new IllegalArgumentException(
"Invalid start and end labels (end must be greater than start)");
}
}
return super.visitLocalVariableAnnotation(typeRef, typePath, start,
end, index, desc, visible);
}
示例15: visitTypeAnnotation
import jdk.internal.org.objectweb.asm.TypePath; //导入依赖的package包/类
@Override
public AnnotationVisitor visitTypeAnnotation(final int typeRef,
final TypePath typePath, final String desc, final boolean visible) {
checkEnd();
int sort = typeRef >>> 24;
if (sort != TypeReference.FIELD) {
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));
}