Package ghidra.feature.vt.api.util
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
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
hashCode()
toString()
-
Field Details
-
DELIMITER
- See Also:
-
DOUBLE_DELIMITER
- See Also:
-
-
Constructor Details
-
Stringable
-
-
Method Details
-
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 interfacedocking.widgets.table.DisplayStringProvider
-
doConvertToString
-
doRestoreFromString
protected abstract void doRestoreFromString(String string, ghidra.program.model.listing.Program program) -
getString
-
getStringable
public static Stringable getStringable(String valueString, ghidra.program.model.listing.Program program) -
equals
-
hashCode
public abstract int hashCode() -
toString
-
encodeString
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
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.
-