B
- The bean typeP
- The property type@Internal public abstract class AbstractBeanProperty<B,P> extends java.lang.Object implements BeanProperty<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,
java.lang.Class<P> type,
java.lang.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(java.lang.Object o) |
P |
get(B bean)
Read the bean value.
|
AnnotationMetadata |
getAnnotationMetadata()
Supplies the metadata.
|
BeanIntrospection<B> |
getDeclaringBean() |
java.lang.String |
getName() |
java.lang.Class<P> |
getType() |
int |
hashCode() |
protected abstract P |
readInternal(B bean)
Reads the bean property.
|
void |
set(B bean,
P value)
Write the bean value.
|
java.lang.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.
|
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
getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
@Internal protected AbstractBeanProperty(@NonNull BeanIntrospection<B> introspection, @NonNull java.lang.Class<P> type, @NonNull java.lang.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 java.lang.String getName()
@NonNull public java.lang.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 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 void set(@NonNull B bean, @Nullable P value)
BeanProperty
set
in interface BeanProperty<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 beanpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object