return new TypePath(output.data, 0);
/** * Returns a string representation of this type path. {@link #ARRAY_ELEMENT} steps are represented * with '[', {@link #INNER_TYPE} steps with '.', {@link #WILDCARD_BOUND} steps with '*' and {@link * #TYPE_ARGUMENT} steps with their type argument index in decimal form followed by ';'. */ @Override public String toString() { int length = getLength(); StringBuilder result = new StringBuilder(length * 2); for (int i = 0; i < length; ++i) { switch (getStep(i)) { case ARRAY_ELEMENT: result.append('['); break; case INNER_TYPE: result.append('.'); break; case WILDCARD_BOUND: result.append('*'); break; case TYPE_ARGUMENT: result.append(getStepArgument(i)).append(';'); break; default: throw new AssertionError(); } } return result.toString(); }
@Override public final AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { // Create a ByteVector to hold a 'type_annotation' JVMS structure. // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20. ByteVector typeAnnotation = new ByteVector(); // Write target_type, target_info, and target_path. TypeReference.putTarget(typeRef, typeAnnotation); TypePath.put(typePath, typeAnnotation); // Write type_index and reserve space for num_element_value_pairs. typeAnnotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0); if (visible) { return lastRuntimeVisibleTypeAnnotation = new AnnotationWriter(symbolTable, typeAnnotation, lastRuntimeVisibleTypeAnnotation); } else { return lastRuntimeInvisibleTypeAnnotation = new AnnotationWriter(symbolTable, typeAnnotation, lastRuntimeInvisibleTypeAnnotation); } }
@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")); push(((MethodVisitor) peek()).visitInsnAnnotation(typeRef, typePath, desc, visible)); }
typePath.toString());
@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")); push(((MethodVisitor) peek()).visitTryCatchAnnotation(typeRef, typePath, desc, visible)); }
att.addAttribute("", "typePath", "typePath", "", typePath.toString());
/** * Returns a string representation of this type path. {@link #ARRAY_ELEMENT} steps are represented * with '[', {@link #INNER_TYPE} steps with '.', {@link #WILDCARD_BOUND} steps with '*' and {@link * #TYPE_ARGUMENT} steps with their type argument index in decimal form followed by ';'. */ @Override public String toString() { int length = getLength(); StringBuilder result = new StringBuilder(length * 2); for (int i = 0; i < length; ++i) { switch (getStep(i)) { case ARRAY_ELEMENT: result.append('['); break; case INNER_TYPE: result.append('.'); break; case WILDCARD_BOUND: result.append('*'); break; case TYPE_ARGUMENT: result.append(getStepArgument(i)).append(';'); break; default: throw new AssertionError(); } } return result.toString(); }
pathLength == 0 ? null : new TypePath(b, currentOffset);
@Override public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { // Create a ByteVector to hold a 'type_annotation' JVMS structure. // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20. ByteVector typeAnnotation = new ByteVector(); // Write target_type, target_info, and target_path. TypeReference.putTarget(typeRef, typeAnnotation); TypePath.put(typePath, typeAnnotation); // Write type_index and reserve space for num_element_value_pairs. typeAnnotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0); if (visible) { return lastRuntimeVisibleTypeAnnotation = new AnnotationWriter(symbolTable, typeAnnotation, lastRuntimeVisibleTypeAnnotation); } else { return lastRuntimeInvisibleTypeAnnotation = new AnnotationWriter(symbolTable, typeAnnotation, lastRuntimeInvisibleTypeAnnotation); } }
@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")); push(((MethodVisitor) peek()).visitTryCatchAnnotation(typeRef, typePath, desc, visible)); }
/** * Returns a string representation of this type path. {@link #ARRAY_ELEMENT} steps are represented * with '[', {@link #INNER_TYPE} steps with '.', {@link #WILDCARD_BOUND} steps with '*' and {@link * #TYPE_ARGUMENT} steps with their type argument index in decimal form followed by ';'. */ @Override public String toString() { int length = getLength(); StringBuilder result = new StringBuilder(length * 2); for (int i = 0; i < length; ++i) { switch (getStep(i)) { case ARRAY_ELEMENT: result.append('['); break; case INNER_TYPE: result.append('.'); break; case WILDCARD_BOUND: result.append('*'); break; case TYPE_ARGUMENT: result.append(getStepArgument(i)).append(';'); break; default: throw new AssertionError(); } } return result.toString(); }
if ((targetType >>> 24) == TypeReference.EXCEPTION_PARAMETER) { TypePath path = pathLength == 0 ? null : new TypePath(b, currentOffset); currentOffset += 1 + 2 * pathLength;
@Override public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { // Create a ByteVector to hold a 'type_annotation' JVMS structure. // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20. ByteVector typeAnnotation = new ByteVector(); // Write target_type, target_info, and target_path. TypeReference.putTarget(typeRef, typeAnnotation); TypePath.put(typePath, typeAnnotation); // Write type_index and reserve space for num_element_value_pairs. typeAnnotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0); if (visible) { return lastRuntimeVisibleTypeAnnotation = new AnnotationWriter(symbolTable, typeAnnotation, lastRuntimeVisibleTypeAnnotation); } else { return lastRuntimeInvisibleTypeAnnotation = new AnnotationWriter(symbolTable, typeAnnotation, lastRuntimeInvisibleTypeAnnotation); } }
@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")); push(((MethodVisitor) peek()).visitInsnAnnotation(typeRef, typePath, desc, visible)); }
/** * Returns a string representation of this type path. {@link #ARRAY_ELEMENT} steps are represented * with '[', {@link #INNER_TYPE} steps with '.', {@link #WILDCARD_BOUND} steps with '*' and {@link * #TYPE_ARGUMENT} steps with their type argument index in decimal form followed by ';'. */ @Override public String toString() { int length = getLength(); StringBuilder result = new StringBuilder(length * 2); for (int i = 0; i < length; ++i) { switch (getStep(i)) { case ARRAY_ELEMENT: result.append('['); break; case INNER_TYPE: result.append('.'); break; case WILDCARD_BOUND: result.append('*'); break; case TYPE_ARGUMENT: result.append(getStepArgument(i)).append(';'); break; default: throw new AssertionError(); } } return result.toString(); }
return new TypePath(output.data, 0);
@Override public AnnotationVisitor visitInsnAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { // Create a ByteVector to hold a 'type_annotation' JVMS structure. // See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20. ByteVector typeAnnotation = new ByteVector(); // Write target_type, target_info, and target_path. TypeReference.putTarget((typeRef & 0xFF0000FF) | (lastBytecodeOffset << 8), typeAnnotation); TypePath.put(typePath, typeAnnotation); // Write type_index and reserve space for num_element_value_pairs. typeAnnotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0); if (visible) { return lastCodeRuntimeVisibleTypeAnnotation = new AnnotationWriter(symbolTable, typeAnnotation, lastCodeRuntimeVisibleTypeAnnotation); } else { return lastCodeRuntimeInvisibleTypeAnnotation = new AnnotationWriter(symbolTable, typeAnnotation, lastCodeRuntimeInvisibleTypeAnnotation); } }
@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")); String[] s = attrs.getValue("start").split(" "); Label[] start = new Label[s.length]; for (int i = 0; i < start.length; ++i) { start[i] = getLabel(s[i]); } String[] e = attrs.getValue("end").split(" "); Label[] end = new Label[e.length]; for (int i = 0; i < end.length; ++i) { end[i] = getLabel(e[i]); } String[] v = attrs.getValue("index").split(" "); int[] index = new int[v.length]; for (int i = 0; i < index.length; ++i) { index[i] = Integer.parseInt(v[i]); } push(((MethodVisitor) peek()).visitLocalVariableAnnotation(typeRef, typePath, start, end, index, desc, visible)); }
int length = getLength(); StringBuilder result = new StringBuilder(length * 2); for (int i = 0; i < length; ++i) { switch (getStep(i)) { case ARRAY_ELEMENT: result.append('['); break; case TYPE_ARGUMENT: result.append(getStepArgument(i)).append(';'); break; default: