コード例 #1
0
ファイル: ClassGen.java プロジェクト: FauxFaux/jdk9-jaxp
  /**
   * Convenience method.
   *
   * <p>Add an empty constructor to this class that does nothing but calling super().
   *
   * @param access rights for constructor
   */
  public void addEmptyConstructor(int access_flags) {
    InstructionList il = new InstructionList();
    il.append(InstructionConstants.THIS); // Push `this'
    il.append(new INVOKESPECIAL(cp.addMethodref(super_class_name, "<init>", "()V")));
    il.append(InstructionConstants.RETURN);

    MethodGen mg =
        new MethodGen(access_flags, Type.VOID, Type.NO_ARGS, null, "<init>", class_name, il, cp);
    mg.setMaxStack(1);
    addMethod(mg.getMethod());
  }
コード例 #2
0
 public int addInterfaceMethodref(MethodGen method) {
   return addInterfaceMethodref(method.getClassName(), method.getName(), method.getSignature());
 }
コード例 #3
0
 public int lookupMethodref(MethodGen method) {
   return lookupMethodref(method.getClassName(), method.getName(), method.getSignature());
 }