Package ghidra.features.bsim.gui.filters
Class FunctionTagBSimFilterType
java.lang.Object
ghidra.features.bsim.gui.filters.BSimFilterType
ghidra.features.bsim.gui.filters.FunctionTagBSimFilterType
- All Implemented Interfaces:
Comparable<BSimFilterType>
A BsimFilterType for filtering functions based on specific function tag values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic intstatic intstatic intstatic intstatic final StringFields inherited from class ghidra.features.bsim.gui.filters.BSimFilterType
BLANK, hint, label, xmlval -
Constructor Summary
ConstructorsConstructorDescriptionFunctionTagBSimFilterType(String tagName, int flag) Creates a new function tag filter.FunctionTagBSimFilterType(String tagName, SimilarFunctionQueryService queryService) Constructor for clients who do not know what the bit flag position of this function tag is. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanevaluate(ExecutableRecord rec, String value) Evaluate this filter for a specific ExecutableRecord and a specific filter -value-voidgatherElasticEffect(ElasticEffects effect, FilterAtom atom, IDElasticResolution resolution) Gather pieces necessary to emit this filter as part of an elasticsearch query documentvoidgatherSQLEffect(SQLEffects effect, FilterAtom atom, IDSQLResolution resolution) Gather all pieces to successfully convert this filter element into an SQL clauseConstruct a record describing the column id's that might need to be recovered before this filter element can be converted to an SQL clauseintgetFlag()inthashCode()booleanbooleanisValidValue(String value) Tests if the given string is a valid value for this filter type.normalizeValue(String value) Returns a normalized version of the given value for this filter.voidSave XML attributes corresponding to this templateMethods inherited from class ghidra.features.bsim.gui.filters.BSimFilterType
buildElasticCombinedClause, buildSQLCombinedClause, compareTo, generateBsimFilters, generateIDElasticResolution, getBaseFilters, getBlank, getHint, getLabel, getXmlValue, isBlank, isChildFilter, isLocal, nameToType, orMultipleEntries, toString
-
Field Details
-
XML_VALUE
- See Also:
-
RESERVED_BITS
public static int RESERVED_BITS -
MAX_TAG_COUNT
public static int MAX_TAG_COUNT -
KNOWN_LIBRARY_MASK
public static int KNOWN_LIBRARY_MASK -
HAS_UNIMPLEMENTED_MASK
public static int HAS_UNIMPLEMENTED_MASK -
HAS_BADDATA_MASK
public static int HAS_BADDATA_MASK
-
-
Constructor Details
-
FunctionTagBSimFilterType
Creates a new function tag filter.- Parameters:
tagName- the tag nameflag- the bit position of this flag
-
FunctionTagBSimFilterType
public FunctionTagBSimFilterType(String tagName, SimilarFunctionQueryService queryService) throws InvalidInputException Constructor for clients who do not know what the bit flag position of this function tag is. If that's the case, this will figure it out from the given queryService object.- Parameters:
tagName- the name of the tagqueryService- query service used to retrieve tag big position- Throws:
InvalidInputException- thrown if tag does not exist
-
-
Method Details
-
getFlag
public int getFlag() -
hashCode
public int hashCode()- Overrides:
hashCodein classBSimFilterType
-
equals
- Overrides:
equalsin classBSimFilterType
-
saveXml
Description copied from class:BSimFilterTypeSave XML attributes corresponding to this template- Overrides:
saveXmlin classBSimFilterType- Parameters:
fwrite- is the output stream- Throws:
IOException- for problems writing to the stream
-
generateIDSQLResolution
Description copied from class:BSimFilterTypeConstruct a record describing the column id's that might need to be recovered before this filter element can be converted to an SQL clause- Specified by:
generateIDSQLResolutionin classBSimFilterType- Parameters:
atom- is the specific FilterAtom to generate the record for- Returns:
- the IDSQLResolution record or null if no ids need to be recovered
-
evaluate
Description copied from class:BSimFilterTypeEvaluate this filter for a specific ExecutableRecord and a specific filter -value-- Specified by:
evaluatein classBSimFilterType- Parameters:
rec- is the ExecutableRecord to filter againstvalue- is the String value for an instantiated filter- Returns:
- true if this element would allow the ExecutableRecord to pass the filter
-
isMultipleEntryAllowed
public boolean isMultipleEntryAllowed()- Overrides:
isMultipleEntryAllowedin classBSimFilterType- Returns:
- false, only one boolean value is allowed
-
gatherSQLEffect
public void gatherSQLEffect(SQLEffects effect, FilterAtom atom, IDSQLResolution resolution) throws SQLException Description copied from class:BSimFilterTypeGather all pieces to successfully convert this filter element into an SQL clause- Specified by:
gatherSQLEffectin classBSimFilterType- Parameters:
effect- is SQLEffects container for this filter elements pieces and othersatom- holds the values for a particular instantiation of this filter elementresolution- is the IDResolution containing relevant row ids for the filter, which must have been precalculated- Throws:
SQLException- for errors building the SQL clause
-
gatherElasticEffect
public void gatherElasticEffect(ElasticEffects effect, FilterAtom atom, IDElasticResolution resolution) throws ElasticException Description copied from class:BSimFilterTypeGather pieces necessary to emit this filter as part of an elasticsearch query document- Specified by:
gatherElasticEffectin classBSimFilterType- Parameters:
effect- is the ElasticEffects container holding the piecesatom- holds the values for a particular instantiation of this filter elementresolution- contains relevant ids for the filter, which must have been precalculated- Throws:
ElasticException- for errors building the JSON subdocument
-
normalizeValue
Description copied from class:BSimFilterTypeReturns a normalized version of the given value for this filter.- Overrides:
normalizeValuein classBSimFilterType- Parameters:
value- the value to be normalized- Returns:
- a normalized version of the given value for this filter
-
isValidValue
Description copied from class:BSimFilterTypeTests if the given string is a valid value for this filter type.- Overrides:
isValidValuein classBSimFilterType- Parameters:
value- the value to test- Returns:
- true if the given string is valid for this filter
-
getEditor
- Overrides:
getEditorin classBSimFilterType
-