Interface BeanReadProperty<B,T>
- Type Parameters:
B- The bean typeT- The bean property type
- All Superinterfaces:
AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, ArgumentCoercible<T>, Named
- All Known Subinterfaces:
BeanProperty<B,T>, UnsafeBeanProperty<B, T>, UnsafeBeanReadProperty<B, T>
- All Known Implementing Classes:
AbstractBeanProperty
public interface BeanReadProperty<B,T>
extends AnnotatedElement, AnnotationMetadataDelegate, ArgumentCoercible<T>
Represents a read write property of a bean.
A BeanReadProperty allows you to read the value of a property via get(Object), without using reflection.
The annotations of a property can be inspected via the AnnotationMetadataProvider.getAnnotationMetadata() method.
- Since:
- 4.4.0
- Author:
- Denis Stepanov
- See Also:
-
Field Summary
Fields inherited from interface AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBERFields inherited from interface AnnotationSource
EMPTY -
Method Summary
Modifier and TypeMethodDescriptionRepresent the type as an argument, including any generic type information.@Nullable TRead the bean value.default <T2> Optional<T2> get(B bean, ArgumentConversionContext<T2> conversionContext) Read the value and try to convert it to the given type.default <T2> Optional<T2> Read the value and try to convert it to the given type.default <T2> Optional<T2> Read the value and try to convert it to the given type.default <T2> @Nullable T2Read the value and try to convert it to the given type.The declaring type of the property.getType()Methods inherited from interface AnnotatedElement
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullableMethods inherited from interface AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresentMethods inherited from interface AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, 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, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface AnnotationMetadataProvider
getAnnotationMetadata
-
Method Details
-
getDeclaringBean
BeanIntrospection<B> getDeclaringBean()- Returns:
- The declaring bean introspection.
-
getDeclaringType
-
get
Read the bean value.- Parameters:
bean- The bean to read from- Returns:
- The value
- Throws:
IllegalArgumentException- If the bean instance if not of the correct type
-
get
-
get
-
get
Read the value and try to convert it to the given type.- Type Parameters:
T2- The generic type- Parameters:
bean- The beanconversionContext- The conversion context to use- Returns:
- The value if conversion was possible.
-
get
Read the value and try to convert it to the given type.- Type Parameters:
T2- The generic type- Parameters:
bean- The beantype- The typedefaultValue- The default value if conversion is not possible- Returns:
- The value if conversion was possible.
-
getType
-
asArgument
Represent the type as an argument, including any generic type information.- Specified by:
asArgumentin interfaceArgumentCoercible<B>- Returns:
- The argument
-