Class SymbolType

java.lang.Object
ghidra.program.model.symbol.SymbolType

public abstract class SymbolType extends Object
Class to represent the various types of Symbols.
  • Field Details

  • Method Details

    • isValidParent

      public abstract boolean isValidParent(Program program, Namespace parent, Address symbolAddr, boolean isExternalSymbol)
      Returns true if the given namespace is a valid parent for a symbol of this type if it has the given address and whether or not it is external.
      Parameters:
      program - the program to contain the symbol
      parent - the namespace where a symbol will potentially be parented.
      symbolAddr - the address of they symbol to be parented.
      isExternalSymbol - true if the symbol is external.
      Returns:
      true if the given namespace is a valid parent for a symbol if it has the given address and whether or not it is external.
    • isValidAddress

      public abstract boolean isValidAddress(Program program, Address symbolAddress)
      Returns true if the given address is valid for this symbol type.
      Parameters:
      program - the program to test for a valid address.
      symbolAddress - the address of the symbol to be tested.
      Returns:
      true if the given address is valid within the given program.
    • isValidSourceType

      public abstract boolean isValidSourceType(SourceType sourceType, Address symbolAddress)
      Returns true if the given SourceType is valid for this symbol type. (For example, Some symbols don't support the SymbolType.DEFAULT)
      Parameters:
      sourceType - the sourceType to test.
      symbolAddress - the address of the symbol to be tested.
      Returns:
      true if the given SourceType is valid for this symbol type.
    • allowsDuplicates

      public boolean allowsDuplicates()
      Returns true of this symbol type allows duplicate names.
      Returns:
      true of this symbol type allows duplicate names.
    • isNamespace

      public boolean isNamespace()
      Returns true if this symbol represents a namespace.
    • toString

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

      public byte getID()
      Returns the id of this symbol type.
    • getSymbolType

      public static SymbolType getSymbolType(int id)
      Returns the SymbolType for the given id.
      Parameters:
      id - the id for the SymbolType to find.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object