|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTranslatableAnalyzer
com.ibm.dtfj.analyzer.base.SimpleAnalyzerBean
com.ibm.dtfj.analyzer.helpers.ValueWrapper
com.ibm.dtfj.analyzer.helpers.objectwrapper.ObjectWrapper
public class ObjectWrapper
Represent one object or primitive field value extracted from the dump, and allow navigation through the
object tree starting at this object instance
Print the values of field of various objects in the tree, specified through an XPath like syntax.
Field Summary | |
---|---|
static int |
MODE_ALL
Options to print full info at the end of a startPrintGroup() / endPrintGroup() |
static int |
MODE_DEFAULT
Default options for the info at the end of a startPrintGroup() / endPrintGroup() |
static int |
MODE_INCLUDE_HEADER
Include a header for the "omitted fields" section |
static int |
MODE_INCLUDE_SIGNATURE
Include the signature of the field |
static int |
MODE_NONE
Place-holder option to indicate that no additional information should be generated at the end of a startPrintGroup() / endPrintGroup() block. |
static int |
MODE_SHOW_INSTANCE_FINAL_FIELDS
Include a printout at the end of a startPrintGroup() / endPrintGroup() block
of all the non-final instance fields from the object represented by this ObjectWrapper that have not
been otherwise printed or traversed by calls within that startPrintGroup() / endPrintGroup() block. |
static int |
MODE_SHOW_INSTANCE_NONFINAL_FIELDS
Include a printout at the end of a startPrintGroup() / endPrintGroup() block
of all the non-final instance fields from the object represented by this ObjectWrapper that have not
been otherwise printed or traversed by calls within that startPrintGroup() / endPrintGroup() block. |
static int |
MODE_SHOW_STATIC_FINAL_FIELDS
Include a printout at the end of a startPrintGroup() / endPrintGroup() block
of all the final static fields from the object represented by this ObjectWrapper that have not
been otherwise printed or traversed by calls within that startPrintGroup() / endPrintGroup() block. |
static int |
MODE_SHOW_STATIC_NONFINAL_FIELDS
Include a printout at the end of a startPrintGroup() / endPrintGroup() block
of all the final static fields from the object represented by this ObjectWrapper that have not
been otherwise printed or traversed by calls within that startPrintGroup() / endPrintGroup() block. |
static int |
MODE_SPECIAL_FULL_REPORT
Print a complete object report for this object. |
Constructor Summary | |
---|---|
ObjectWrapper()
|
Method Summary | |
---|---|
boolean |
checkMaskedField(java.lang.String fieldName)
Check if a given field should be masked (because it contains a password) |
void |
endPrintGroup()
Mark the end of a group of fields started with startPrintGroup(IAnalysisReport, String, Object, int, String) . |
int |
getCachingPriority()
Avoid caching ObjectWrapper objects (there are too many of them, and they are cheap to re-create) |
static ObjectWrapper |
getInstance(IAnalyzerContext context,
java.lang.Object parent)
Create a ObjectWrapper bean instance associated with a given parent object. |
ObjectWrapper |
getValueAtPath(java.lang.String path)
Return the object found at the end of a sequence of field references starting with the current object or static class, as an ObjectWrapper |
ObjectWrapper |
getValueAtPath(java.lang.String path,
java.lang.String wrapperName)
Return the object found at the end of a sequence of field references starting with the current object or static class, as an arbitrary wrapper type. |
java.lang.String |
getVersion()
Get version information for this analyser. |
ObjectWrapper |
printCollectionEntriesAtPath(IAnalysisReport out,
java.lang.String collectionLabel,
java.lang.String entryLabel,
java.lang.String path,
java.lang.String collectionAnalyzerName)
Print a list of all the entries inside a collection object found at the end of a sequence of field references, starting with the current object, using the default format for an ObjectWrapper. |
ObjectWrapper |
printCollectionEntriesAtPath(IAnalysisReport out,
java.lang.String collectionLabel,
java.lang.String entryLabel,
java.lang.String path,
java.lang.String collectionAnalyzerName,
java.lang.String entryWrapperName)
Print a list of all the entries inside a collection object found at the end of a sequence of field references, starting with the current object, using an arbitrary wrapper type to control the format. |
ObjectWrapper |
printCollectionMapEntryReportsAtPath(IAnalysisReport out,
java.lang.String collectionLabel,
java.lang.String entryLabel,
java.lang.String path,
java.lang.String collectionAnalyzerName,
java.lang.String entryAnalyzerName)
Print a report on each of the entries inside a map object found at the end of a sequence of field references, starting with the current object. |
ObjectWrapper |
printCollectionSizeAtPath(IAnalysisReport out,
java.lang.String collectionLabel,
java.lang.String path,
java.lang.String collectionAnalyzerName)
Print the size of a collection of entries represented by a collection object found at the end of a sequence of field references, starting with the current object. |
ObjectWrapper |
printCollectionValueReportsAtPath(IAnalysisReport out,
java.lang.String collectionLabel,
java.lang.String entryLabel,
java.lang.String path,
java.lang.String collectionAnalyzerName,
java.lang.String entryAnalyzerName)
Print a report on each of the entries inside a collection object found at the end of a sequence of field references, starting with the current object. |
ObjectWrapper |
printReportAtPath(IAnalysisReport out,
java.lang.String label,
java.lang.String path,
java.lang.String wrapperName)
Print a report on the object found at the end of a sequence of field references, starting with the current object. |
ObjectWrapper |
printValueAtPath(IAnalysisReport out,
java.lang.String label,
java.lang.String path)
Print the object or value found at the end of a sequence of field references starting with the current object, using the default format for an ObjectWrapper. |
ObjectWrapper |
printValueAtPath(IAnalysisReport out,
java.lang.String label,
java.lang.String path,
java.lang.String wrapperName)
Print the object or value found at the end of a sequence of field references, starting with the current object, using an arbitrary wrapper type to control the format. |
IAnalysisReport |
produceReport()
Generate a report which will be encapsulated in the IAnalysisReport object for later use by some formatter. |
void |
setMaskedFieldPattern(java.lang.String pattern)
Set a non-default pattern for determining the names of fields that should be masked because they contain a password. |
IAnalysisReport |
startPrintGroup(IAnalysisReport out,
java.lang.String label,
java.lang.Object refKey,
int mode,
java.lang.String formatTag)
Mark the start of a group of fields printed through a sequence calls to printValueAtPath() ,etc. |
java.lang.String |
toString()
|
Methods inherited from class com.ibm.dtfj.analyzer.helpers.ValueWrapper |
---|
equals, getBooleanValue, getByteValue, getCharacterValue, getDoubleValue, getFloatValue, getIntegerValue, getJavaClassValue, getJavaObjectValue, getLongValue, getObjectWrapper, getObjectWrapper, getOneJavaClassValue, getOneJavaObjectValue, getRawValue, getShortValue, getStringValue, getTypeSignature, getValueWrapperInstance, hashCode, isBoolean, isByte, isCharacter, isDouble, isFloat, isInstanceOf, isInteger, isJavaClass, isJavaObject, isLong, isShort, isString, setParent |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MODE_SHOW_INSTANCE_NONFINAL_FIELDS
startPrintGroup() / endPrintGroup()
block
of all the non-final instance fields from the object represented by this ObjectWrapper that have not
been otherwise printed or traversed by calls within that startPrintGroup() / endPrintGroup()
block.
public static final int MODE_SHOW_STATIC_NONFINAL_FIELDS
startPrintGroup() / endPrintGroup()
block
of all the final static fields from the object represented by this ObjectWrapper that have not
been otherwise printed or traversed by calls within that startPrintGroup() / endPrintGroup()
block.
public static final int MODE_SHOW_INSTANCE_FINAL_FIELDS
startPrintGroup() / endPrintGroup()
block
of all the non-final instance fields from the object represented by this ObjectWrapper that have not
been otherwise printed or traversed by calls within that startPrintGroup() / endPrintGroup()
block.
public static final int MODE_SHOW_STATIC_FINAL_FIELDS
startPrintGroup() / endPrintGroup()
block
of all the final static fields from the object represented by this ObjectWrapper that have not
been otherwise printed or traversed by calls within that startPrintGroup() / endPrintGroup()
block.
public static final int MODE_INCLUDE_SIGNATURE
public static final int MODE_INCLUDE_HEADER
public static final int MODE_SPECIAL_FULL_REPORT
public static final int MODE_NONE
startPrintGroup() / endPrintGroup()
block.
public static final int MODE_DEFAULT
startPrintGroup() / endPrintGroup()
public static final int MODE_ALL
startPrintGroup() / endPrintGroup()
Constructor Detail |
---|
public ObjectWrapper()
Method Detail |
---|
public java.lang.String getVersion()
IAnalyzerBase
getVersion
in interface IAnalyzerBase
getVersion
in class ValueWrapper
Override the default from SimpleAnalyzerBean ("EXPERIMENTAL").
The version number is typically not defined for small wrappers.
public static ObjectWrapper getInstance(IAnalyzerContext context, java.lang.Object parent)
context
- the AnalyzerContext in which to locate this bean instanceparent
- the parent Object underlying this analyzer bean
public int getCachingPriority()
getCachingPriority
in interface IAnalyzerBase
getCachingPriority
in class ValueWrapper
SimpleAnalyzerBean.getCachingPriority()
public ObjectWrapper getValueAtPath(java.lang.String path) throws com.ibm.dtfj.image.DTFJException
path
- a path-like string that represents the sequence of field names, separated by "/"
com.ibm.dtfj.image.DTFJException
- if the field is not foundpublic ObjectWrapper getValueAtPath(java.lang.String path, java.lang.String wrapperName) throws com.ibm.dtfj.image.DTFJException
path
- a path-like string that represents the sequence of field names, separated by "/"wrapperName
- the name of an analyzer to use as a wrapper for the target value (must be a subclass of ObjectWrapper)
com.ibm.dtfj.image.DTFJException
- if the field is not foundpublic ObjectWrapper printValueAtPath(IAnalysisReport out, java.lang.String label, java.lang.String path)
out
- a AnalysisReport object to which to write the outputlabel
- a name to use for this field in the reportpath
- a path-like string that represents the sequence of field names, separated by "/"
public ObjectWrapper printValueAtPath(IAnalysisReport out, java.lang.String label, java.lang.String path, java.lang.String wrapperName)
out
- a AnalysisReport object to which to write the outputlabel
- a name to use for this field in the reportpath
- a path-like string that represents the sequence of field names, separated by "/"wrapperName
- the name of an analyzer to use as a wrapper for the target value (must be a subclass of ObjectWrapper)
public ObjectWrapper printReportAtPath(IAnalysisReport out, java.lang.String label, java.lang.String path, java.lang.String wrapperName)
This method loads a specified analyzer and invokes its produceReport()
method on the target object to generate a new report, which is then embedded in the
main report.
out
- a AnalysisReport object to which to write the outputlabel
- a name to use as title for the report being generatedpath
- a path-like string that represents the sequence of field names, separated by "/"wrapperName
- the name of an analyzer that should generate the report to be printed (must be a subclass of ObjectWrapper)
public ObjectWrapper printCollectionEntriesAtPath(IAnalysisReport out, java.lang.String collectionLabel, java.lang.String entryLabel, java.lang.String path, java.lang.String collectionAnalyzerName)
This method loads a specified analyzer to analyze the target object and extract a list of entries from it. This analyzer is expected to implement the Collection interface to provide access to all the entries in the target object (e.g. HashMapWrapper, VectorWrapper, etc.)
out
- a AnalysisReport object to which to write the outputcollectionLabel
- a name to use as title for list of entriesentryLabel
- a name to use as title for individual entries in the listpath
- a path-like string that represents the sequence of field names, separated by "/"collectionAnalyzerName
- the name of an analyzer to use to extract the list of entries from the target object
public ObjectWrapper printCollectionEntriesAtPath(IAnalysisReport out, java.lang.String collectionLabel, java.lang.String entryLabel, java.lang.String path, java.lang.String collectionAnalyzerName, java.lang.String entryWrapperName)
This method loads a specified analyzer to analyze the target object and extract a list of entries from it. This analyzer is expected to implement the Collection interface to provide access to all the entries in the target object (e.g. HashMapWrapper, VectorWrapper, etc.)
out
- a AnalysisReport object to which to write the outputcollectionLabel
- a name to use as title for list of entriesentryLabel
- a name to use as title for individual entries in the listpath
- a path-like string that represents the sequence of field names, separated by "/"collectionAnalyzerName
- the name of an analyzer to use to extract the list of entries from the target objectentryWrapperName
- the name of an analyzer to use as a wrapper for the target value (must be a subclass of ObjectWrapper)
public ObjectWrapper printCollectionMapEntryReportsAtPath(IAnalysisReport out, java.lang.String collectionLabel, java.lang.String entryLabel, java.lang.String path, java.lang.String collectionAnalyzerName, java.lang.String entryAnalyzerName)
This method first loads a specified analyzer to analyze the target object and extract a list
of entries from it. It then loads a second analyzer for each entry and invokes its produceReport()
method. That second analyzer gets passed a Map.Entry for each entry in the map; it is responsible for
printing both the key and value for each entry.
out
- a AnalysisReport object to which to write the outputcollectionLabel
- a name to use as title for list of entriesentryLabel
- a name to use as title for individual entries in the listpath
- a path-like string that represents the sequence of field names, separated by "/"collectionAnalyzerName
- the name of an analyzer to use to extract the list of entries from the target objectentryAnalyzerName
- the name of an analyzer that should generate the report for each entry in the collection.
Must take a Map.Entry as a parent.
public ObjectWrapper printCollectionValueReportsAtPath(IAnalysisReport out, java.lang.String collectionLabel, java.lang.String entryLabel, java.lang.String path, java.lang.String collectionAnalyzerName, java.lang.String entryAnalyzerName)
This method first loads a specified analyzer to analyze the target object and extract a list
of entries from it. It then loads a second analyzer for the value in each entry and invokes its produceReport()
method. That second analyzer gets passed only the value (as an ObjectWrapper); if the collection is
a map, the keys are printed automatically by this method itself.
out
- a AnalysisReport object to which to write the outputcollectionLabel
- a name to use as title for list of entriesentryLabel
- a name to use as title for individual entries in the listpath
- a path-like string that represents the sequence of field names, separated by "/"collectionAnalyzerName
- the name of an analyzer to use to extract the list of entries from the target objectentryAnalyzerName
- the name of an analyzer that should generate the report for each entry in the collection.
Must take a single ObjectWrapper as a parent (for the entry values).
public ObjectWrapper printCollectionSizeAtPath(IAnalysisReport out, java.lang.String collectionLabel, java.lang.String path, java.lang.String collectionAnalyzerName)
This method loads a specified analyzer to analyze the target object and extract a list of entries from it. This analyzer is expected to implement the Collection interface to provide access to all the entries in the target object (e.g. HashMapWrapper, VectorWrapper, etc.)
out
- a AnalysisReport object to which to write the outputcollectionLabel
- a name to use as title for the report entry showing the size of the collectionpath
- a path-like string that represents the sequence of field names, separated by "/"collectionAnalyzerName
- the name of an analyzer to use to extract the list of entries from the target object
public IAnalysisReport startPrintGroup(IAnalysisReport out, java.lang.String label, java.lang.Object refKey, int mode, java.lang.String formatTag)
printValueAtPath()
,etc.
in this ObjectWrapper. This group is wrapped in a report embedded into the main report, so that it appears
as a block in the main report, and so that it can be referenced through printIdent()
elsewhere
in the main report. In addition, the mode
parameter can be used to force printing of additional
information at the end of this group (see #MODE_OBJECT_REPORT
, #MODE_SHOW_OMITTED_FIELDS
).
out
- a IAnalysisReport representing the main report that receives the outputlabel
- a title for the secondary report being generated by this grouprefKey
- a reference key that can be used in calls to printIdent() that reference this secondary report
associated with this groupmode
- a set of options controlling additional information to be generated at the end of the groupformatTag
- any special formatting tags to apply to this group
public void endPrintGroup()
startPrintGroup(IAnalysisReport, String, Object, int, String)
.
Generate any additional output as specified by the mode
parameter to startPrintGroup()
.
public IAnalysisReport produceReport()
IReport
produceReport
in interface IReport
produceReport
in class SimpleAnalyzerBean
IReport.produceReport()
public java.lang.String toString()
Object.toString()
public boolean checkMaskedField(java.lang.String fieldName)
fieldName
- the name of the field
public void setMaskedFieldPattern(java.lang.String pattern)
pattern
- the new pattern, in java.util.regex syntax
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |