Top Description Inners Methods
net.bytebuddy.implementation.attribute

public Interface AnnotationValueFilter

Known Direct Implementers
net.bytebuddy.implementation.attribute.AnnotationValueFilter.Default
Imports
net.bytebuddy.description.annotation.AnnotationDescription, net.bytebuddy.description.field.FieldDescription, net.bytebuddy.description.method.MethodDescription, net.bytebuddy.description.type.RecordComponentDescription, .TypeDescription

An annotation value filter is responsible for determining which values should be skipped and rather be represented as an annotation type's default values when writing an annotation to a class file.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
AnnotationValueFilter.Default

A default implementation of an annotation value filter that applies the same strategy for any type, field or method.

public static interface
AnnotationValueFilter.Factory

A factory for creating an annotation value filter for an annotation's target.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the value should be written to the annotation.
isRelevant
(AnnotationDescription
The annotation value that is being written.
annotationDescription
,
MethodDescription.InDefinedShape
The annotation method of which a value is being written.
methodDescription
)

Checks if the given annotation value should be written as the value of the provided annotation property.

Method Detail

isRelevantback to summary
public boolean isRelevant(AnnotationDescription annotationDescription, MethodDescription.InDefinedShape methodDescription)

Checks if the given annotation value should be written as the value of the provided annotation property.

Parameters
annotationDescription:AnnotationDescription

The annotation value that is being written.

methodDescription:MethodDescription.InDefinedShape

The annotation method of which a value is being written.

Returns:boolean

true if the value should be written to the annotation.

net.bytebuddy.implementation.attribute back to summary

public sealed Enum AnnotationValueFilter.Default

extends Enum<AnnotationValueFilter.Default>
implements AnnotationValueFilter, Factory
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory, net.bytebuddy.implementation.attribute.AnnotationValueFilter

A default implementation of an annotation value filter that applies the same strategy for any type, field or method.

Field Summary

Modifier and TypeField and Description
public static final AnnotationValueFilter.Default
APPEND_DEFAULTS

An annotation value filter where default values are included in the class file.

public static final AnnotationValueFilter.Default
SKIP_DEFAULTS

An annotation value filter where default values are skipped and not included in the class file.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public AnnotationValueFilter
on(TypeDescription
The instrumented type onto which the annotations are written.
instrumentedType
)

Implements net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Creates an annotation value filter for writing annotations on an instrumented type.
public AnnotationValueFilter
on(FieldDescription
The field onto which the annotations are written.
fieldDescription
)

Implements net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Creates an annotation value filter for writing annotations on a field.
public AnnotationValueFilter
on(MethodDescription
The method onto which the annotations are written.
methodDescription
)

Implements net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Creates an annotation value filter for writing annotations on a method.
public AnnotationValueFilter
on(RecordComponentDescription
The record component onto which the annotations are written.
recordComponentDescription
)

Implements net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Creates an annotation value filter for writing annotations on a record component.
public static AnnotationValueFilter.Default
public static AnnotationValueFilter.Default[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

APPEND_DEFAULTSback to summary
public static final AnnotationValueFilter.Default APPEND_DEFAULTS

An annotation value filter where default values are included in the class file.

SKIP_DEFAULTSback to summary
public static final AnnotationValueFilter.Default SKIP_DEFAULTS

An annotation value filter where default values are skipped and not included in the class file.

Constructor Detail

Defaultback to summary
private Default()

Method Detail

onback to summary
public AnnotationValueFilter on(TypeDescription instrumentedType)

Implements net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Doc from net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Creates an annotation value filter for writing annotations on an instrumented type.

Parameters
instrumentedType:TypeDescription

The instrumented type onto which the annotations are written.

Returns:AnnotationValueFilter

An annotation value filter to be used when writing annotations onto the given type.

onback to summary
public AnnotationValueFilter on(FieldDescription fieldDescription)

Implements net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Doc from net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Creates an annotation value filter for writing annotations on a field.

Parameters
fieldDescription:FieldDescription

The field onto which the annotations are written.

Returns:AnnotationValueFilter

An annotation value filter to be used when writing annotations onto the given field.

onback to summary
public AnnotationValueFilter on(MethodDescription methodDescription)

Implements net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Doc from net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Creates an annotation value filter for writing annotations on a method.

Parameters
methodDescription:MethodDescription

The method onto which the annotations are written.

Returns:AnnotationValueFilter

An annotation value filter to be used when writing annotations onto the given method.

onback to summary
public AnnotationValueFilter on(RecordComponentDescription recordComponentDescription)

Implements net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Doc from net.bytebuddy.implementation.attribute.AnnotationValueFilter.Factory.on.

Creates an annotation value filter for writing annotations on a record component.

Parameters
recordComponentDescription:RecordComponentDescription

The record component onto which the annotations are written.

Returns:AnnotationValueFilter

An annotation value filter to be used when writing annotations onto the given record component.

valueOfback to summary
public static AnnotationValueFilter.Default valueOf(String name)
valuesback to summary
public static AnnotationValueFilter.Default[] values()
net.bytebuddy.implementation.attribute back to summary

public Interface AnnotationValueFilter.Factory

Known Direct Implementers
net.bytebuddy.implementation.attribute.AnnotationValueFilter.Default

A factory for creating an annotation value filter for an annotation's target.

Method Summary

Modifier and TypeMethod and Description
public AnnotationValueFilter

Returns:

An annotation value filter to be used when writing annotations onto the given type.
on
(TypeDescription
The instrumented type onto which the annotations are written.
instrumentedType
)

Creates an annotation value filter for writing annotations on an instrumented type.

public AnnotationValueFilter

Returns:

An annotation value filter to be used when writing annotations onto the given field.
on
(FieldDescription
The field onto which the annotations are written.
fieldDescription
)

Creates an annotation value filter for writing annotations on a field.

public AnnotationValueFilter

Returns:

An annotation value filter to be used when writing annotations onto the given method.
on
(MethodDescription
The method onto which the annotations are written.
methodDescription
)

Creates an annotation value filter for writing annotations on a method.

public AnnotationValueFilter

Returns:

An annotation value filter to be used when writing annotations onto the given record component.
on
(RecordComponentDescription
The record component onto which the annotations are written.
recordComponentDescription
)

Creates an annotation value filter for writing annotations on a record component.

Method Detail

onback to summary
public AnnotationValueFilter on(TypeDescription instrumentedType)

Creates an annotation value filter for writing annotations on an instrumented type.

Parameters
instrumentedType:TypeDescription

The instrumented type onto which the annotations are written.

Returns:AnnotationValueFilter

An annotation value filter to be used when writing annotations onto the given type.

onback to summary
public AnnotationValueFilter on(FieldDescription fieldDescription)

Creates an annotation value filter for writing annotations on a field.

Parameters
fieldDescription:FieldDescription

The field onto which the annotations are written.

Returns:AnnotationValueFilter

An annotation value filter to be used when writing annotations onto the given field.

onback to summary
public AnnotationValueFilter on(MethodDescription methodDescription)

Creates an annotation value filter for writing annotations on a method.

Parameters
methodDescription:MethodDescription

The method onto which the annotations are written.

Returns:AnnotationValueFilter

An annotation value filter to be used when writing annotations onto the given method.

onback to summary
public AnnotationValueFilter on(RecordComponentDescription recordComponentDescription)

Creates an annotation value filter for writing annotations on a record component.

Parameters
recordComponentDescription:RecordComponentDescription

The record component onto which the annotations are written.

Returns:AnnotationValueFilter

An annotation value filter to be used when writing annotations onto the given record component.