-
- All Known Implementing Classes:
ArrayFormatter
,BaseFieldFormatter
,BoolFormatter
,CStringFieldFormatter
,DoubleFormatter
,EnumFormatter
,FloatFormatter
,J9ClassFieldFormatter
,J9ConstantPoolFieldFormatter
,J9MethodFieldFormatter
,J9ObjectFieldFormatter
,J9SRPFormatter
,PointerFormatter
,ScalarFormatter
,StructureFormatter
,StructurePointerFormatter
,U64ScalarFormatter
,VoidFormatter
public interface IFieldFormatter
Interface for objects that format fields in structures. e.g. turning struct J9NativeLibrary * librariesTail into !j9nativelibrary 0x0019CDA8 The IFieldFormatters form a chain of responsibility. The structure ICommand calls each IFieldFormatter in turn three times. The first pass calls preFormat() (stopping either when a IFieldFormatter returns STOP_WALKING, or the end of the chain is reached.) The second pass calls format() - where the default formatting behaviour is run. The third pass calls postFormat()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FormatWalkResult
format(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter)
Method called by the Structure command to format a field, after preFormat() and before postFormat()FormatWalkResult
postFormat(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter)
Method called by the Structure command after preFormat() and format().FormatWalkResult
preFormat(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter)
Method called by the Structure command before the format() method walk.
-
-
-
Method Detail
-
preFormat
FormatWalkResult preFormat(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException
Method called by the Structure command before the format() method walk.- Parameters:
name
- Name of field being formatted.type
- Type of field to be formatted. E.g. struct J9JavaVMdeclaredType
- Type as declared in C. E.g. This may be char* where type is U8*typeCode
- StructureHelper type code. E.g. TYPE_STRUCTUREaddress
- Address of field to be formattedout
- PrintStream to write result to. Do not write a new line at the end of your output.context
- Current DDRInteractive contextformattingDirector
- FormattingDirector; useful if you need to rerun a different field format (e.g. when working with J9SRPs)- Returns:
- KEEP_WALKING if the format walk should keep going (delegating to other formatters), STOP_WALKING if the format walk should stop
- Throws:
CorruptDataException
-
format
FormatWalkResult format(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException
Method called by the Structure command to format a field, after preFormat() and before postFormat()- Parameters:
name
- Name of field being formatted.type
- Type of field to be formatted. E.g. struct J9JavaVMdeclaredType
- Type as declared in C. E.g. This may be char* where type is U8*typeCode
- StructureHelper type code. E.g. TYPE_STRUCTUREaddress
- Address of field to be formattedout
- PrintStream to write result to. Do not write a new line at the end of your output.context
- Current DDRInteractive contextformattingDirector
- FormattingDirector; useful if you need to rerun a different field format (e.g. when working with J9SRPs)- Returns:
- KEEP_WALKING if the format walk should keep going (delegating to other formatters), STOP_WALKING if the format walk should stop
- Throws:
CorruptDataException
-
postFormat
FormatWalkResult postFormat(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException
Method called by the Structure command after preFormat() and format().- Parameters:
name
- Name of field being formatted.type
- Type of field to be formatted. E.g. struct J9JavaVMdeclaredType
- Type as declared in C. E.g. This may be char* where type is U8*typeCode
- StructureHelper type code. E.g. TYPE_STRUCTUREaddress
- Address of field to be formattedout
- PrintStream to write result to. Do not write a new line at the end of your output.context
- Current DDRInteractive contextstructureFormatter
- StructureFormatter; useful if you need to rerun a different field format (e.g. when working with J9SRPs)- Returns:
- KEEP_WALKING if the format walk should keep going (delegating to other formatters), STOP_WALKING if the format walk should stop
- Throws:
CorruptDataException
-
-