public class SnapshotQueryContext extends QueryContextImpl
| Constructor and Description |
|---|
SnapshotQueryContext(ISnapshot snapshot) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
available(Class<?> type,
Argument.Advice advice)
Is this type of data available from the context?
|
boolean |
converts(Class<?> type,
Argument.Advice advice)
Does the context have a converter for data of this type?
|
String |
convertToString(Class<?> type,
Argument.Advice advice,
Object value)
Convert the value to a string.
|
Object |
convertToValue(Class<?> type,
Argument.Advice advice,
String value)
Convert the String to the value based on the type and advice.
|
Object |
get(Class<?> type,
Argument.Advice advice)
Get this type of data from the context.
|
ContextDerivedData |
getContextDerivedData()
For example, retained size derived data.
|
String |
getPrefix()
The prefix for files generated from snapshot
|
File |
getPrimaryFile()
The main file for the snapshot
|
String |
mapToExternalIdentifier(int objectId)
Map an id to a readable form.
|
int |
mapToObjectId(String externalIdentifier)
Map readable form to internal id.
|
Object |
parse(Class<?> type,
Argument.Advice advice,
String[] args,
ParsePosition pos)
Consume the special data.
|
boolean |
parses(Class<?> type,
Argument.Advice advice)
Is special parsing required to get an object of the required type?
|
public SnapshotQueryContext(ISnapshot snapshot)
public File getPrimaryFile()
IQueryContextpublic String getPrefix()
IQueryContextpublic String mapToExternalIdentifier(int objectId) throws SnapshotException
IQueryContextIQueryContext.mapToObjectId(java.lang.String)objectId - The 0-based internal identifier used within MAT.SnapshotException - if the objectId does not match to a valid object.IQueryContext.mapToObjectId(java.lang.String)public int mapToObjectId(String externalIdentifier) throws SnapshotException
IQueryContextIQueryContext.mapToExternalIdentifier(int).externalIdentifier - as provided by IQueryContext.mapToExternalIdentifier(int).SnapshotException - if the external identifier does not match a known object in the snapshot.public boolean available(Class<?> type, Argument.Advice advice)
IQueryContextavailable in interface IQueryContextavailable in class QueryContextImpltype - the type the data should be converted toadvice - advice such as from the query as to how the value should be converted.public Object get(Class<?> type, Argument.Advice advice)
IQueryContextget in interface IQueryContextget in class QueryContextImpltype - the type the data should be converted toadvice - advice such as from the query as to how the value should be converted.public boolean converts(Class<?> type, Argument.Advice advice)
IQueryContextconverts in interface IQueryContextconverts in class QueryContextImpltype - The Java type of an argument to be supplied with data from this context.advice - Further details about the argument to be supplied with data.public String convertToString(Class<?> type, Argument.Advice advice, Object value) throws SnapshotException
IQueryContextconvertToString in interface IQueryContextconvertToString in class QueryContextImpltype - The Java type of the argument.advice - Further details about the argument.value - The value of the argument held in the context.SnapshotException - If there is a problem with the conversion such as the value is not a valid object ID.public Object convertToValue(Class<?> type, Argument.Advice advice, String value) throws SnapshotException
IQueryContextconvertToValue in interface IQueryContextconvertToValue in class QueryContextImpltype - The Java type of the argumentadvice - Further details about the argument.value - The readable string valueSnapshotException - if there is a problem with the conversion, such as an unknown object address.public boolean parses(Class<?> type, Argument.Advice advice)
IQueryContexttype - The Java type of the argument.advice - Further details about the argument.public Object parse(Class<?> type, Argument.Advice advice, String[] args, ParsePosition pos) throws SnapshotException
IQueryContexttype - The Java type of the destination argument.advice - Further details about the argument.args - The source to be convertedpos - Used to index through the array of Strings.SnapshotException - If there is a problem in the parsing.public ContextDerivedData getContextDerivedData()
IQueryContext