Class FunctionTagBSimFilterType

java.lang.Object
ghidra.features.bsim.gui.filters.BSimFilterType
ghidra.features.bsim.gui.filters.FunctionTagBSimFilterType
All Implemented Interfaces:
Comparable<BSimFilterType>

public class FunctionTagBSimFilterType extends BSimFilterType
A BsimFilterType for filtering functions based on specific function tag values.
  • Field Details

    • XML_VALUE

      public static final String 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

      public FunctionTagBSimFilterType(String tagName, int flag)
      Creates a new function tag filter.
      Parameters:
      tagName - the tag name
      flag - 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 tag
      queryService - 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:
      hashCode in class BSimFilterType
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class BSimFilterType
    • saveXml

      public void saveXml(Writer fwrite) throws IOException
      Description copied from class: BSimFilterType
      Save XML attributes corresponding to this template
      Overrides:
      saveXml in class BSimFilterType
      Parameters:
      fwrite - is the output stream
      Throws:
      IOException - for problems writing to the stream
    • generateIDSQLResolution

      public IDSQLResolution generateIDSQLResolution(FilterAtom atom)
      Description copied from class: BSimFilterType
      Construct 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:
      generateIDSQLResolution in class BSimFilterType
      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

      public boolean evaluate(ExecutableRecord rec, String value)
      Description copied from class: BSimFilterType
      Evaluate this filter for a specific ExecutableRecord and a specific filter -value-
      Specified by:
      evaluate in class BSimFilterType
      Parameters:
      rec - is the ExecutableRecord to filter against
      value - 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:
      isMultipleEntryAllowed in class BSimFilterType
      Returns:
      false, only one boolean value is allowed
    • gatherSQLEffect

      public void gatherSQLEffect(SQLEffects effect, FilterAtom atom, IDSQLResolution resolution) throws SQLException
      Description copied from class: BSimFilterType
      Gather all pieces to successfully convert this filter element into an SQL clause
      Specified by:
      gatherSQLEffect in class BSimFilterType
      Parameters:
      effect - is SQLEffects container for this filter elements pieces and others
      atom - holds the values for a particular instantiation of this filter element
      resolution - 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: BSimFilterType
      Gather pieces necessary to emit this filter as part of an elasticsearch query document
      Specified by:
      gatherElasticEffect in class BSimFilterType
      Parameters:
      effect - is the ElasticEffects container holding the pieces
      atom - holds the values for a particular instantiation of this filter element
      resolution - contains relevant ids for the filter, which must have been precalculated
      Throws:
      ElasticException - for errors building the JSON subdocument
    • normalizeValue

      public String normalizeValue(String value)
      Description copied from class: BSimFilterType
      Returns a normalized version of the given value for this filter.
      Overrides:
      normalizeValue in class BSimFilterType
      Parameters:
      value - the value to be normalized
      Returns:
      a normalized version of the given value for this filter
    • isValidValue

      public boolean isValidValue(String value)
      Description copied from class: BSimFilterType
      Tests if the given string is a valid value for this filter type.
      Overrides:
      isValidValue in class BSimFilterType
      Parameters:
      value - the value to test
      Returns:
      true if the given string is valid for this filter
    • getEditor

      public BSimValueEditor getEditor(List<String> initialValues, Callback listener)
      Overrides:
      getEditor in class BSimFilterType