Module openj9.dtfj

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

public abstract class BaseStructureFormatter extends Object implements IStructureFormatter
Default IStructureFormatter implementation with safe default behaviour
  • Constructor Details

    • BaseStructureFormatter

      public BaseStructureFormatter()
  • Method Details

    • setFieldFormatters

      protected void setFieldFormatters(List<IFieldFormatter> fieldFormatters)
    • 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 interface IStructureFormatter
      address - Address to be formatted
      out - PrintStream to write result to. Do not write a new line at the end of your output.
      context - Current DDRInteractive context
      fieldFormatters - 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 interface IStructureFormatter
      address - Address to be formatted
      out - PrintStream to write result to. Do not write a new line at the end of your output.
      context - Current DDRInteractive context
      fieldFormatters - 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 interface IStructureFormatter
      address - Address to be formatted
      out - PrintStream to write result to. Do not write a new line at the end of your output.
      context - Current DDRInteractive context
      fieldFormatters - 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 interface IStructureFormatter
      Parameters:
      name - Name of field
      type - Type of field e.g. struct J9JavaVM
      declaredType - The type as declared in native code
      address - Address of field slot
      out - PrintStream to format to
      context - DDRInteractive context
      Throws:
      CorruptDataException - If there's a problem accessing the field