Class FieldLocator.AbstractBase

java.lang.Object
net.bytebuddy.dynamic.scaffold.FieldLocator.AbstractBase
All Implemented Interfaces:
FieldLocator
Direct Known Subclasses:
FieldLocator.ForClassHierarchy, FieldLocator.ForExactType, FieldLocator.ForTopLevelType
Enclosing interface:
FieldLocator

@Enhance public abstract static class FieldLocator.AbstractBase extends Object implements FieldLocator
An abstract base implementation of a field locator.
  • Field Details

    • accessingType

      protected final TypeDescription accessingType
      The type accessing the field.
  • Constructor Details

    • AbstractBase

      protected AbstractBase(TypeDescription accessingType)
      Creates a new field locator.
      Parameters:
      accessingType - The type accessing the field.
  • Method Details

    • locate

      public FieldLocator.Resolution locate(String name)
      Locates a field with the given name and throws an exception if no such type exists.
      Specified by:
      locate in interface FieldLocator
      Parameters:
      name - The name of the field to locate.
      Returns:
      A resolution for a field lookup.
    • locate

      public FieldLocator.Resolution locate(String name, TypeDescription type)
      Locates a field with the given name and type and throws an exception if no such type exists.
      Specified by:
      locate in interface FieldLocator
      Parameters:
      name - The name of the field to locate.
      type - The type fo the field to locate.
      Returns:
      A resolution for a field lookup.
    • locate

      protected abstract FieldList<?> locate(ElementMatcher<? super FieldDescription> matcher)
      Locates fields that match the given matcher.
      Parameters:
      matcher - The matcher that identifies fields of interest.
      Returns:
      A list of fields that match the specified matcher.