Example #1
0
  public static String getFormTextSignature(MBeanAttributeDoc attributeDoc) {
    StringBuilder jmxdoc = new StringBuilder();

    String name = attributeDoc.getName();
    String returnType = attributeDoc.getType().getName();

    jmxdoc.append("<p>");
    jmxdoc.append("<span font=\"" + FONT_CODE_KEY + "\">");
    jmxdoc.append(returnType).append(" ").append(name).append("()");
    jmxdoc.append("</span>");
    jmxdoc.append("</p>");

    return jmxdoc.toString();
  }
Example #2
0
  public static String getFormText(MBeanAttributeDoc attributeDoc, boolean includeHeader) {
    StringBuilder jmxdoc = new StringBuilder();

    jmxdoc.append("<form>");

    if (includeHeader) {
      jmxdoc.append(getFormTextHeader(attributeDoc));
    }

    jmxdoc.append(getFormTextSignature(attributeDoc));
    jmxdoc.append(getFormTextDescription(attributeDoc));
    jmxdoc.append(getFormTextReturns(attributeDoc.getType()));

    jmxdoc.append("</form>");

    return jmxdoc.toString();
  }
Example #3
0
  public static String getFormText(MBeanDoc mbeanDoc) {
    StringBuilder jmxdoc = new StringBuilder();

    jmxdoc.append("<form>");

    List<MBeanAttributeDoc> attributes = mbeanDoc.getAttributes();
    int attributeCount = attributes.size();

    if (attributeCount > 0) {
      jmxdoc.append("<p>");
      jmxdoc.append("<span font=\"" + FONT_H1_KEY + "\">");
      jmxdoc.append(HEADING_ATTRIBUTE_DETAIL);
      jmxdoc.append("</span>");
      jmxdoc.append("</p>");

      // jmxdoc.append("<p>");

      for (int i = 0; i < attributeCount; i++) {
        MBeanAttributeDoc attributeDoc = attributes.get(i);

        jmxdoc.append(getFormTextHeader(attributeDoc));
        jmxdoc.append(getFormTextSignature(attributeDoc));
        jmxdoc.append(getFormTextDescription(attributeDoc));
        jmxdoc.append(getFormTextReturns(attributeDoc.getType()));

        if (i < attributeCount - 1) {
          jmxdoc.append("<br/>");
        }
      }

      // jmxdoc.append("</p>");
    }

    List<MBeanOperationDoc> operations = mbeanDoc.getOperations();
    int operationCount = operations.size();

    if (operationCount > 0) {

      if (attributeCount > 0) {}

      jmxdoc.append("<p>");
      jmxdoc.append("<span font=\"" + FONT_H1_KEY + "\">");
      jmxdoc.append(HEADING_OPERATION_DETAIL);
      jmxdoc.append("</span>");
      jmxdoc.append("</p>");

      // jmxdoc.append("<p>");

      for (int i = 0; i < operationCount; i++) {
        MBeanOperationDoc operationDoc = operations.get(i);

        jmxdoc.append(getFormTextHeader(operationDoc));
        jmxdoc.append(getFormTextSignature(operationDoc));
        jmxdoc.append(getFormTextDescription(operationDoc));
        jmxdoc.append(getFormTextParameters(operationDoc));
        jmxdoc.append(getFormTextReturns(operationDoc.getReturnType()));

        if (i < operationCount - 1) {
          jmxdoc.append("<br/>");
        }
      }

      // jmxdoc.append("</p>");
    }

    jmxdoc.append("</form>");

    return jmxdoc.toString();
  }