Package net.bytebuddy.dynamic.scaffold
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 java.lang.Object implements FieldLocator
An abstract base implementation of a field locator.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.FieldLocator
FieldLocator.AbstractBase, FieldLocator.Factory, FieldLocator.ForClassHierarchy, FieldLocator.ForExactType, FieldLocator.ForTopLevelType, FieldLocator.NoOp, FieldLocator.Resolution
-
-
Field Summary
Fields Modifier and Type Field Description protected TypeDescription
accessingType
The type accessing the field.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBase(TypeDescription accessingType)
Creates a new field locator.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description FieldLocator.Resolution
locate(java.lang.String name)
Locates a field with the given name and throws an exception if no such type exists.FieldLocator.Resolution
locate(java.lang.String name, TypeDescription type)
Locates a field with the given name and type and throws an exception if no such type exists.protected abstract FieldList<?>
locate(ElementMatcher<? super FieldDescription> matcher)
Locates fields that match the given matcher.
-
-
-
Field Detail
-
accessingType
protected final TypeDescription accessingType
The type accessing the field.
-
-
Constructor Detail
-
AbstractBase
protected AbstractBase(TypeDescription accessingType)
Creates a new field locator.- Parameters:
accessingType
- The type accessing the field.
-
-
Method Detail
-
locate
public FieldLocator.Resolution locate(java.lang.String name)
Locates a field with the given name and throws an exception if no such type exists.- Specified by:
locate
in interfaceFieldLocator
- Parameters:
name
- The name of the field to locate.- Returns:
- A resolution for a field lookup.
-
locate
public FieldLocator.Resolution locate(java.lang.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 interfaceFieldLocator
- 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.
-
-