Package ghidra.app.services

# Class FieldMatcher

java.lang.Object
ghidra.app.services.FieldMatcher

public class FieldMatcher extends Object
This class allows clients to match on multiple field attributes, such as name and offset within a parent data type.

Use `FieldMatcher(DataType)` as an 'empty' or 'ignored' field matcher to signal that any field match is considered value.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FieldMatcher(DataType dataType)`
  Creates an 'empty' matcher that can be used to signal no specific field or offset match is required.
  `FieldMatcher(DataType dataType, int offset)`
  `FieldMatcher(DataType dataType, String fieldName)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `DataType`
  `getDataType()`
  `String`
  `getDisplayText()`
  Returns a display text for this field matcher, for example, `Foo.bar`.
  `String`
  `getFieldName()`
  Returns the field name given to this matcher or will attempt to generate a default field name using the given data type and offset.
  `int`
  `hashCode()`
  `boolean`
  `isIgnored()`
  Signals that no specific field match is required.
  `boolean`
  `matches(String dtFieldName, int dtOffset)`
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### FieldMatcher

    public FieldMatcher(DataType dataType)
    Creates an 'empty' matcher that can be used to signal no specific field or offset match is required.
    Parameters:
      `dataType` - the non-null data type.

  - ### FieldMatcher

    public FieldMatcher(DataType dataType, String fieldName)

  - ### FieldMatcher

    public FieldMatcher(DataType dataType, int offset)

- ## Method Details

  - ### isIgnored

    public boolean isIgnored()
    Signals that no specific field match is required.
    Returns:
      true if no field or offset has been specified.

  - ### matches

    public boolean matches(String dtFieldName, int dtOffset)

  - ### getDisplayText

    public String getDisplayText()
    Returns a display text for this field matcher, for example, `Foo.bar`.
    Returns:
      the display text

  - ### getDataType

    public DataType getDataType()

  - ### getFieldName

    public String getFieldName()
    Returns the field name given to this matcher or will attempt to generate a default field name using the given data type and offset.
    Returns:
      the field name or null

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`