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
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.String
explain(IQueryContext context)
Explain any parameters which cannot be filled in from the provided context.ArgumentDescriptor
getArgumentByName(String name)
String
getCategory()
The menu category provided byCategory
.Class<? extends IQuery>
getCommandType()
The type of the query object, to be instantiated and the arguments injected when the query is run.List<QueryDescriptor>
getMenuEntries()
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.String
toString()
-
Methods inherited from class org.eclipse.mat.query.registry.AnnotatedObjectDescriptor
addParameter, getArguments, getHelp, getHelpLocale, getHelpUrl, getIcon, getIdentifier, getName, getUsage, isHelpAvailable, setUsage
-
-
-
-
Method Detail
-
getCategory
public String getCategory()
The menu category provided byCategory
.- Returns:
- the category as a translated string
-
getCommandType
public 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()
orConstructor.newInstance(Object...)
-
createNewArgumentSet
public ArgumentSet createNewArgumentSet(IQueryContext context) throws SnapshotException
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
public 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
-
accept
public boolean accept(IQueryContext context)
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
public String explain(IQueryContext context)
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
public ArgumentDescriptor getArgumentByName(String name)
-
getMenuEntries
public 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
-
-