Class DataTypeUrl

java.lang.Object
ghidra.app.util.datatype.DataTypeUrl

public class DataTypeUrl extends Object
A class to produce and parse URLs of the form:
 	datatype:/12345678?uid=12345678&name=Bob
 
where the first number is the ID of the DataTypeManager and the second number is the DataType ID.
  • Constructor Details

    • DataTypeUrl

      public DataTypeUrl(DataType dt)
      Constructs a url from the given data type
      Parameters:
      dt - the data type; cannot be null
    • DataTypeUrl

      public DataTypeUrl(String url) throws IllegalArgumentException
      Constructs a url from the given url string
      Parameters:
      url - the url
      Throws:
      IllegalArgumentException - if the url does not match the expected URL_PATTERN or if there is an issue parsing the id within the given url
  • Method Details

    • getDataTypeManagerId

      public UniversalID getDataTypeManagerId()
    • getDataTypeId

      public UniversalID getDataTypeId()
    • getDataTypeName

      public String getDataTypeName()
    • getDataType

      public DataType getDataType(DataTypeManagerService service)
      Uses the given service and its DataTypeManagers to find the data type represented by this url
      Parameters:
      service - the service
      Returns:
      the data type; null if there was an error restoring the type, such as if the parent DataTypeManager has been closed
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object