Class BeanPropertyMeta.Builder
- Enclosing class:
- BeanPropertyMeta
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuild()canRead()Marks this property as readable.canWrite()Marks this property as writable.delegateFor(BeanPropertyMeta value) Sets the original bean property that this one is overriding.overrideValue(Object value) Sets the overridden value of this bean property.rawMetaType(Class<?> value) Sets the raw metadata type for this bean property from aClass.rawMetaType(BeanInfo<?> value) Sets the raw metadata type for this bean property.readTransform(BiFunction<BeanSession, Object, Object> value) Installs the read-side value transform for this property.Marks this property as a constructor argument.setExtraKeys(MethodInfo value) Sets the extra keys method for this bean property.Sets the field for this bean property.setGetter(MethodInfo value) Sets the getter method for this bean property.setInnerField(FieldInfo value) Sets the inner field for this bean property from aFieldInfo.setSetter(MethodInfo value) Sets the setter method for this bean property.booleanvalidate(BeanTypeResolver bc, TypeVariables typeVarImpls, Set<String> bpro, Set<String> bpwo) Validates this bean property configuration.writeTransform(BiFunction<BeanSession, Object, Object> value) Installs the write-side value transform for this property.
-
Field Details
-
name
-
innerField
-
getter
-
setter
-
rawTypeMeta
-
swap
-
readTransform
-
writeTransform
-
dictionaryClasses
-
views
-
isUri
-
typeMeta
-
-
Method Details
-
build
- Returns:
- A new BeanPropertyMeta object using this builder.
-
delegateFor
Sets the original bean property that this one is overriding.- Parameters:
value- The original bean property that this one is overriding. Must not benull .- Returns:
- This object.
-
readTransform
Installs the read-side value transform for this property.Applied to the raw getter result by
BeanPropertyMeta.get(BeanMap,String)before it is returned to the caller. Defaults to identity (raw value passes through unchanged).Used by the marshalling layer to install
ObjectSwap-aware behavior at bean-meta construction time; the bean-modeling layer itself only invokes the function and does not directly referenceObjectSwap.- Parameters:
value- The transform function. Must not benull .- Returns:
- This object.
-
writeTransform
Installs the write-side value transform for this property.Applied to the incoming value by
BeanPropertyMeta.set(BeanMap,String,Object)before the raw setter is invoked. Defaults to identity (raw value passes through unchanged).Used by the marshalling layer to install
ObjectSwap-aware behavior at bean-meta construction time; the bean-modeling layer itself only invokes the function and does not directly referenceObjectSwap.- Parameters:
value- The transform function. Must not benull .- Returns:
- This object.
-
overrideValue
Sets the overridden value of this bean property.- Parameters:
value- The overridden value of this bean property. Can benull , in which case no override is applied.- Returns:
- This object.
-
rawMetaType
Sets the raw metadata type for this bean property.- Parameters:
value- The raw metadata type for this bean property. Must not benull .- Returns:
- This object.
-
rawMetaType
Sets the raw metadata type for this bean property from aClass.Convenience overload that resolves the supplied class via the property's
BeanTypeResolver, allowing callers from the bean-modeling layer to seed the type without holding aBeanInforeference.When the owning
BeanMetawas built via the commons-side path (BeanMeta.of(Class, BeanConfigContext)), no resolver is available, sorawTypeMeta/typeMetaare leftnull and the property runs in raw-reflection mode.- Parameters:
value- The raw metadata type for this bean property. Must not benull .- Returns:
- This object.
-
canRead
Marks this property as readable.- Returns:
- This object.
-
canWrite
Marks this property as writable.- Returns:
- This object.
-
setAsConstructorArg
Marks this property as a constructor argument.- Returns:
- This object.
-
setExtraKeys
Sets the extra keys method for this bean property.- Parameters:
value- The method info that returns extra keys for this property. Must not benull .- Returns:
- This object.
-
setField
Sets the field for this bean property.- Parameters:
value- The field info for this bean property. Must not benull .- Returns:
- This object.
-
setGetter
Sets the getter method for this bean property.- Parameters:
value- The getter method info for this bean property. Must not benull .- Returns:
- This object.
-
setInnerField
Sets the inner field for this bean property from aFieldInfo.- Parameters:
value- The field info containing the inner field. Must not benull .- Returns:
- This object.
-
setSetter
Sets the setter method for this bean property.- Parameters:
value- The setter method info for this bean property. Must not benull .- Returns:
- This object.
-
validate
public boolean validate(BeanTypeResolver bc, TypeVariables typeVarImpls, Set<String> bpro, Set<String> bpwo) throws Exception Validates this bean property configuration.After validation succeeds, marshalling-side callers (currently
BeanMeta) read thedictionaryClassesfield to construct the property-level registry lookup and store it in a side-map keyed by the builtBeanPropertyMeta. The bean-modeling layer itself no longer carries a concrete registry reference.When
bcisnull (commons-side path), this method runs in raw-reflection mode: annotation reads are routed throughBeanConfigContext.getAnnotationProvider()but noClassMetaresolution orObjectSwapdiscovery is performed; the property'srawTypeMeta/typeMetastaynull and the resultingBeanPropertyMetaexposes raw getter/setter invocation only.- Parameters:
bc- The bean context. May benull for the commons-side path.typeVarImpls- Type variable implementations. Ignored whenbcisnull .bpro- Bean properties read-only set. Must not benull (pass an empty set for none).bpwo- Bean properties write-only set. Must not benull (pass an empty set for none).- Returns:
true if this property is valid,false otherwise.- Throws:
Exception- If validation fails.
-