Esempio n. 1
0
  protected void printMethod(PrintWriter pw, MethodSourceView msv) {
    MethodInfo meth = msv.getMethod();

    // Don't print values() method
    if ("values".equals(meth.getName())
        && (msv.getClazz().getThisClassInfo().getFullyQualifiedName() + "[]")
            .equals(meth.getDescriptor().getReturnType().getFQN())
        && meth.isStatic()
        && meth.isPublic()) {
      return;
    }

    // Don't print valueOf() method
    if ("valueOf".equals(meth.getName())
        && msv.getClazz()
            .getThisClassInfo()
            .getFullyQualifiedName()
            .equals(meth.getDescriptor().getReturnType().getFQN())
        && meth.isStatic()
        && meth.isPublic()) {
      return;
    }

    super.printMethod(pw, msv);
  }
Esempio n. 2
0
  protected MethodSourceView createMethodView(MethodInfo method) {
    if (method.isInit()) {
      MethodSourceView msv = new EnumInitMethodSourceView(method, this);
      msv.setIndent("    ");
      return msv;
    }

    if (method.isStaticInit()) {
      MethodSourceView msv = new EnumClinitMethodSourceView(method, this);
      msv.setIndent("    ");
      return msv;
    }

    return super.createMethodView(method);
  }