Query Result Renderer

org.eclipse.mat.api.renderer

0.7.0

The Memory Analyzer reports utilize the renderer to create a textual representation of the query results, e.g. the table, trees, histograms, etc. Out of the box, HTML and CSV are supported. This is the extension point to add alternative renderer.

<!ELEMENT extension (renderer)+>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT renderer EMPTY>

<!ATTLIST renderer

impl CDATA #REQUIRED>


Following is an example of a renderer declaration:

   

<extension point=

"org.eclipse.mat.report.renderer"

>

<renderer impl=

"org.eclipse.mat.report.internal.CsvRenderer"

/>

</extension>

The renderer must implement org.eclipse.mat.report.IOutputter. The @Renderer annotation declares the target format and, optionally, the applicable result type.

@Renderer(target = "csv", result = IResult.class)
public class CsvRenderer implements IOutputter
{
   [...]
}

In the report, use the "format" parameter to specify the output format:

   

<query name=

"Class Histogram"

>

<param key=

"format"

value=

"csv"

/>

<command>

histogram

</command>

</query>

The value of the impl attribute must represent an implementor of org.eclipse.mat.report.IOutputter.

The Memory Analyzer supplies two renderer: one for HTML, one for CSV (comma separated values).