B
- The bean typeP
- The property type@Internal public abstract class AbstractBeanProperty<B,P> extends Object implements UnsafeBeanProperty<B,P>
BeanProperty
. Generated byte code should be used to create a subclass
and implement the BeanProperty.get(Object)
and BeanProperty.set(Object, Object)
methods. This class is subclasses at compilation time by generated byte code and should not be used directly.CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Modifier | Constructor and Description |
---|---|
protected |
AbstractBeanProperty(BeanIntrospection<B> introspection,
Class<P> type,
String name,
AnnotationMetadata annotationMetadata,
Argument[] typeArguments)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Argument<P> |
asArgument()
Represent the type as an argument, including any generic type information.
|
boolean |
equals(Object o) |
P |
get(B bean)
Read the bean value.
|
AnnotationMetadata |
getAnnotationMetadata()
Supplies the metadata.
|
BeanIntrospection<B> |
getDeclaringBean() |
String |
getName() |
Class<P> |
getType() |
P |
getUnsafe(B bean)
Unsafe version of
BeanProperty.get(Object) . |
int |
hashCode() |
protected abstract P |
readInternal(B bean)
Reads the bean property.
|
void |
set(B bean,
P value)
Write the bean value.
|
void |
setUnsafe(B bean,
P value)
Unsafe version of
BeanProperty.set(Object, Object) . |
String |
toString() |
B |
withValue(B bean,
P value)
This method will attempt to modify the property or if this is a immutable type using a copy constructor to return a new instance with the new value.
|
protected B |
withValueInternal(B bean,
P value)
Mutates a property value.
|
B |
withValueUnsafe(B bean,
P value)
Unsafe version of
BeanProperty.withValue(Object, Object) . |
protected abstract void |
writeInternal(B bean,
P value)
Writes a property value.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
convertAndSet, get, get, get, get, getDeclaringType, hasSetterOrConstructorArgument, isReadOnly, isReadWrite, isWriteOnly
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
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, findRepeatableAnnotation, findRepeatableAnnotation, 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, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
getAnnotationValuesByName, getDeclaredAnnotationValuesByName, getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
@Internal protected AbstractBeanProperty(@NonNull BeanIntrospection<B> introspection, @NonNull Class<P> type, @NonNull String name, @Nullable AnnotationMetadata annotationMetadata, @Nullable Argument[] typeArguments)
introspection
- The parent introspectiontype
- The property typename
- The property nameannotationMetadata
- The annotation metadatatypeArguments
- optional type arguments@NonNull public Class<P> getType()
getType
in interface BeanProperty<B,P>
@NonNull public Argument<P> asArgument()
BeanProperty
asArgument
in interface BeanProperty<B,P>
asArgument
in interface ArgumentCoercible<P>
@NonNull public final BeanIntrospection<B> getDeclaringBean()
getDeclaringBean
in interface BeanProperty<B,P>
public AnnotationMetadata getAnnotationMetadata()
AnnotationMetadataProvider
AnnotationMetadata.EMPTY_METADATA
.getAnnotationMetadata
in interface AnnotationMetadataProvider
AnnotationMetadata
@Nullable public final P get(@NonNull B bean)
BeanProperty
get
in interface BeanProperty<B,P>
bean
- The bean to read frompublic final P getUnsafe(B bean)
UnsafeBeanProperty
BeanProperty.get(Object)
.getUnsafe
in interface UnsafeBeanProperty<B,P>
bean
- The bean to read frompublic B withValue(@NonNull B bean, @Nullable P value)
BeanProperty
This differs from BeanProperty.set(Object, Object)
which will throw an exception if the property does not have a setter.
BeanProperty.set(Object, Object)
invoked to mutate the propertyUnsupportedOperationException
is thrownwithValue
in interface BeanProperty<B,P>
bean
- The beanvalue
- The new valuepublic final B withValueUnsafe(B bean, P value)
UnsafeBeanProperty
BeanProperty.withValue(Object, Object)
.withValueUnsafe
in interface UnsafeBeanProperty<B,P>
bean
- The beanvalue
- The new valuepublic final void set(@NonNull B bean, @Nullable P value)
BeanProperty
set
in interface BeanProperty<B,P>
bean
- The beanvalue
- The value to writepublic final void setUnsafe(B bean, P value)
UnsafeBeanProperty
BeanProperty.set(Object, Object)
.setUnsafe
in interface UnsafeBeanProperty<B,P>
bean
- The beanvalue
- The value to write@Internal protected B withValueInternal(B bean, P value)
bean
- The beanvalue
- The valueBeanProperty.withValue(Object, Object)
@Internal protected abstract void writeInternal(@NonNull B bean, @Nullable P value)
bean
- The beanvalue
- The value@Internal protected abstract P readInternal(@NonNull B bean)
bean
- The bean