Enum Class SourceType

java.lang.Object
java.lang.Enum<SourceType>
ghidra.program.model.symbol.SourceType
All Implemented Interfaces:
Serializable, Comparable<SourceType>, Constable

public enum SourceType extends Enum<SourceType>
SourceType provides a prioritized indication as to the general source of a specific markup made to a Program. The priority of each defined source type may be used to restrict impact or protect the related markup. Source types include: USER_DEFINED, which is higher priority than IMPORTED, which is higher priority than ANALYSIS, which is higher priority than DEFAULT. The AI source type is primarliy intended to allow AI generated markup to be identified and currently has the same priority as ANALYSIS.
  • Enum Constant Details

    • DEFAULT

      public static final SourceType DEFAULT
      The object's source indicator for a default.
    • ANALYSIS

      public static final SourceType ANALYSIS
      The object's source indicator for an auto analysis.
    • AI

      public static final SourceType AI
      The object's source indicator for something that was produced with AI assistance.
    • IMPORTED

      public static final SourceType IMPORTED
      The object's source indicator for an imported.
    • USER_DEFINED

      public static final SourceType USER_DEFINED
      The object's source indicator for a user defined.
  • Method Details

    • values

      public static SourceType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SourceType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getSourceType

      public static SourceType getSourceType(int storageId)
      Get the SourceType which corresponds to the specified storage ID.
      Parameters:
      storageId - storage ID
      Returns:
      SourceType
      Throws:
      NoSuchElementException - if specified storage ID is not defined.
    • getPriority

      public int getPriority()
      Returns numeric priority relative to other SourceType. Higher numbers are higher priority..
      Returns:
      numeric priority relative to other SourceType. Higher numbers are higher priority.
    • getStorageId

      public int getStorageId()
      Returns the storage ID which should be used for persistent serialization.
      Returns:
      the storage ID which should be used for persistent serialization
    • getDisplayString

      public String getDisplayString()
      Returns a user-friendly string.
      Returns:
      a user-friendly string
    • isHigherPriorityThan

      public boolean isHigherPriorityThan(SourceType source)
      Determine if this source type has a higher priority than the one being passed to this method as a parameter.
      Parameters:
      source - the source type whose priority is to be compared with this one's.
      Returns:
      true if this source type is a higher priority. false if this source type is the same priority or lower priority.
    • isHigherOrEqualPriorityThan

      public boolean isHigherOrEqualPriorityThan(SourceType source)
      Determine if this source type has the same or higher priority than the one being passed to this method as a parameter.
      Parameters:
      source - the source type whose priority is to be compared with this one's.
      Returns:
      true if this source type is a higher priority. false if this source type is the same priority or lower priority.
    • isLowerPriorityThan

      public boolean isLowerPriorityThan(SourceType source)
      Determine if this source type has a lower priority than the one being passed to this method as a parameter.
      Parameters:
      source - the source type whose priority is to be compared with this one's.
      Returns:
      true if this source type is a lower priority. false if this source type is the same priority or higher priority.
    • isLowerOrEqualPriorityThan

      public boolean isLowerOrEqualPriorityThan(SourceType source)
      Determine if this source type has the same or lower priority than the one being passed to this method as a parameter.
      Parameters:
      source - the source type whose priority is to be compared with this one's.
      Returns:
      true if this source type is a lower priority. false if this source type is the same priority or higher priority.