Class Stringable

java.lang.Object
ghidra.feature.vt.api.util.Stringable
All Implemented Interfaces:
docking.widgets.table.DisplayStringProvider, ghidra.util.classfinder.ExtensionPoint
Direct Known Subclasses:
DataTypeStringable, FunctionNameStringable, FunctionSignatureStringable, LocalVariableStringable, MultipleLocalVariableStringable, MultipleParameterStringable, MultipleSymbolStringable, ParameterStringable, StringStringable, SymbolStringable

public abstract class Stringable extends Object implements ghidra.util.classfinder.ExtensionPoint, docking.widgets.table.DisplayStringProvider
Generically, this represents the concept that the implementation of this class is an item that can be turned into a String and restored from String form. This is similar to Java's Bean serialization mechanism, which allows you to turn object to Strings and then back again.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Stringable(String shortName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static String
    decodeString(String encodedComment)
    Decodes a encoded comment string that may contain encoded tabs, carriage returns, and linefeeds back to its original form where tabs, carriage returns, and linefeeds were not intended as delimiters for separating tokens within a Stringable.
    protected abstract String
    doConvertToString(ghidra.program.model.listing.Program program)
     
    protected abstract void
    doRestoreFromString(String string, ghidra.program.model.listing.Program program)
     
    protected static String
    encodeString(String unencodedComment)
    Encodes a comment string that may contain tabs, carriage returns, and linefeeds so that it can be saved as part of a Stringable.
    abstract boolean
    equals(Object other)
     
    abstract String
    getDisplayString() returns a display string for this stringable.
    Note: It must not return a null.
    static String
    getString(Stringable stringable, ghidra.program.model.listing.Program program)
     
    static Stringable
    getStringable(String valueString, ghidra.program.model.listing.Program program)
     
    abstract int
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • Stringable

      protected Stringable(String shortName)
  • Method Details

    • getDisplayString

      public abstract String getDisplayString()
      getDisplayString() returns a display string for this stringable.
      Note: It must not return a null. Instead it should return an empty string if it has no value.
      Specified by:
      getDisplayString in interface docking.widgets.table.DisplayStringProvider
    • doConvertToString

      protected abstract String doConvertToString(ghidra.program.model.listing.Program program)
    • doRestoreFromString

      protected abstract void doRestoreFromString(String string, ghidra.program.model.listing.Program program)
    • getString

      public static String getString(Stringable stringable, ghidra.program.model.listing.Program program)
    • getStringable

      public static Stringable getStringable(String valueString, ghidra.program.model.listing.Program program)
    • equals

      public abstract boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public abstract int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • encodeString

      protected static String encodeString(String unencodedComment)
      Encodes a comment string that may contain tabs, carriage returns, and linefeeds so that it can be saved as part of a Stringable. Tabs, carriage returns, and linefeeds are typically used as delimiters for separating tokens within the Stringable.
      Parameters:
      unencodedComment - the actual comment text containing tabs, etc.
      Returns:
      the encoded comment to be saved as part of the stringable.
    • decodeString

      protected static String decodeString(String encodedComment)
      Decodes a encoded comment string that may contain encoded tabs, carriage returns, and linefeeds back to its original form where tabs, carriage returns, and linefeeds were not intended as delimiters for separating tokens within a Stringable.
      Parameters:
      encodedComment - the encoded comment that was saved as part of the stringable.
      Returns:
      the actual unencoded comment text containing tabs, etc.