public class DefaultDeserializer extends Object implements SerDeserializer
This uses the standard MetaBean, MetaProperty and BeanBuilder.
| Modifier and Type | Field and Description |
|---|---|
static SerDeserializer |
INSTANCE
Singleton.
|
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultDeserializer()
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
build(Class<?> beanType,
BeanBuilder<?> builder)
Builds the resulting object.
|
BeanBuilder<?> |
createBuilder(Class<?> beanType,
MetaBean metaBean)
Creates the stateful builder that captures state as the parse progresses.
|
MetaBean |
findMetaBean(Class<?> beanType)
Lookup the meta-bean for the speecified type.
|
MetaProperty<?> |
findMetaProperty(Class<?> beanType,
MetaBean metaBean,
String propertyName)
Lookup the meta-property for the specified property name.
|
void |
setValue(BeanBuilder<?> builder,
MetaProperty<?> metaProp,
Object value)
Sets the parsed value into the builder.
|
String |
toString() |
public static final SerDeserializer INSTANCE
public MetaBean findMetaBean(Class<?> beanType)
SerDeserializerIf the type is not a bean, then null may be returned.
findMetaBean in interface SerDeserializerbeanType - the type being processed, not nullpublic BeanBuilder<?> createBuilder(Class<?> beanType, MetaBean metaBean)
SerDeserializer
This is normally a BeanBuilder however any type may be returned.
createBuilder in interface SerDeserializerbeanType - the type being processed, not nullmetaBean - the meta-bean, null if not a bean typepublic MetaProperty<?> findMetaProperty(Class<?> beanType, MetaBean metaBean, String propertyName)
SerDeserializerReturn null if a property has been deleted, which will cause the parser to discard the property.
Return a non-null meta-property to parse the property. If the property was renamed, or had a type change, then the meta-property should match the property as originally stored.
findMetaProperty in interface SerDeserializerbeanType - the type being processed, not nullmetaBean - the meta-bean, null if not a bean typepropertyName - the property name being parsed, not nullpublic void setValue(BeanBuilder<?> builder, MetaProperty<?> metaProp, Object value)
SerDeserializersetValue in interface SerDeserializerbuilder - the builder, null if not interested in the parse progressmetaProp - the meta-property, not nullvalue - the parsed value, may be nullpublic Object build(Class<?> beanType, BeanBuilder<?> builder)
SerDeserializerThis method finishes the builder and returns the final object. The migrator could validate or manipulate data here once all data is parsed, for example to default a missing field.
build in interface SerDeserializerbeanType - the type being processed, not nullbuilder - the builder, null if not interested in the parse progressCopyright © 2007–2017 Joda.org. All rights reserved.