| <?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> | |
| <p>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 <samp>java.lang.String</samp> | |
| or the name attribute of a <samp>java.lang.Thread</samp> object.</p> | |
| <p>Use this extension point to provide custom name resolvers: | |
| for example the title for catalog objects, the user id of | |
| authenticated session, etc. etc.</p> | |
| </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 <a href="org/eclipse/mat/snapshot/extension/IClassSpecificNameResolver.html"><samp>org.eclipse.mat.snapshot.extension.IClassSpecificNameResolver</samp></a> annotated with <a href="org/eclipse/mat/snapshot/extension/Subject.html"><samp>@Subject</samp></a> or <a href="org/eclipse/mat/snapshot/extension/Subjects.html"><samp>@Subjects</samp></a>. | |
| </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 <samp>org.eclipse.mat.snapshot.extension.IClassSpecificNameResolver</samp>. | |
| </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: | |
| <p> | |
| <pre> | |
| <extension point="org.eclipse.mat.api.nameResolver"> | |
| <resolver impl="org.eclipse.mat.inspections.CommonNameResolver$ThreadResolver" /> | |
| </extension> | |
| </pre> | |
| </p> | |
| The implemenation could look like this: | |
| <p> | |
| <pre> | |
| @Subject("java.lang.Thread") | |
| public static class ThreadResolver implements IClassSpecificNameResolver | |
| { | |
| public String resolve(IObject obj) throws SnapshotException | |
| { | |
| IObject name = (IObject) obj.resolveValue("name"); | |
| return name != null ? name.getClassSpecificName() : null; | |
| } | |
| } | |
| </pre> | |
| </p> | |
| The <samp>@Subject</samp> tells the Memory Analyzer, to use this name resolver | |
| for all instances of type "java.lang.Thread". 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 <samp>org.eclipse.mat.inspections.CommonNameResolver</samp> for more samples. | |
| </documentation> | |
| </annotation> | |
| <annotation> | |
| <appInfo> | |
| <meta.section type="copyright"/> | |
| </appInfo> | |
| <documentation> | |
| Copyright (c) 2008,2011 SAP AG and others.<br> | |
| 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 | |
| <a href="https://www.eclipse.org/legal/epl-2.0/">https://www.eclipse.org/legal/epl-2.0/</a> | |
| </documentation> | |
| </annotation> | |
| </schema> |