105 * a reference to the annotated type. See {@link TypeReference}.
106 * @param typePath
107 * the path to the annotated type argument, wildcard bound, array
108 * element type, or static inner type within 'typeRef'. May be
109 * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
110 * @param start
111 * the fist instructions corresponding to the continuous ranges
112 * that make the scope of this local variable (inclusive).
113 * @param end
114 * the last instructions corresponding to the continuous ranges
115 * that make the scope of this local variable (exclusive). This
116 * array must have the same size as the 'start' array.
117 * @param index
118 * the local variable's index in each range. This array must have
119 * the same size as the 'start' array.
120 * @param desc
121 * the class descriptor of the annotation class.
122 */
123 public LocalVariableAnnotationNode(int typeRef, TypePath typePath,
124 LabelNode[] start, LabelNode[] end, int[] index, String desc) {
125 this(Opcodes.ASM5, typeRef, typePath, start, end, index, desc);
126 }
127
128 /**
129 * Constructs a new {@link LocalVariableAnnotationNode}.
130 *
131 * @param api
132 * the ASM API version implemented by this visitor. Must be one
133 * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
134 * @param typeRef
135 * a reference to the annotated type. See {@link TypeReference}.
136 * @param start
137 * the fist instructions corresponding to the continuous ranges
138 * that make the scope of this local variable (inclusive).
139 * @param end
140 * the last instructions corresponding to the continuous ranges
141 * that make the scope of this local variable (exclusive). This
142 * array must have the same size as the 'start' array.
143 * @param index
144 * the local variable's index in each range. This array must have
145 * the same size as the 'start' array.
146 * @param typePath
147 * the path to the annotated type argument, wildcard bound, array
148 * element type, or static inner type within 'typeRef'. May be
149 * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
150 * @param desc
151 * the class descriptor of the annotation class.
152 */
153 public LocalVariableAnnotationNode(int api, int typeRef, TypePath typePath,
164 }
165
166 /**
167 * Makes the given visitor visit this type annotation.
168 *
169 * @param mv
170 * the visitor that must visit this annotation.
171 * @param visible
172 * <tt>true</tt> if the annotation is visible at runtime.
173 */
174 public void accept(final MethodVisitor mv, boolean visible) {
175 Label[] start = new Label[this.start.size()];
176 Label[] end = new Label[this.end.size()];
177 int[] index = new int[this.index.size()];
178 for (int i = 0; i < start.length; ++i) {
179 start[i] = this.start.get(i).getLabel();
180 end[i] = this.end.get(i).getLabel();
181 index[i] = this.index.get(i);
182 }
183 accept(mv.visitLocalVariableAnnotation(typeRef, typePath, start, end,
184 index, desc, true));
185 }
186 }
|
105 * a reference to the annotated type. See {@link TypeReference}.
106 * @param typePath
107 * the path to the annotated type argument, wildcard bound, array
108 * element type, or static inner type within 'typeRef'. May be
109 * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
110 * @param start
111 * the fist instructions corresponding to the continuous ranges
112 * that make the scope of this local variable (inclusive).
113 * @param end
114 * the last instructions corresponding to the continuous ranges
115 * that make the scope of this local variable (exclusive). This
116 * array must have the same size as the 'start' array.
117 * @param index
118 * the local variable's index in each range. This array must have
119 * the same size as the 'start' array.
120 * @param desc
121 * the class descriptor of the annotation class.
122 */
123 public LocalVariableAnnotationNode(int typeRef, TypePath typePath,
124 LabelNode[] start, LabelNode[] end, int[] index, String desc) {
125 this(Opcodes.ASM6, typeRef, typePath, start, end, index, desc);
126 }
127
128 /**
129 * Constructs a new {@link LocalVariableAnnotationNode}.
130 *
131 * @param api
132 * the ASM API version implemented by this visitor. Must be one
133 * of {@link Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
134 * @param typeRef
135 * a reference to the annotated type. See {@link TypeReference}.
136 * @param start
137 * the fist instructions corresponding to the continuous ranges
138 * that make the scope of this local variable (inclusive).
139 * @param end
140 * the last instructions corresponding to the continuous ranges
141 * that make the scope of this local variable (exclusive). This
142 * array must have the same size as the 'start' array.
143 * @param index
144 * the local variable's index in each range. This array must have
145 * the same size as the 'start' array.
146 * @param typePath
147 * the path to the annotated type argument, wildcard bound, array
148 * element type, or static inner type within 'typeRef'. May be
149 * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
150 * @param desc
151 * the class descriptor of the annotation class.
152 */
153 public LocalVariableAnnotationNode(int api, int typeRef, TypePath typePath,
164 }
165
166 /**
167 * Makes the given visitor visit this type annotation.
168 *
169 * @param mv
170 * the visitor that must visit this annotation.
171 * @param visible
172 * <tt>true</tt> if the annotation is visible at runtime.
173 */
174 public void accept(final MethodVisitor mv, boolean visible) {
175 Label[] start = new Label[this.start.size()];
176 Label[] end = new Label[this.end.size()];
177 int[] index = new int[this.index.size()];
178 for (int i = 0; i < start.length; ++i) {
179 start[i] = this.start.get(i).getLabel();
180 end[i] = this.end.get(i).getLabel();
181 index[i] = this.index.get(i);
182 }
183 accept(mv.visitLocalVariableAnnotation(typeRef, typePath, start, end,
184 index, desc, visible));
185 }
186 }
|