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>`

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

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static int`
  `HAS_BADDATA_MASK`
  `static int`
  `HAS_UNIMPLEMENTED_MASK`
  `static int`
  `KNOWN_LIBRARY_MASK`
  `static int`
  `MAX_TAG_COUNT`
  `static int`
  `RESERVED_BITS`
  `static final String`
  `XML_VALUE`

  ### Fields inherited from class ghidra.features.bsim.gui.filters.BSimFilterType

  `BLANK, hint, label, xmlval`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FunctionTagBSimFilterType(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 Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `boolean`
  `evaluate(ExecutableRecord rec, String value)`
  Evaluate this filter for a specific ExecutableRecord and a specific filter -value-
  `void`
  `gatherElasticEffect(ElasticEffects effect, FilterAtom atom, IDElasticResolution resolution)`
  Gather pieces necessary to emit this filter as part of an elasticsearch query document
  `void`
  `gatherSQLEffect(SQLEffects effect, FilterAtom atom, IDSQLResolution resolution)`
  Gather all pieces to successfully convert this filter element into an SQL clause
  `IDSQLResolution`
  `generateIDSQLResolution(FilterAtom atom)`
  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
  `BSimValueEditor`
  `getEditor(List<String> initialValues, Callback listener)`
  `int`
  `getFlag()`
  `int`
  `hashCode()`
  `boolean`
  `isMultipleEntryAllowed()`
  `boolean`
  `isValidValue(String value)`
  Tests if the given string is a valid value for this filter type.
  `String`
  `normalizeValue(String value)`
  Returns a normalized version of the given value for this filter.
  `void`
  `saveXml(Writer fwrite)`
  Save XML attributes corresponding to this template

  ### Methods 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`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### XML_VALUE

    public static final String XML_VALUE
    See Also:
      - Constant Field Values

  - ### 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`