Top Description Methods
jakarta.enterprise.inject.build.compatible.spi

public Interface MethodConfig

extends DeclarationConfig
Imports
java.lang.annotation.Annotation, java.util.List, java.util.function.Predicate, jakarta.enterprise.lang.model.AnnotationInfo, jakarta.enterprise.lang.model.declarations.MethodInfo

Allows adding annotations to and removing annotations from a method. Note that the method is not physically altered, the modifications are only seen by the CDI container.
Since
4.0
See Also
Enhancement

Method Summary

Modifier and TypeMethod and Description
public MethodConfig

Returns:

this configurator object, to allow fluent usage
addAnnotation
(Class<? extends Annotation>
the annotation type, must not be null
annotationType
)

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.addAnnotation.

Adds a marker annotation of given type to this method.

public MethodConfig

Returns:

this configurator object, to allow fluent usage
addAnnotation
(AnnotationInfo
the annotation to add to this method, must not be null
annotation
)

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.addAnnotation.

Adds given annotation to this method.

public MethodConfig

Returns:

this configurator object, to allow fluent usage
addAnnotation
(Annotation
the annotation to add to this method, must not be null
annotation
)

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.addAnnotation.

Adds given annotation to this method.

public MethodInfo

Returns:

the MethodInfo corresponding to this transformed method, never null
info
()

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.info.

Returns the MethodInfo corresponding to this transformed method.

public List<ParameterConfig>

Returns:

immutable list of ParameterConfig objects, never null
parameters
()

Returns a list of ParameterConfig objects for each parameter of this method.

public MethodConfig

Returns:

this configurator object, to allow fluent usage
removeAllAnnotations
()

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.removeAllAnnotations.

Removes all annotations from this method.

public MethodConfig

Returns:

this configurator object, to allow fluent usage
removeAnnotation
(Predicate<AnnotationInfo>
an annotation predicate, must not be null
predicate
)

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.removeAnnotation.

Removes all annotations matching given predicate from this method.

Method Detail

addAnnotationback to summary
public MethodConfig addAnnotation(Class<? extends Annotation> annotationType)

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.addAnnotation.

Adds a marker annotation of given type to this method. Does not allow configuring annotation members.

Parameters
annotationType:Class<? extends Annotation>

the annotation type, must not be null

Returns:MethodConfig

this configurator object, to allow fluent usage

Annotations
@Override
addAnnotationback to summary
public MethodConfig addAnnotation(AnnotationInfo annotation)

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.addAnnotation.

Adds given annotation to this method. The AnnotationInfo can be obtained from an annotation target, or constructed from scratch using AnnotationBuilder.

Parameters
annotation:AnnotationInfo

the annotation to add to this method, must not be null

Returns:MethodConfig

this configurator object, to allow fluent usage

Annotations
@Override
addAnnotationback to summary
public MethodConfig addAnnotation(Annotation annotation)

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.addAnnotation.

Adds given annotation to this method. The annotation instance is typically a subclass of AnnotationLiteral.

Parameters
annotation:Annotation

the annotation to add to this method, must not be null

Returns:MethodConfig

this configurator object, to allow fluent usage

Annotations
@Override
infoback to summary
public MethodInfo info()

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.info.

Returns the MethodInfo corresponding to this transformed method.

Returns:MethodInfo

the MethodInfo corresponding to this transformed method, never null

Annotations
@Override
parametersback to summary
public List<ParameterConfig> parameters()

Returns a list of ParameterConfig objects for each parameter of this method.

Returns:List<ParameterConfig>

immutable list of ParameterConfig objects, never null

removeAllAnnotationsback to summary
public MethodConfig removeAllAnnotations()

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.removeAllAnnotations.

Removes all annotations from this method.

Returns:MethodConfig

this configurator object, to allow fluent usage

Annotations
@Override
removeAnnotationback to summary
public MethodConfig removeAnnotation(Predicate<AnnotationInfo> predicate)

Redeclares jakarta.enterprise.inject.build.compatible.spi.DeclarationConfig.removeAnnotation.

Removes all annotations matching given predicate from this method.

Parameters
predicate:Predicate<AnnotationInfo>

an annotation predicate, must not be null

Returns:MethodConfig

this configurator object, to allow fluent usage

Annotations
@Override