Query
Identifier:
org.eclipse.mat.api.query
Since:
0.7.0
Description:
The Memory Analyzer can be extended by Queries. Queries
are pieces of Java Code that implement specific inspections
on the heap dump. Depending on the input parameters,
queries are shown in the Query Drop-Down menu and/or in the
context menu of a heap object.
Configuration Markup:
<!ELEMENT extension (query)+>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT query EMPTY>
<!ATTLIST query
impl CDATA #REQUIRED>
Examples:
Following is an example of a query declaration:
<extension point=
"org.eclipse.mat.report.query"
>
<query impl=
"org.eclipse.mat.demo.DemoQuery"
/>
</extension>
API Information:
The value of the impl attribute must represent an implementor of org.eclipse.mat.query.IQuery.
The public fields in the query can be tagged with the @Argument
annotation so they can be filled in by the query wizard. Argument types include
- ISnapshot
- the snapshot
- IHeapObjectArgument
- one or more objects
- int
- a single object
- boolean
- a flag
Queries can be tagged with @Name @Help @HelpURL @Icon @Menu @Category @CommandName. These annotations can also be held in an annotations.properties file for ease of translation.
Supplied Implementation:
The Memory Analyzer supplies a number of queries itself. Check out the org.eclipse.mat.inspections package for more samples.
Copyright (c) 2008 SAP AG and others.
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which
accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html