org.easymock.bytebuddy.implementation.attribute.FieldAttributeAppender . Fields
can be uniquely identified by their name for a given type since fields are never inherited.
This registry is the counterpart of a
org.easymock.bytebuddy.dynamic.scaffold.MethodRegistry .
However, a field registry is implemented simpler since it does not have to deal with complex signatures or
inheritance. For the sake of consistency, the field registry follows however a similar pattern without introducing
unnecessary complexity.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | FieldRegistry.
Represents a compiled field registry. |
| public static class | FieldRegistry.
An immutable default implementation of a field registry. |
| Modifier and Type | Method and Description |
|---|---|
| public FieldRegistry. | Returns: A prepared field registry.The instrumented type. instrumentedType)Prepares the field registry for a given instrumented type. |
| public FieldRegistry | Returns: An adapted version of this method registry.The matcher to identify any field that this definition concerns. matcher, FieldAttributeAppender.The field attribute appender factory to apply on any matched field. fieldAttributeAppenderFactory,The default value to write to the field or defaultValue, Transformer<FieldDescription> null if no default value is to be set for the field.The field transformer to apply to any matched field. transformer)Prepends the given field definition to this field registry, i.e. this configuration is applied first. |
| compile | back to summary |
|---|---|
| public FieldRegistry. Prepares the field registry for a given instrumented type.
| |
| prepend | back to summary |
|---|---|
| public FieldRegistry prepend(LatentMatcher<? super FieldDescription> matcher, FieldAttributeAppender. Prepends the given field definition to this field registry, i.e. this configuration is applied first.
| |
| Modifier and Type | Class and Description |
|---|---|
| public static enum | FieldRegistry.
A no-op field registry that does not register annotations for any field. |
| Modifier and Type | Field and Description |
|---|---|
| public static final FieldRegistry. | INSTANCE
The singleton instance. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public TypeWriter. | target(FieldDescription
The field being processed. fieldDescription)Implements org. |
| public static FieldRegistry. | |
| public static FieldRegistry. |
| INSTANCE | back to summary |
|---|---|
| public static final FieldRegistry. The singleton instance. | |
| NoOp | back to summary |
|---|---|
| private NoOp() | |
| target | back to summary |
|---|---|
| public TypeWriter. Implements org. Doc from org. Looks up a handler entry for a given field.
| |
| valueOf | back to summary |
|---|---|
| public static FieldRegistry. | |
| values | back to summary |
|---|---|
| public static FieldRegistry. | |
| Modifier and Type | Class and Description |
|---|---|
| protected static class | FieldRegistry.
A compiled default field registry. |
| protected static class | FieldRegistry.
An entry of the default field registry. |
| Modifier and Type | Field and Description |
|---|---|
| private final List | entries
This registries entries. |
| Access | Constructor and Description |
|---|---|
| public | |
| private | Default(List<FieldRegistry.
The entries of the field registry. entriesCreates a new default field registry. |
| Modifier and Type | Method and Description |
|---|---|
| public FieldRegistry. | compile(TypeDescription
The instrumented type. instrumentedType)Implements org. |
| public FieldRegistry | prepend(LatentMatcher<? super FieldDescription>
The matcher to identify any field that this definition concerns. matcher, FieldAttributeAppender.The field attribute appender factory to apply on any matched field. fieldAttributeAppenderFactory,The default value to write to the field or defaultValue, Transformer<FieldDescription> null if no default value is to be set for the field.The field transformer to apply to any matched field. transformer)Implements org. |
| entries | back to summary |
|---|---|
| private final List<FieldRegistry. This registries entries. | |
| Default | back to summary |
|---|---|
| public Default() Creates a new empty default field registry. | |
| Default | back to summary |
|---|---|
| private Default(List<FieldRegistry. Creates a new default field registry.
| |
| compile | back to summary |
|---|---|
| public FieldRegistry. Implements org. Doc from org. Prepares the field registry for a given instrumented type.
| |
| prepend | back to summary |
|---|---|
| public FieldRegistry prepend(LatentMatcher<? super FieldDescription> matcher, FieldAttributeAppender. Implements org. Doc from org. Prepends the given field definition to this field registry, i.e. this configuration is applied first.
| |
| Modifier and Type | Class and Description |
|---|---|
| protected static class | FieldRegistry.
An entry of a compiled field registry. |
| Modifier and Type | Field and Description |
|---|---|
| private final List | entries
The entries of this compiled field registry. |
| private final TypeDescription | instrumentedType
The instrumented type for which this registry was compiled for. |
| Access | Constructor and Description |
|---|---|
| protected | Compiled(TypeDescription
The instrumented type for which this registry was compiled for. instrumentedType, List<FieldRegistry.The entries of this compiled field registry. entriesCreates a new compiled field registry. |
| Modifier and Type | Method and Description |
|---|---|
| public TypeWriter. | target(FieldDescription
The field being processed. fieldDescription)Implements org. |
| entries | back to summary |
|---|---|
| private final List<FieldRegistry. The entries of this compiled field registry. | |
| instrumentedType | back to summary |
|---|---|
| private final TypeDescription instrumentedType The instrumented type for which this registry was compiled for. | |
| Compiled | back to summary |
|---|---|
| protected Compiled(TypeDescription instrumentedType, List<FieldRegistry. Creates a new compiled field registry.
| |
| target | back to summary |
|---|---|
| public TypeWriter. Implements org. Doc from org. Looks up a handler entry for a given field.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Object | defaultValue
The default value to write to the field or |
| private final FieldAttributeAppender | fieldAttributeAppender
The field attribute appender to apply on any matched field. |
| private final ElementMatcher | matcher
The matcher to identify any field that this definition concerns. |
| private final Transformer | transformer
The field transformer to apply to any matched field. |
| Access | Constructor and Description |
|---|---|
| protected | Entry(ElementMatcher<? super FieldDescription>
The matcher to identify any field that this definition concerns. matcher, FieldAttributeAppender The field attribute appender to apply on any matched field. fieldAttributeAppender, Object The default value to write to the field or defaultValue, Transformer<FieldDescription> null if no default value is to be set for the field.The field transformer to apply to any matched field. transformer)Creates a new entry. |
| Modifier and Type | Method and Description |
|---|---|
| protected TypeWriter. | Returns: A record representing the binding of this entry to the provided field.The instrumented type for which this entry applies. instrumentedType, FieldDescription The field description to be bound to this entry. fieldDescription)Binds this entry to the provided field description. |
| public boolean | matches(FieldDescription
The instance to be matched or target)null.Implements org. |
| defaultValue | back to summary |
|---|---|
| private final Object defaultValue The default value to write to the field or | |
| fieldAttributeAppender | back to summary |
|---|---|
| private final FieldAttributeAppender fieldAttributeAppender The field attribute appender to apply on any matched field. | |
| matcher | back to summary |
|---|---|
| private final ElementMatcher<? super FieldDescription> matcher The matcher to identify any field that this definition concerns. | |
| transformer | back to summary |
|---|---|
| private final Transformer<FieldDescription> transformer The field transformer to apply to any matched field. | |
| Entry | back to summary |
|---|---|
| protected Entry(ElementMatcher<? super FieldDescription> matcher, FieldAttributeAppender fieldAttributeAppender, Object defaultValue, Transformer<FieldDescription> transformer) Creates a new entry.
| |
| bind | back to summary |
|---|---|
| protected TypeWriter. Binds this entry to the provided field description.
| |
| matches | back to summary |
|---|---|
| public boolean matches(FieldDescription target) Implements org. Doc from org. Matches a target against this element matcher.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Object | defaultValue
The default value to write to the field or |
| private final FieldAttributeAppender. | fieldAttributeAppenderFactory
The field attribute appender factory to apply on any matched field. |
| private final LatentMatcher | matcher
The matcher to identify any field that this definition concerns. |
| private final Transformer | transformer
The field transformer to apply to any matched field. |
| Access | Constructor and Description |
|---|---|
| protected | Entry(LatentMatcher<? super FieldDescription>
The matcher to identify any field that this definition concerns. matcher, FieldAttributeAppender.The field attribute appender factory to apply on any matched field. fieldAttributeAppenderFactory,The default value to write to the field or defaultValue, Transformer<FieldDescription> null if no default value is to be set for the field.The field transformer to apply to any matched field. transformer)Creates a new entry. |
| Modifier and Type | Method and Description |
|---|---|
| protected Object | Returns: The default value to write to the field ornull if no default value is to be set for the field.Returns the default value to write to the field or |
| protected FieldAttributeAppender. | Returns: The field attribute appender factory to apply on any matched field.Returns the field attribute appender factory to apply on any matched field. |
| protected Transformer | Returns: The field transformer to apply to any matched field.Returns the field transformer to apply to any matched field. |
| public ElementMatcher | resolve(TypeDescription
The type description for which the represented matcher should be resolved. typeDescription)Implements org. |
| defaultValue | back to summary |
|---|---|
| private final Object defaultValue The default value to write to the field or | |
| fieldAttributeAppenderFactory | back to summary |
|---|---|
| private final FieldAttributeAppender. The field attribute appender factory to apply on any matched field. | |
| matcher | back to summary |
|---|---|
| private final LatentMatcher<? super FieldDescription> matcher The matcher to identify any field that this definition concerns. | |
| transformer | back to summary |
|---|---|
| private final Transformer<FieldDescription> transformer The field transformer to apply to any matched field. | |
| Entry | back to summary |
|---|---|
| protected Entry(LatentMatcher<? super FieldDescription> matcher, FieldAttributeAppender. Creates a new entry.
| |
| getDefaultValue | back to summary |
|---|---|
| protected Object getDefaultValue() Returns the default value to write to the field or
| |
| getFieldAttributeAppenderFactory | back to summary |
|---|---|
| protected FieldAttributeAppender. Returns the field attribute appender factory to apply on any matched field.
| |
| getTransformer | back to summary |
|---|---|
| protected Transformer Returns the field transformer to apply to any matched field.
| |
| resolve | back to summary |
|---|---|
| public ElementMatcher Implements org. Doc from org. Resolves the element matcher this instance represents for the supplied type description.
| |