Package org.eclipse.mat.query.registry
Class AnnotatedObjectDescriptor
- java.lang.Object
-
- org.eclipse.mat.query.registry.AnnotatedObjectDescriptor
-
- All Implemented Interfaces:
IAnnotatedObjectDescriptor
- Direct Known Subclasses:
HeapDumpProviderDescriptor,QueryDescriptor,VmInfoDescriptor
public class AnnotatedObjectDescriptor extends java.lang.Object implements IAnnotatedObjectDescriptor
A description of the meta information attached to a class such as a query or heap dump provider.
-
-
Constructor Summary
Constructors Constructor Description AnnotatedObjectDescriptor(java.lang.String identifier, java.lang.String name, java.lang.String usage, java.net.URL icon, java.lang.String help, java.lang.String helpUrl, java.util.Locale helpLocale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParameter(ArgumentDescriptor descriptor)java.util.List<ArgumentDescriptor>getArguments()Get descriptors for the fields annotated by the annotationArgument.java.lang.StringgetHelp()Get the help String, for example provided by the annotationHelp.java.util.LocalegetHelpLocale()Get the help localejava.lang.StringgetHelpUrl()Get the help URL, for example provided by the annotationHelpUrl.java.net.URLgetIcon()Get the Icon representing the annotated object, for example provided by the annotationIcon.java.lang.StringgetIdentifier()Get the identifier for the annotated object, for example provided by the annotationCommandNameorIAnnotatedObjectDescriptor.getName().java.lang.StringgetName()Get the name, for example provided by the annotationName.java.lang.StringgetUsage(IQueryContext context)Get the usage information, for example provided by the annotationUsage, or by a combination of theIAnnotatedObjectDescriptor.getIdentifier()andArgumentDescriptor.appendUsage(java.lang.StringBuilder).booleanisHelpAvailable()Check if the object has provided some help via annotations.voidsetUsage(java.lang.String usage)
-
-
-
Method Detail
-
getUsage
public java.lang.String getUsage(IQueryContext context)
Description copied from interface:IAnnotatedObjectDescriptorGet the usage information, for example provided by the annotationUsage, or by a combination of theIAnnotatedObjectDescriptor.getIdentifier()andArgumentDescriptor.appendUsage(java.lang.StringBuilder).- Specified by:
getUsagein interfaceIAnnotatedObjectDescriptor- Parameters:
context- used to fill in some arguments leaving usage to explain the remainder- Returns:
- the usage information for that query
-
getIcon
public java.net.URL getIcon()
Description copied from interface:IAnnotatedObjectDescriptorGet the Icon representing the annotated object, for example provided by the annotationIcon.- Specified by:
getIconin interfaceIAnnotatedObjectDescriptor- Returns:
- the Icon as a URL
-
setUsage
public void setUsage(java.lang.String usage)
-
getIdentifier
public java.lang.String getIdentifier()
Description copied from interface:IAnnotatedObjectDescriptorGet the identifier for the annotated object, for example provided by the annotationCommandNameorIAnnotatedObjectDescriptor.getName().- Specified by:
getIdentifierin interfaceIAnnotatedObjectDescriptor- Returns:
- the identifier
-
getName
public java.lang.String getName()
Description copied from interface:IAnnotatedObjectDescriptorGet the name, for example provided by the annotationName.- Specified by:
getNamein interfaceIAnnotatedObjectDescriptor- Returns:
- the name
-
getHelp
public java.lang.String getHelp()
Description copied from interface:IAnnotatedObjectDescriptorGet the help String, for example provided by the annotationHelp.- Specified by:
getHelpin interfaceIAnnotatedObjectDescriptor- Returns:
- the help
-
getHelpUrl
public java.lang.String getHelpUrl()
Description copied from interface:IAnnotatedObjectDescriptorGet the help URL, for example provided by the annotationHelpUrl.- Specified by:
getHelpUrlin interfaceIAnnotatedObjectDescriptor- Returns:
- the help URL
-
getHelpLocale
public java.util.Locale getHelpLocale()
Description copied from interface:IAnnotatedObjectDescriptorGet the help locale- Specified by:
getHelpLocalein interfaceIAnnotatedObjectDescriptor- Returns:
- the locale
-
getArguments
public java.util.List<ArgumentDescriptor> getArguments()
Description copied from interface:IAnnotatedObjectDescriptorGet descriptors for the fields annotated by the annotationArgument. TODO Should this have been IArgumentDescriptor ?- Specified by:
getArgumentsin interfaceIAnnotatedObjectDescriptor- Returns:
- the list of annotated arguments, see
ArgumentDescriptor
-
isHelpAvailable
public boolean isHelpAvailable()
Description copied from interface:IAnnotatedObjectDescriptorCheck if the object has provided some help via annotations.- Specified by:
isHelpAvailablein interfaceIAnnotatedObjectDescriptor- Returns:
- true if the object or arguments were annotated with
Help.
-
addParameter
public void addParameter(ArgumentDescriptor descriptor)
-
-