public interface BeanElementBuilder extends ConfigurableElement
EMPTY_ELEMENT_ARRAY
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Modifier and Type | Method and Description |
---|---|
default <T extends java.lang.annotation.Annotation> |
annotate(java.lang.Class<T> annotationType)
Annotate this element with the given annotation type.
|
default <T extends java.lang.annotation.Annotation> |
annotate(java.lang.Class<T> annotationType,
java.util.function.Consumer<AnnotationValueBuilder<T>> consumer)
Annotate this element with the given annotation type.
|
default BeanElementBuilder |
annotate(java.lang.String annotationType)
Annotate this element with the given annotation type.
|
default <T extends java.lang.annotation.Annotation> |
annotate(java.lang.String annotationType,
java.util.function.Consumer<AnnotationValueBuilder<T>> consumer)
Annotate this element with the given annotation type.
|
BeanElementBuilder |
createWith(MethodElement element)
Specifies the bean will created with the given method element.
|
ClassElement |
getBeanType() |
Element |
getOriginatingElement() |
BeanElementBuilder |
inject()
Dependency inject this bean.
|
default BeanElementBuilder |
qualifier(AnnotationValue<?> qualifier)
Adds a qualifier for the given annotation value to the element.
|
default BeanElementBuilder |
qualifier(java.lang.String qualifier)
Adds a
Named qualifier to the element. |
default <T extends java.lang.annotation.Annotation> |
removeAnnotation(java.lang.Class<T> annotationType) |
default BeanElementBuilder |
removeAnnotation(java.lang.String annotationType)
Removes an annotation of the given type from the element.
|
default <T extends java.lang.annotation.Annotation> |
removeAnnotationIf(java.util.function.Predicate<AnnotationValue<T>> predicate)
Removes all annotations that pass the given predicate.
|
default <T extends java.lang.annotation.Annotation> |
removeStereotype(java.lang.Class<T> annotationType)
Removes a stereotype annotation of the given type from the element.
|
default BeanElementBuilder |
removeStereotype(java.lang.String annotationType)
Removes a stereotype of the given name from the element.
|
default BeanElementBuilder |
scope(AnnotationValue<?> scope)
Adds a scope for the given annotation value to the bean.
|
default BeanElementBuilder |
scope(java.lang.String scope)
Adds a scope for the given annotation value to the bean.
|
BeanElementBuilder |
typeArguments(ClassElement... types)
Fills the type arguments for the bean with the given types.
|
BeanElementBuilder |
typeArgumentsForType(ClassElement type,
ClassElement... types)
Fills the type arguments for the given interface or super class with the given types.
|
BeanElementBuilder |
typed(ClassElement... types)
Alters the exposed types for the bean limiting the exposed type to the given types.
|
BeanElementBuilder |
withFields(ElementQuery<FieldElement> fields,
java.util.function.Consumer<BeanFieldElement> beanFields)
Allows configuring fields of the bean.
|
BeanElementBuilder |
withMethods(ElementQuery<MethodElement> methods,
java.util.function.Consumer<BeanMethodElement> beanMethods)
Allows configuring methods of the bean.
|
BeanElementBuilder |
withParameters(java.util.function.Consumer<BeanParameterElement[]> parameters)
Allows configuring the parameters for the current constructor.
|
getDescription, getDescription, getDocumentation, getName, getNativeType, getSimpleName, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
getAnnotationMetadata
@NonNull ClassElement getBeanType()
@NonNull BeanElementBuilder createWith(@NonNull MethodElement element)
ClassElement.getPrimaryConstructor()
.
Note that the method can be a one of the following:
element
- The element@NonNull BeanElementBuilder typed(ClassElement... types)
types
- 1 or more types to expose@NonNull BeanElementBuilder typeArguments(@NonNull ClassElement... types)
typeArguments
in interface ConfigurableElement
types
- The types@NonNull BeanElementBuilder typeArgumentsForType(@Nullable ClassElement type, @NonNull ClassElement... types)
type
- The type or interface. If null, results in a no-optypes
- The types@NonNull default BeanElementBuilder scope(@NonNull AnnotationValue<?> scope)
scope
- The scope@NonNull default BeanElementBuilder scope(@NonNull java.lang.String scope)
scope
- The full qualified scope annotation name@NonNull BeanElementBuilder withMethods(@NonNull ElementQuery<MethodElement> methods, @NonNull java.util.function.Consumer<BeanMethodElement> beanMethods)
methods
- The ElementQuery
to locate selected methods.beanMethods
- A consumer that receives each BeanMethodElement
@NonNull BeanElementBuilder withFields(@NonNull ElementQuery<FieldElement> fields, @NonNull java.util.function.Consumer<BeanFieldElement> beanFields)
fields
- The ElementQuery
to locate fields.beanFields
- The bean fields@NonNull BeanElementBuilder withParameters(java.util.function.Consumer<BeanParameterElement[]> parameters)
parameters
- The parameters@NonNull default BeanElementBuilder qualifier(@Nullable java.lang.String qualifier)
ConfigurableElement
Named
qualifier to the element.qualifier
in interface ConfigurableElement
qualifier
- The qualifier. If null
an named annotation with no value is added assuming the default name.@NonNull default BeanElementBuilder qualifier(@NonNull AnnotationValue<?> qualifier)
ConfigurableElement
qualifier
in interface ConfigurableElement
qualifier
- The qualifier@NonNull default <T extends java.lang.annotation.Annotation> BeanElementBuilder annotate(@NonNull java.lang.String annotationType, @NonNull java.util.function.Consumer<AnnotationValueBuilder<T>> consumer)
Element
annotate
in interface Element
T
- The annotation generic typeannotationType
- The annotation typeconsumer
- A function that receives the AnnotationValueBuilder
default BeanElementBuilder removeAnnotation(@NonNull java.lang.String annotationType)
Element
If the annotation features any stereotypes these will also be removed unless there are other annotations that reference the stereotype to be removed.
In the case of repeatable annotations this method will remove all repeated annotations, effectively clearing out all declared repeated annotations of the given type.
removeAnnotation
in interface Element
annotationType
- The annotation typedefault <T extends java.lang.annotation.Annotation> BeanElementBuilder removeAnnotation(@NonNull java.lang.Class<T> annotationType)
removeAnnotation
in interface Element
T
- The annotation generic typeannotationType
- The annotation typeElement.removeAnnotation(String)
default <T extends java.lang.annotation.Annotation> BeanElementBuilder removeAnnotationIf(@NonNull java.util.function.Predicate<AnnotationValue<T>> predicate)
Element
removeAnnotationIf
in interface Element
T
- The annotation generic typepredicate
- The predicatedefault BeanElementBuilder removeStereotype(@NonNull java.lang.String annotationType)
Element
removeStereotype
in interface Element
annotationType
- The annotation typedefault <T extends java.lang.annotation.Annotation> BeanElementBuilder removeStereotype(@NonNull java.lang.Class<T> annotationType)
Element
removeStereotype
in interface Element
T
- The annotation generic typeannotationType
- The annotation type@NonNull default BeanElementBuilder annotate(@NonNull java.lang.String annotationType)
Element
@NonNull default <T extends java.lang.annotation.Annotation> BeanElementBuilder annotate(@NonNull java.lang.Class<T> annotationType, @NonNull java.util.function.Consumer<AnnotationValueBuilder<T>> consumer)
Element
annotate
in interface Element
T
- The annotation generic typeannotationType
- The annotation typeconsumer
- A function that receives the AnnotationValueBuilder
AnnotationValueBuilder
@NonNull default <T extends java.lang.annotation.Annotation> BeanElementBuilder annotate(@NonNull java.lang.Class<T> annotationType)
Element
annotate
in interface Element
T
- The annotation generic typeannotationType
- The annotation typeAnnotationValueBuilder
BeanElementBuilder inject()