Package ghidra.program.database.function
Class FunctionTagManagerDB
- java.lang.Object
-
- ghidra.program.database.function.FunctionTagManagerDB
-
- All Implemented Interfaces:
ErrorHandler,FunctionTagManager
public class FunctionTagManagerDB extends java.lang.Object implements FunctionTagManager, ErrorHandler
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctionTagcreateFunctionTag(java.lang.String name, java.lang.String comment)Creates a new function tag with the given attributes if one does not already exist.voiddbError(java.io.IOException e)Notification that an IO exception occurred.java.util.List<? extends FunctionTag>getAllFunctionTags()TODO: Be a bit smarter about this - if the cache contains all the tags in the db we can just return the cache itself.FunctionTaggetFunctionTag(long id)Returns the function tag with the given database id.FunctionTaggetFunctionTag(java.lang.String name)Returns the function tag with the given name.ghidra.program.database.function.FunctionTagAdaptergetFunctionTagAdapter()ghidra.program.database.function.FunctionTagMappingAdaptergetFunctionTagMappingAdapter()booleanisTagAssigned(java.lang.String name)Returns true if the given tag is assigned to a function.voidsetProgram(Program program)Sets the program on this manager to allow the manager to persist changes and notify subscribers.
-
-
-
Field Detail
-
lock
protected final Lock lock
-
-
Method Detail
-
setProgram
public void setProgram(Program program)
Description copied from interface:FunctionTagManagerSets the program on this manager to allow the manager to persist changes and notify subscribers.- Specified by:
setProgramin interfaceFunctionTagManager- Parameters:
program- the program
-
dbError
public void dbError(java.io.IOException e)
Description copied from interface:ErrorHandlerNotification that an IO exception occurred.- Specified by:
dbErrorin interfaceErrorHandler
-
getFunctionTag
public FunctionTag getFunctionTag(java.lang.String name)
Description copied from interface:FunctionTagManagerReturns the function tag with the given name.- Specified by:
getFunctionTagin interfaceFunctionTagManager- Parameters:
name- the tag name- Returns:
- the function tag, or null if not found
-
getFunctionTag
public FunctionTag getFunctionTag(long id)
Description copied from interface:FunctionTagManagerReturns the function tag with the given database id.- Specified by:
getFunctionTagin interfaceFunctionTagManager- Parameters:
id- the tags database id- Returns:
- the function tag, or null if not found
-
isTagAssigned
public boolean isTagAssigned(java.lang.String name)
Description copied from interface:FunctionTagManagerReturns true if the given tag is assigned to a function.- Specified by:
isTagAssignedin interfaceFunctionTagManager- Parameters:
name- the tag name- Returns:
- true if assigned to a function
-
createFunctionTag
public FunctionTag createFunctionTag(java.lang.String name, java.lang.String comment)
Description copied from interface:FunctionTagManagerCreates a new function tag with the given attributes if one does not already exist. Otherwise, returns the existing tag.- Specified by:
createFunctionTagin interfaceFunctionTagManager- Parameters:
name- the tag namecomment- the comment associated with the tag (optional)- Returns:
- the new function tag
-
getAllFunctionTags
public java.util.List<? extends FunctionTag> getAllFunctionTags()
TODO: Be a bit smarter about this - if the cache contains all the tags in the db we can just return the cache itself. If not, then go to the db to get the remainder.- Specified by:
getAllFunctionTagsin interfaceFunctionTagManager- Returns:
- Throws:
java.io.IOException
-
getFunctionTagAdapter
public ghidra.program.database.function.FunctionTagAdapter getFunctionTagAdapter()
-
getFunctionTagMappingAdapter
public ghidra.program.database.function.FunctionTagMappingAdapter getFunctionTagMappingAdapter()
-
-