org.eclipse.mat.query.registry
Class QueryDescriptor

java.lang.Object
  extended by org.eclipse.mat.query.registry.AnnotatedObjectDescriptor
      extended by org.eclipse.mat.query.registry.QueryDescriptor
All Implemented Interfaces:
IAnnotatedObjectDescriptor

public class QueryDescriptor
extends AnnotatedObjectDescriptor

A description of a query to be run on a snapshot, though this class is independent of the actual snapshot and uses IQueryContext.


Method Summary
 boolean accept(IQueryContext context)
          Can the query be satisfied by the current context, possibly with other user supplied arguments?
 ArgumentSet createNewArgumentSet(IQueryContext context)
          Create ArgumentSet.
 java.lang.String explain(IQueryContext context)
          Explain any parameters which cannot be filled in from the provided context.
 ArgumentDescriptor getArgumentByName(java.lang.String name)
           
 java.lang.String getCategory()
          The menu category provided by Category.
 java.lang.Class<? extends IQuery> getCommandType()
          The type of the query object, to be instantiated and the arguments injected when the query is run.
 java.util.List<QueryDescriptor> getMenuEntries()
           
 java.lang.String getShortDescription()
          A short description of the query - about 80 characters, truncated from the full help at a sentence boundary.
 boolean isShallow()
          Whether to not prompt the user for further arguments.
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.mat.query.registry.AnnotatedObjectDescriptor
addParameter, getArguments, getHelp, getHelpLocale, getHelpUrl, getIcon, getIdentifier, getName, getUsage, isHelpAvailable, setUsage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCategory

public java.lang.String getCategory()
The menu category provided by Category.

Returns:
the category as a translated string

getCommandType

public java.lang.Class<? extends IQuery> getCommandType()
The type of the query object, to be instantiated and the arguments injected when the query is run.

Returns:
the type, suitable for instantiation with Class.newInstance()

createNewArgumentSet

public ArgumentSet createNewArgumentSet(IQueryContext context)
                                 throws SnapshotException
Create ArgumentSet.

Throws:
SnapshotException

getShortDescription

public java.lang.String getShortDescription()
A short description of the query - about 80 characters, truncated from the full help at a sentence boundary.

Returns:
a translated short description

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

accept

public boolean accept(IQueryContext context)
Can the query be satisfied by the current context, possibly with other user supplied arguments?

Parameters:
context -
Returns:
true if the query is suitable for use with the current context

explain

public java.lang.String explain(IQueryContext context)
Explain any parameters which cannot be filled in from the provided context.

Parameters:
context -
Returns:
a description of the problem arguments

getArgumentByName

public ArgumentDescriptor getArgumentByName(java.lang.String name)

getMenuEntries

public java.util.List<QueryDescriptor> getMenuEntries()

isShallow

public boolean isShallow()
Whether to not prompt the user for further arguments.

Returns:
false if the query is a standard query where the user can be asked for more arguments