272
273 /**
274 * Creates a new {@link GeneratorAdapter}. <i>Subclasses must not use this
275 * constructor</i>. Instead, they must use the
276 * {@link #GeneratorAdapter(int, MethodVisitor, int, String, String)}
277 * version.
278 *
279 * @param mv
280 * the method visitor to which this adapter delegates calls.
281 * @param access
282 * the method's access flags (see {@link Opcodes}).
283 * @param name
284 * the method's name.
285 * @param desc
286 * the method's descriptor (see {@link Type Type}).
287 * @throws IllegalStateException
288 * If a subclass calls this constructor.
289 */
290 public GeneratorAdapter(final MethodVisitor mv, final int access,
291 final String name, final String desc) {
292 this(Opcodes.ASM5, mv, access, name, desc);
293 if (getClass() != GeneratorAdapter.class) {
294 throw new IllegalStateException();
295 }
296 }
297
298 /**
299 * Creates a new {@link GeneratorAdapter}.
300 *
301 * @param api
302 * the ASM API version implemented by this visitor. Must be one
303 * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
304 * @param mv
305 * the method visitor to which this adapter delegates calls.
306 * @param access
307 * the method's access flags (see {@link Opcodes}).
308 * @param name
309 * the method's name.
310 * @param desc
311 * the method's descriptor (see {@link Type Type}).
312 */
313 protected GeneratorAdapter(final int api, final MethodVisitor mv,
314 final int access, final String name, final String desc) {
315 super(api, access, desc, mv);
316 this.access = access;
317 this.returnType = Type.getReturnType(desc);
318 this.argumentTypes = Type.getArgumentTypes(desc);
319 }
320
321 /**
322 * Creates a new {@link GeneratorAdapter}. <i>Subclasses must not use this
323 * constructor</i>. Instead, they must use the
|
272
273 /**
274 * Creates a new {@link GeneratorAdapter}. <i>Subclasses must not use this
275 * constructor</i>. Instead, they must use the
276 * {@link #GeneratorAdapter(int, MethodVisitor, int, String, String)}
277 * version.
278 *
279 * @param mv
280 * the method visitor to which this adapter delegates calls.
281 * @param access
282 * the method's access flags (see {@link Opcodes}).
283 * @param name
284 * the method's name.
285 * @param desc
286 * the method's descriptor (see {@link Type Type}).
287 * @throws IllegalStateException
288 * If a subclass calls this constructor.
289 */
290 public GeneratorAdapter(final MethodVisitor mv, final int access,
291 final String name, final String desc) {
292 this(Opcodes.ASM6, mv, access, name, desc);
293 if (getClass() != GeneratorAdapter.class) {
294 throw new IllegalStateException();
295 }
296 }
297
298 /**
299 * Creates a new {@link GeneratorAdapter}.
300 *
301 * @param api
302 * the ASM API version implemented by this visitor. Must be one
303 * of {@link Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
304 * @param mv
305 * the method visitor to which this adapter delegates calls.
306 * @param access
307 * the method's access flags (see {@link Opcodes}).
308 * @param name
309 * the method's name.
310 * @param desc
311 * the method's descriptor (see {@link Type Type}).
312 */
313 protected GeneratorAdapter(final int api, final MethodVisitor mv,
314 final int access, final String name, final String desc) {
315 super(api, access, desc, mv);
316 this.access = access;
317 this.returnType = Type.getReturnType(desc);
318 this.argumentTypes = Type.getArgumentTypes(desc);
319 }
320
321 /**
322 * Creates a new {@link GeneratorAdapter}. <i>Subclasses must not use this
323 * constructor</i>. Instead, they must use the
|