code: public int optionLength(String option) {
          Object retVal;
          String methodName = "optionLength";
          Class<?>[] paramTypes = { String.class };
          Object[] params = { option };
          try {
              retVal = invoke(methodName, 0, paramTypes, params);
          } catch (DocletInvokeException exc) {
              return -1;
          }
          if (retVal instanceof Integer) {
              return ((Integer)retVal);
          } else {
              messager.error(Messager.NOPOS, "main.must_return_int",
                             docletClassName, methodName);
              return -1;
          }
      }
docs: Check for doclet added options here. Zero return means
  option not known.  Positive value indicates number of
  arguments to option.  Negative value means error occurred.