Package org.eclipse.mat.query.registry
Class QueryDescriptor
java.lang.Object
org.eclipse.mat.query.registry.AnnotatedObjectDescriptor
org.eclipse.mat.query.registry.QueryDescriptor
- All Implemented Interfaces:
IAnnotatedObjectDescriptor
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
Modifier and TypeMethodDescriptionboolean
accept
(IQueryContext context) Can the query be satisfied by the current context, possibly with other user supplied arguments?createNewArgumentSet
(IQueryContext context) Create ArgumentSet.explain
(IQueryContext context) Explain any parameters which cannot be filled in from the provided context.getArgumentByName
(String name) The menu category provided byCategory
.The type of the query object, to be instantiated and the arguments injected when the query is run.A short description of the query - about 80 characters, truncated from the full help at a sentence boundary.boolean
Whether to not prompt the user for further arguments.toString()
Methods inherited from class org.eclipse.mat.query.registry.AnnotatedObjectDescriptor
addParameter, getArguments, getHelp, getHelpLocale, getHelpUrl, getIcon, getIdentifier, getName, getUsage, isHelpAvailable, setUsage
-
Method Details
-
getCategory
The menu category provided byCategory
.- Returns:
- the category as a translated string
-
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()
orConstructor.newInstance(Object...)
-
createNewArgumentSet
Create ArgumentSet.- Parameters:
context
- The context holding data which could be supplied into the argument set for a query.- Returns:
- The ArgumentSet for a query holding the data from the context required for the query.
- Throws:
SnapshotException
- if there is a problem creating an argument set from the context.
-
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
-
accept
Can the query be satisfied by the current context, possibly with other user supplied arguments?- Parameters:
context
- The data that could be supplied, for example the selected objects.- Returns:
- true if the query is suitable for use with the current context
-
explain
Explain any parameters which cannot be filled in from the provided context.- Parameters:
context
- The data that could be supplied, for example the selected objects.- Returns:
- a description of the problem arguments
-
getArgumentByName
-
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
-