Package ghidra.app.util.datatype
Class DataTypeUrl
- java.lang.Object
-
- ghidra.app.util.datatype.DataTypeUrl
-
public class DataTypeUrl extends java.lang.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 theDataTypeManager
and the second number is theDataType
ID.
-
-
Constructor Summary
Constructors Constructor Description DataTypeUrl(DataType dt)
Constructs a url from the given data typeDataTypeUrl(java.lang.String url)
Constructs a url from the given url string
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
DataType
getDataType(DataTypeManagerService service)
Uses the given service and itsDataTypeManager
s to find the data type represented by this urlUniversalID
getDataTypeId()
UniversalID
getDataTypeManagerId()
java.lang.String
getDataTypeName()
int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
DataTypeUrl
public DataTypeUrl(DataType dt)
Constructs a url from the given data type- Parameters:
dt
- the data type; cannot be null
-
DataTypeUrl
public DataTypeUrl(java.lang.String url) throws java.lang.IllegalArgumentException
Constructs a url from the given url string- Parameters:
url
- the url- Throws:
java.lang.IllegalArgumentException
- if the url does not match the expectedURL_PATTERN
or if there is an issue parsing the id within the given url
-
-
Method Detail
-
getDataTypeManagerId
public UniversalID getDataTypeManagerId()
-
getDataTypeId
public UniversalID getDataTypeId()
-
getDataTypeName
public java.lang.String getDataTypeName()
-
getDataType
public DataType getDataType(DataTypeManagerService service)
Uses the given service and itsDataTypeManager
s 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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-