Package ghidra.app.util.bin.format.golang.structmapping

# Interface StructureMarkup<T>

Type Parameters:
  `T` - structure mapped class

All Known Implementing Classes:
  `GoArrayType`, `GoChanType`, `GoFuncData`, `GoFuncType`, `GoIMethod`, `GoInterfaceType`, `GoItab`, `GoMapType`, `GoMethod`, `GoModuledata`, `GoName`, `GoPlainType`, `GoPointerType`, `GoSlice`, `GoSliceType`, `GoString`, `GoStructType`, `GoType`

public interface StructureMarkup<T>
Optional interface that structure mapped classes can implement that allows them to control how their class is marked up.

TODO: possibly refactor these methods to take a StructureContext parameter, which will allow removing the getStructureContext method.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `additionalMarkup(MarkupSession session)`
  Called to allow the implementor to perform custom markup of itself.
  `default List<?>`
  `getExternalInstancesToMarkup()`
  Returns a list of items that should be recursively marked up.
  `StructureContext<T>`
  `getStructureContext()`
  `default String`
  `getStructureLabel()`
  Returns a string that can be used to place a label on the instance.
  `default String`
  `getStructureName()`
  Returns the name of the instance, typically retrieved from data found inside the instance.
  `default String`
  `getStructureNamespace()`
  Returns the namespace that any labels should be placed in.

- ## Method Details

  - ### getStructureContext

    StructureContext<T> getStructureContext()

  - ### getStructureName

    default String getStructureName() throws IOException
    Returns the name of the instance, typically retrieved from data found inside the instance.
    Returns:
      string name, or null if this instance does not have a name
    Throws:
      `IOException` - if error getting name

  - ### getStructureLabel

    default String getStructureLabel() throws IOException
    Returns a string that can be used to place a label on the instance.

    This default implementation will query the `getStructureName()` method, and if it provides a value, will produce a string that looks like "name___mappingstructname", where "mappingstructname" will be the `structureName` value in the `@StructureMapping` annotation.

    Returns:
      string to be used as a label, or null if there is not a valid label for the instance
    Throws:
      `IOException` - if error getting label

  - ### getStructureNamespace

    default String getStructureNamespace() throws IOException
    Returns the namespace that any labels should be placed in.
    Returns:
      name of namespace to place the label for this structure mapped type, or null
    Throws:
      `IOException` - if error generating namespace name

  - ### additionalMarkup

    default void additionalMarkup(MarkupSession session) throws IOException, CancelledException
    Called to allow the implementor to perform custom markup of itself.
    Parameters:
      `session` - state and methods to assist marking up the program
    Throws:
      `IOException` - if error during markup
      `CancelledException` - if cancelled

  - ### getExternalInstancesToMarkup

    default List<?> getExternalInstancesToMarkup() throws IOException
    Returns a list of items that should be recursively marked up.
    Returns:
      list of structure mapped object instances that should be marked up
    Throws:
      `IOException` - if error getting instances