wt.jmx.core
Class XMLDumper

java.lang.Object
  extended by wt.jmx.core.XMLDumper

public final class XMLDumper
extends Object

This class provides a number of utilities to output MBean attribute data as XML. There is no DTD for the resulting XML and the format is not currently documented. These utilities are supported, however, so that one can reliably produce the same XML format and use the same XSLT stylesheets as those used by core Windchill MBeans.

Supported API: true

Extendable: false


Field Summary
static String DEFAULT_XSLT
          Resource path of default XSLT stylesheet

Supported API: true
static String DEFAULT_XSLT_URL_STRING
          URL of default XSLT stylesheet

Supported API: true
 
Method Summary
static void dumpAllMBeansToXml(ContentHandler listener)
          Outputs basic XML data for all MBeans currently registered with the MBeanServer as SAX2 XML parser events.
static String dumpAllMBeansToXml(OutputStream outputStream, boolean indent, String xsltUrlString, boolean transformNow)
          Outputs basic XML data (optionally transformed by XSLT) for all MBeans currently registered with the MBeanServer.
static String dumpAllMBeansToXml(Writer writer, boolean indent, String xsltUrlString, boolean transformNow)
          Outputs basic XML data (optionally transformed by XSLT) for all MBeans currently registered with the MBeanServer.
static void dumpMBeanAttrValueToXml(ContentHandler listener, Object attrValue)
          Renders a given MBean attribute value as XML in the form of SAX2 XML parser events.
static void dumpMBeansToXml(ContentHandler listener, Collection objectNameSet)
          Outputs basic XML data for selected MBeans currently registered with the MBeanServer as SAX2 XML parser events.
static String dumpMBeansToXml(OutputStream outputStream, Collection objectNameSet, boolean indent, String xsltUrlString, boolean transformNow)
          Outputs basic XML data (optionally transformed by XSLT) for selected MBeans currently registered with the MBeanServer.
static String dumpMBeansToXml(Writer writer, Collection objectNameSet, boolean indent, String xsltUrlString, boolean transformNow)
          Outputs basic XML data (optionally transformed by XSLT) for selected MBeans currently registered with the MBeanServer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_XSLT

public static final String DEFAULT_XSLT
Resource path of default XSLT stylesheet

Supported API: true

See Also:
Constant Field Values

DEFAULT_XSLT_URL_STRING

public static final String DEFAULT_XSLT_URL_STRING
URL of default XSLT stylesheet

Supported API: true

Method Detail

dumpAllMBeansToXml

public static String dumpAllMBeansToXml(Writer writer,
                                        boolean indent,
                                        String xsltUrlString,
                                        boolean transformNow)
                                 throws SAXException
Outputs basic XML data (optionally transformed by XSLT) for all MBeans currently registered with the MBeanServer.

Supported API: true

Parameters:
writer - writer to which output is to be sent
indent - whether XML should be indented
xsltUrlString - URL, file path, or classpath-based resource reference to XSLT stylesheet
transformNow - whether XML should be transformed now by this routine (or whether a processing instruction should just be inserted instead)
Throws:
SAXException

dumpAllMBeansToXml

public static String dumpAllMBeansToXml(OutputStream outputStream,
                                        boolean indent,
                                        String xsltUrlString,
                                        boolean transformNow)
                                 throws SAXException
Outputs basic XML data (optionally transformed by XSLT) for all MBeans currently registered with the MBeanServer.

Supported API: true

Parameters:
outputStream - output stream to which output is to be sent
indent - whether XML should be indented
xsltUrlString - URL, file path, or classpath-based resource reference to XSLT stylesheet
transformNow - whether XML should be transformed now by this routine (or whether a processing instruction should just be inserted instead)
Throws:
SAXException

dumpAllMBeansToXml

public static void dumpAllMBeansToXml(ContentHandler listener)
                               throws SAXException
Outputs basic XML data for all MBeans currently registered with the MBeanServer as SAX2 XML parser events.

Supported API: true

Parameters:
listener - SAX2 ContentHandler to which output is to be sent
Throws:
SAXException

dumpMBeansToXml

public static String dumpMBeansToXml(Writer writer,
                                     Collection objectNameSet,
                                     boolean indent,
                                     String xsltUrlString,
                                     boolean transformNow)
                              throws SAXException
Outputs basic XML data (optionally transformed by XSLT) for selected MBeans currently registered with the MBeanServer.

Supported API: true

Parameters:
writer - writer to which output is to be sent
objectNameSet - collection of ObjectNames of MBeans to output data for
indent - whether XML should be indented
xsltUrlString - URL, file path, or classpath-based resource reference to XSLT stylesheet
transformNow - whether XML should be transformed now by this routine (or whether a processing instruction should just be inserted instead)
Throws:
SAXException

dumpMBeansToXml

public static String dumpMBeansToXml(OutputStream outputStream,
                                     Collection objectNameSet,
                                     boolean indent,
                                     String xsltUrlString,
                                     boolean transformNow)
                              throws SAXException
Outputs basic XML data (optionally transformed by XSLT) for selected MBeans currently registered with the MBeanServer.

Supported API: true

Parameters:
outputStream - output stream to which output is to be sent
objectNameSet - collection of ObjectNames of MBeans to output data for
indent - whether XML should be indented
xsltUrlString - URL, file path, or classpath-based resource reference to XSLT stylesheet
transformNow - whether XML should be transformed now by this routine (or whether a processing instruction should just be inserted instead)
Throws:
SAXException

dumpMBeansToXml

public static void dumpMBeansToXml(ContentHandler listener,
                                   Collection objectNameSet)
                            throws SAXException
Outputs basic XML data for selected MBeans currently registered with the MBeanServer as SAX2 XML parser events.

Supported API: true

Parameters:
listener - SAX2 ContentHandler to which output is to be sent
objectNameSet - collection of ObjectNames of MBeans to output data for
Throws:
SAXException

dumpMBeanAttrValueToXml

public static void dumpMBeanAttrValueToXml(ContentHandler listener,
                                           Object attrValue)
                                    throws SAXException
Renders a given MBean attribute value as XML in the form of SAX2 XML parser events. This method can clearly be applied to other objects by signature, but is not a generalized object to XML renderer. Rather it specifically handles those cases found in MBean open data.

Supported API: true

Parameters:
listener - SAX2 ContentHandler to which output is to be sent
attrValue - MBean attribute value to output data for
Throws:
SAXException