Package ghidra.program.model.data
Interface Category
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DataType
addDataType(DataType dt, DataTypeConflictHandler handler)
Adds the given datatype to this category.Category
copyCategory(Category category, DataTypeConflictHandler handler, TaskMonitor monitor)
Make a new subcategory from the given category.Category
createCategory(java.lang.String name)
Create a category with the given name; if category already exists, then return that category.Category[]
getCategories()
Get all categories in this category.Category
getCategory(java.lang.String name)
Get a category with the given name.CategoryPath
getCategoryPath()
return the full CategoryPath for this category.java.lang.String
getCategoryPathName()
Get the fully qualified name for this category.DataType
getDataType(java.lang.String name)
Get a data type with the given name.DataTypeManager
getDataTypeManager()
Get the data type manager associated with this category.DataType[]
getDataTypes()
Get all data types in this category.java.util.List<DataType>
getDataTypesByBaseName(java.lang.String name)
Get all data types in this category whose base name matches the base name of the given name.long
getID()
Get the ID for this category.java.lang.String
getName()
Get the name of this category.Category
getParent()
Return this category's parent; return null if this is the root category.Category
getRoot()
Get the root category.boolean
isRoot()
Returns true if this is the root category.void
moveCategory(Category category, TaskMonitor monitor)
Move the given category to this category; category is removed from its original parent category.void
moveDataType(DataType type, DataTypeConflictHandler handler)
Move a data type into this categoryboolean
remove(DataType type, TaskMonitor monitor)
Remove a datatype from this categoryboolean
removeCategory(java.lang.String name, TaskMonitor monitor)
Remove the named category from this category.boolean
removeEmptyCategory(java.lang.String name, TaskMonitor monitor)
Remove the named category from this category, IFF it is empty.void
setName(java.lang.String name)
Sets the name of this category.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Get the name of this category.
-
setName
void setName(java.lang.String name) throws DuplicateNameException, InvalidNameException
Sets the name of this category.- Parameters:
name
- the new name for this category- Throws:
DuplicateNameException
- if another category exists in the same parent with the same name;InvalidNameException
- if the name is not an acceptable name.
-
getCategories
Category[] getCategories()
Get all categories in this category.- Returns:
- zero-length array if there are no categories
-
getDataTypes
DataType[] getDataTypes()
Get all data types in this category.- Returns:
- zero-length array if there are no data types
-
getDataTypesByBaseName
java.util.List<DataType> getDataTypesByBaseName(java.lang.String name)
Get all data types in this category whose base name matches the base name of the given name. The base name of a name is the first part of the string up to where the first ".conflict" occurs. In other words, finds all data types whose name matches the given name once any conflict suffixes have been removed from both the given name and the data types that are being scanned.- Parameters:
name
- the name for which to get conflict related data types in this category. Note: the name that is passed in will be normalized to its base name, so you may pass in names with .conflict appended as a convenience.- Returns:
- a list of data types that have the same base name as the base name of the given name
-
addDataType
DataType addDataType(DataType dt, DataTypeConflictHandler handler)
Adds the given datatype to this category.- Parameters:
dt
- the datatype to add to this category.handler
- the DataTypeConflictHandler to use if conflicts are discovered.- Returns:
- the new datatype with its category path adjusted.
-
getCategory
Category getCategory(java.lang.String name)
Get a category with the given name.- Parameters:
name
- the name of the category- Returns:
- null if there is no category by this name
-
getCategoryPath
CategoryPath getCategoryPath()
return the full CategoryPath for this category.- Returns:
- the full CategoryPath for this category.
-
getDataType
DataType getDataType(java.lang.String name)
Get a data type with the given name.- Parameters:
name
- the name of the data type- Returns:
- null if there is no data type by this name
-
createCategory
Category createCategory(java.lang.String name) throws InvalidNameException
Create a category with the given name; if category already exists, then return that category.- Parameters:
name
- the category name- Throws:
InvalidNameException
- if name has invalid characters
-
removeCategory
boolean removeCategory(java.lang.String name, TaskMonitor monitor)
Remove the named category from this category.- Parameters:
name
- the name of the category to removemonitor
- the task monitor- Returns:
- true if the category was removed
-
removeEmptyCategory
boolean removeEmptyCategory(java.lang.String name, TaskMonitor monitor)
Remove the named category from this category, IFF it is empty.- Parameters:
name
- the name of the category to removemonitor
- the task monitor- Returns:
- true if the category was removed
-
moveCategory
void moveCategory(Category category, TaskMonitor monitor) throws DuplicateNameException
Move the given category to this category; category is removed from its original parent category.- Parameters:
category
- the category to move- Throws:
DuplicateNameException
- if this category already contains a category or data type with the same name as the category param.
-
copyCategory
Category copyCategory(Category category, DataTypeConflictHandler handler, TaskMonitor monitor)
Make a new subcategory from the given category.- Parameters:
category
- the category to copy into this category- Returns:
- category that is added to this category
-
getParent
Category getParent()
Return this category's parent; return null if this is the root category.
-
isRoot
boolean isRoot()
Returns true if this is the root category.- Returns:
- true if this is the root category.
-
getCategoryPathName
java.lang.String getCategoryPathName()
Get the fully qualified name for this category.
-
getRoot
Category getRoot()
Get the root category.
-
getDataTypeManager
DataTypeManager getDataTypeManager()
Get the data type manager associated with this category.
-
moveDataType
void moveDataType(DataType type, DataTypeConflictHandler handler) throws DataTypeDependencyException
Move a data type into this category- Parameters:
type
- data type to be movedhandler
- the handler to call if there is a data type conflict- Throws:
DataTypeDependencyException
-
remove
boolean remove(DataType type, TaskMonitor monitor)
Remove a datatype from this category- Parameters:
type
- data type to be removedmonitor
- monitor of progress in case operation takes a long time.- Returns:
- true if the data type was found in this category and successfully removed.
-
getID
long getID()
Get the ID for this category.
-
-