Class BaseStructureFormatter
java.lang.Object
com.ibm.j9ddr.tools.ddrinteractive.BaseStructureFormatter
- All Implemented Interfaces:
IStructureFormatter
- Direct Known Subclasses:
BaseStructureCommand.DefaultStructureFormatter
,J9ClassStructureFormatter
,J9MethodStructureFormatter
,J9ModuleStructureFormatter
,J9ObjectStructureFormatter
,J9PackageStructureFormatter
,J9ROMMethodStructureFormatter
Default IStructureFormatter implementation with safe default behaviour
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionformat
(String type, long address, PrintStream out, Context context, List<IFieldFormatter> fieldFormatters, String[] extraArgs) Method called by the Structure command after the preFormat() and before the postFormat() walks.void
formatField
(String name, String type, String declaredType, long address, PrintStream out, Context context) postFormat
(String type, long address, PrintStream out, Context context, List<IFieldFormatter> fieldFormatters, String[] extraArgs) Method called by the Structure command after the format() walk.preFormat
(String type, long address, PrintStream out, Context context, List<IFieldFormatter> fieldFormatters, String[] extraArgs) Method called by the Structure command before the format() method walk.protected void
setFieldFormatters
(List<IFieldFormatter> fieldFormatters)
-
Constructor Details
-
BaseStructureFormatter
public BaseStructureFormatter()
-
-
Method Details
-
setFieldFormatters
-
format
public FormatWalkResult format(String type, long address, PrintStream out, Context context, List<IFieldFormatter> fieldFormatters, String[] extraArgs) Description copied from interface:IStructureFormatter
Method called by the Structure command after the preFormat() and before the postFormat() walks.- Specified by:
format
in interfaceIStructureFormatter
- Parameters:
address
- Address to be formattedout
- PrintStream to write result to. Do not write a new line at the end of your output.context
- Current DDRInteractive contextfieldFormatters
- List of field formatters. This list will be used for other IStructureFormatters, so any changes you make will affect downstream formatters (but only for this formatting operation).extraArgs
- Extra arguments passed by the user after the structure address- Returns:
- KEEP_WALKING if the format walk should keep going (delegating to other formatters), STOP_WALKING if the format walk should stop
-
postFormat
public FormatWalkResult postFormat(String type, long address, PrintStream out, Context context, List<IFieldFormatter> fieldFormatters, String[] extraArgs) Description copied from interface:IStructureFormatter
Method called by the Structure command after the format() walk.- Specified by:
postFormat
in interfaceIStructureFormatter
- Parameters:
address
- Address to be formattedout
- PrintStream to write result to. Do not write a new line at the end of your output.context
- Current DDRInteractive contextfieldFormatters
- List of field formatters. This list will be used for other IStructureFormatters, so any changes you make will affect downstream formatters (but only for this formatting operation).extraArgs
- Extra arguments passed by the user after the structure address- Returns:
- KEEP_WALKING if the format walk should keep going (delegating to other formatters), STOP_WALKING if the format walk should stop
-
preFormat
public FormatWalkResult preFormat(String type, long address, PrintStream out, Context context, List<IFieldFormatter> fieldFormatters, String[] extraArgs) Description copied from interface:IStructureFormatter
Method called by the Structure command before the format() method walk.- Specified by:
preFormat
in interfaceIStructureFormatter
- Parameters:
address
- Address to be formattedout
- PrintStream to write result to. Do not write a new line at the end of your output.context
- Current DDRInteractive contextfieldFormatters
- List of field formatters. This list will be used for other IStructureFormatters, so any changes you make will affect downstream formatters (but only for this formatting operation).extraArgs
- Extra arguments passed by the user after the structure address- Returns:
- KEEP_WALKING if the format walk should keep going (delegating to other formatters), STOP_WALKING if the format walk should stop
-
formatField
public void formatField(String name, String type, String declaredType, long address, PrintStream out, Context context) throws CorruptDataException - Specified by:
formatField
in interfaceIStructureFormatter
- Parameters:
name
- Name of fieldtype
- Type of field e.g. struct J9JavaVMdeclaredType
- The type as declared in native codeaddress
- Address of field slotout
- PrintStream to format tocontext
- DDRInteractive context- Throws:
CorruptDataException
- If there's a problem accessing the field
-