All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.doclets.jmx.JmxHtmlGenerator Maven / Gradle / Ivy

package org.infinispan.doclets.jmx;

import java.util.List;

import org.infinispan.doclets.html.HtmlGenerator;

public class JmxHtmlGenerator extends HtmlGenerator {
   List components;

   public JmxHtmlGenerator(String encoding, String title, String bottom, String footer, String header, String metaDescription, List metaKeywords, List components) {
      super(encoding, title, bottom, footer, header, metaDescription, metaKeywords);
      this.components = components;
   }

   @Override
   protected String generateContents() {
      StringBuilder sb = new StringBuilder();
      // index of components
      sb.append("

JMX Components available


"); sb.append("
    "); for (MBeanComponent mbean : components) { sb.append("
  • ").append(mbean.name).append(""); if (isValid(mbean.desc)) sb.append(" (").append(mbean.desc).append(")"); sb.append("
  • \n"); } sb.append("
"); sb.append("



"); // a table for each component. for (MBeanComponent mbean : components) { sb.append("\n"); sb.append("\n"); sb.append("\n"); if (!mbean.attributes.isEmpty()) { // Attributes sb.append("\n"); sb.append(""); } if (!mbean.operations.isEmpty()) { // Operations sb.append("\n"); sb.append(""); } sb.append("
Component ").append(mbean.name).append(" (Class ").append(mbean.className).append(")"); if (isValid(mbean.desc)) sb.append("
").append(mbean.desc).append("\n"); sb.append("
Attributes
\n"); sb.append("\n"); sb.append("\n"); sb.append("\n"); sb.append("\n"); for (MBeanAttribute attr : mbean.attributes) { sb.append(""); sb.append(""); sb.append(""); sb.append(""); sb.append(""); sb.append(""); } sb.append("
NameDescriptionTypeWritable
").append(attr.name).append("").append(attr.desc).append("").append(attr.type).append("").append(attr.writable).append("
Operations
\n"); sb.append("\n"); sb.append("\n"); sb.append("\n"); for (MBeanOperation operation : mbean.operations) { sb.append(""); sb.append(""); sb.append(""); sb.append(""); sb.append(""); } sb.append("
NameDescriptionSignature
").append(operation.name).append("").append(operation.desc).append("").append(generateSignature(operation)).append("


"); } return sb.toString(); } private String toURL(String fqcn) { return fqcn.replace(".", "/") + ".html"; } private String generateSignature(MBeanOperation op) { // () StringBuilder sb = new StringBuilder(); if (isValid(op.returnType)) sb.append(op.returnType); else sb.append("void"); sb.append(" ").append(op.name); if (isValid(op.signature)) sb.append("(").append(op.signature).append(")"); else sb.append("()"); return sb.toString(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy