blob: 437256d64d51f83b71501c6fd60d46baf7679204 [file] [log] [blame]
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.mat.api" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.eclipse.mat.api" id="nameResolver" name="Class Specific Name Resolver"/>
</appInfo>
<documentation>
&lt;p&gt;When browsing the object list, the Memory Analyzer prints
a class specific name next to the object address. This could
be the content of the char[] for a &lt;samp&gt;java.lang.String&lt;/samp&gt;
or the name attribute of a &lt;samp&gt;java.lang.Thread&lt;/samp&gt; object.&lt;/p&gt;
&lt;p&gt;Use this extension point to provide custom name resolvers:
for example the title for catalog objects, the user id of
authenticated session, etc. etc.&lt;/p&gt;
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
<element ref="resolver"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="resolver">
<complexType>
<attribute name="impl" type="string" use="required">
<annotation>
<documentation>
implementor of &lt;a href=&quot;org/eclipse/mat/snapshot/extension/IClassSpecificNameResolver.html&quot;&gt;&lt;samp&gt;org.eclipse.mat.snapshot.extension.IClassSpecificNameResolver&lt;/samp&gt;&lt;/a&gt; annotated with &lt;a href=&quot;org/eclipse/mat/snapshot/extension/Subject.html&quot;&gt;&lt;samp&gt;@Subject&lt;/samp&gt;&lt;/a&gt; or &lt;a href=&quot;org/eclipse/mat/snapshot/extension/Subjects.html&quot;&gt;&lt;samp&gt;@Subjects&lt;/samp&gt;&lt;/a&gt;.
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.eclipse.mat.snapshot.extension.IClassSpecificNameResolver"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="apiInfo"/>
</appInfo>
<documentation>
The value of the impl attribute must represent an implementor of &lt;samp&gt;org.eclipse.mat.snapshot.extension.IClassSpecificNameResolver&lt;/samp&gt;.
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
0.7.0
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
Following is an example of a name resolver declaration:
&lt;p&gt;
&lt;pre&gt;
&lt;extension point=&quot;org.eclipse.mat.api.nameResolver&quot;&gt;
&lt;resolver impl=&quot;org.eclipse.mat.inspections.CommonNameResolver$ThreadResolver&quot; /&gt;
&lt;/extension&gt;
&lt;/pre&gt;
&lt;/p&gt;
The implemenation could look like this:
&lt;p&gt;
&lt;pre&gt;
@Subject(&quot;java.lang.Thread&quot;)
public static class ThreadResolver implements IClassSpecificNameResolver
{
public String resolve(IObject obj) throws SnapshotException
{
IObject name = (IObject) obj.resolveValue(&quot;name&quot;);
return name != null ? name.getClassSpecificName() : null;
}
}
&lt;/pre&gt;
&lt;/p&gt;
The &lt;samp&gt;@Subject&lt;/samp&gt; tells the Memory Analyzer, to use this name resolver
for all instances of type &quot;java.lang.Thread&quot;. The implementation then extracts
the name attribute (which is a String or a char[] object, depending on the
implementation of the JDK) and returns its class specific name.
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
The Memory Analyzer supplies a number of name resolvers itself. Check out the &lt;samp&gt;org.eclipse.mat.inspections.CommonNameResolver&lt;/samp&gt; for more samples.
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="copyright"/>
</appInfo>
<documentation>
Copyright (c) 2008,2011 SAP AG and others.&lt;br&gt;
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0 which
accompanies this distribution, and is available at
&lt;a href=&quot;https://www.eclipse.org/legal/epl-2.0/&quot;&gt;https://www.eclipse.org/legal/epl-2.0/&lt;/a&gt;
</documentation>
</annotation>
</schema>