Package ghidra.feature.vt.api.db
Class VTAssociationDB
java.lang.Object
ghidra.program.database.DatabaseObject
ghidra.feature.vt.api.db.VTAssociationDB
- All Implemented Interfaces:
VTAssociation
public class VTAssociationDB
extends ghidra.program.database.DatabaseObject
implements VTAssociation
-
Field Summary
Modifier and TypeFieldDescriptiondb.DBRecord
Fields inherited from class ghidra.program.database.DatabaseObject
key
-
Constructor Summary
ConstructorDescriptionVTAssociationDB
(AssociationDatabaseManager associationManager, ghidra.program.database.DBObjectCache<VTAssociationDB> cache, db.DBRecord record) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the state of the given association fromVTAssociationStatus.ACCEPTED
orVTAssociationStatus.REJECTED
toVTAssociationStatus.AVAILABLE
.boolean
ghidra.program.model.address.Address
Returns the address of the function or data item in the source program for this association.getMarkupItems
(ghidra.util.task.TaskMonitor monitor) Returns a list of markup items for this association.Returns the status of the markup items for this association.Returns a collection of VTAssociations that have either the same source address or the same destination address.Returns the VTSession that this association belongs to.ghidra.program.model.address.Address
Returns the address of the function or data item in the source program for this association.Returns the current status of this association.getType()
Returns the type of the association.int
Returns the current vote count which is an application settable field which should generally be used to indicate a number of supporting facts.boolean
Returns true if this association is accepted and has one or more markup items that have been applied.int
hashCode()
void
markupItemStatusChanged
(VTMarkupItem markupItem) protected boolean
refresh()
protected boolean
refresh
(db.DBRecord associationRecord) void
A convenience method to accept the given association without actually performing an apply.void
void
Sets the markup status of this association.void
Sets the status of this association toVTAssociationStatus.REJECTED
.void
setStatus
(VTAssociationStatus status) void
setVoteCount
(int voteCount) Sets the vote count for this association which should be used to indicate the number of supporting facts for this associationtoString()
Methods inherited from class ghidra.program.database.DatabaseObject
checkDeleted, checkIsValid, checkIsValid, getKey, isDeleted, isInvalid, keyChanged, setDeleted, validate
-
Field Details
-
record
public db.DBRecord record -
associationDBM
-
-
Constructor Details
-
VTAssociationDB
public VTAssociationDB(AssociationDatabaseManager associationManager, ghidra.program.database.DBObjectCache<VTAssociationDB> cache, db.DBRecord record)
-
-
Method Details
-
setInvalid
public void setInvalid()- Overrides:
setInvalid
in classghidra.program.database.DatabaseObject
-
getAssociationManager
-
getAssociationDatabaseManager
-
getAssociationManagerDB
-
getSession
Description copied from interface:VTAssociation
Returns the VTSession that this association belongs to.- Specified by:
getSession
in interfaceVTAssociation
- Returns:
- the VTSession that this association belongs to.
-
getRelatedAssociations
Description copied from interface:VTAssociation
Returns a collection of VTAssociations that have either the same source address or the same destination address.- Specified by:
getRelatedAssociations
in interfaceVTAssociation
- Returns:
- a collection of VTAssociations that have either the same source address or the same destination address.
-
refresh
protected boolean refresh()- Specified by:
refresh
in classghidra.program.database.DatabaseObject
-
refresh
protected boolean refresh(db.DBRecord associationRecord) - Overrides:
refresh
in classghidra.program.database.DatabaseObject
-
getSourceAddress
public ghidra.program.model.address.Address getSourceAddress()Description copied from interface:VTAssociation
Returns the address of the function or data item in the source program for this association.- Specified by:
getSourceAddress
in interfaceVTAssociation
- Returns:
- the address of the function or data item in the source program for this association.
-
getDestinationAddress
public ghidra.program.model.address.Address getDestinationAddress()Description copied from interface:VTAssociation
Returns the address of the function or data item in the source program for this association.- Specified by:
getDestinationAddress
in interfaceVTAssociation
- Returns:
- the address of the function or data item in the source program for this association.
-
getType
Description copied from interface:VTAssociation
Returns the type of the association. Either Function or Data.- Specified by:
getType
in interfaceVTAssociation
- Returns:
- the type of the association. Either Function or Data.
-
markupItemStatusChanged
-
getStatus
Description copied from interface:VTAssociation
Returns the current status of this association. One of AVAILABLE, ACCEPTED, BLOCKED, or REJECTED. SeeVTAssociationStatus
for details.- Specified by:
getStatus
in interfaceVTAssociation
- Returns:
- the current status of this association. One of AVAILABLE, ACCEPTED, BLOCKED, or REJECTED.
-
getMarkupStatus
Description copied from interface:VTAssociation
Returns the status of the markup items for this association. SeeVTAssociationMarkupStatus
for details.- Specified by:
getMarkupStatus
in interfaceVTAssociation
- Returns:
- the status of the markup items for this association.
-
toString
-
hashCode
public int hashCode() -
setAccepted
Description copied from interface:VTAssociation
A convenience method to accept the given association without actually performing an apply.- Specified by:
setAccepted
in interfaceVTAssociation
- Throws:
VTAssociationStatusException
- if the given association isVTAssociationStatus.BLOCKED
-
setRejected
Description copied from interface:VTAssociation
Sets the status of this association toVTAssociationStatus.REJECTED
.- Specified by:
setRejected
in interfaceVTAssociation
- Throws:
VTAssociationStatusException
- if the association is accepted.
-
clearStatus
Description copied from interface:VTAssociation
Clears the state of the given association fromVTAssociationStatus.ACCEPTED
orVTAssociationStatus.REJECTED
toVTAssociationStatus.AVAILABLE
. This method will throw an exception if called while the given assocation's markup items have been applied. That is, you must first unapply any applied markup items before calling this method.- Specified by:
clearStatus
in interfaceVTAssociation
- Throws:
VTAssociationStatusException
- if the given association's status is notVTAssociationStatus.ACCEPTED
/VTAssociationStatus.REJECTED
or if the given assocation's markup item manager contains markup items that have been applied.
-
equals
-
getVoteCount
public int getVoteCount()Description copied from interface:VTAssociation
Returns the current vote count which is an application settable field which should generally be used to indicate a number of supporting facts. For example, other accepted associations may have matching call references to this association, each of those matching calls should have incremented the votes.- Specified by:
getVoteCount
in interfaceVTAssociation
- Returns:
- the current number of facts that support this association
-
setMarkupStatus
Description copied from interface:VTAssociation
Sets the markup status of this association. This method is used by theVTAssociationManager
to update the association with information about the state of its markup items.- Specified by:
setMarkupStatus
in interfaceVTAssociation
- Parameters:
status
- the markup items
-
setStatus
-
setVoteCount
public void setVoteCount(int voteCount) Description copied from interface:VTAssociation
Sets the vote count for this association which should be used to indicate the number of supporting facts for this association- Specified by:
setVoteCount
in interfaceVTAssociation
- Parameters:
voteCount
- the new vote count for this association.
-
getMarkupItems
public Collection<VTMarkupItem> getMarkupItems(ghidra.util.task.TaskMonitor monitor) throws ghidra.util.exception.CancelledException Description copied from interface:VTAssociation
Returns a list of markup items for this association.- Specified by:
getMarkupItems
in interfaceVTAssociation
- Parameters:
monitor
- a task monitor used to monitor and control this operation.- Returns:
- a list of markup items for this association.
- Throws:
ghidra.util.exception.CancelledException
- if the operation was cancelled via the monitor.
-
hasAppliedMarkupItems
public boolean hasAppliedMarkupItems()Description copied from interface:VTAssociation
Returns true if this association is accepted and has one or more markup items that have been applied.- Specified by:
hasAppliedMarkupItems
in interfaceVTAssociation
- Returns:
- true if this association is accepted and has one or more markup items that have been applied.
-