SerDeserializerpublic class DefaultDeserializer extends java.lang.Object implements SerDeserializer
This uses the standard MetaBean, MetaProperty and BeanBuilder.
| Modifier and Type | Field | Description |
|---|---|---|
static SerDeserializer |
INSTANCE |
Singleton.
|
| Modifier | Constructor | Description |
|---|---|---|
protected |
DefaultDeserializer() |
Creates an instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.Object |
build(java.lang.Class<?> beanType,
BeanBuilder<?> builder) |
Builds the resulting object.
|
BeanBuilder<?> |
createBuilder(java.lang.Class<?> beanType,
MetaBean metaBean) |
Creates the stateful builder that captures state as the parse progresses.
|
MetaBean |
findMetaBean(java.lang.Class<?> beanType) |
Lookup the meta-bean for the speecified type.
|
MetaProperty<?> |
findMetaProperty(java.lang.Class<?> beanType,
MetaBean metaBean,
java.lang.String propertyName) |
Lookup the meta-property for the specified property name.
|
void |
setValue(BeanBuilder<?> builder,
MetaProperty<?> metaProp,
java.lang.Object value) |
Sets the parsed value into the builder.
|
java.lang.String |
toString() |
public static final SerDeserializer INSTANCE
public MetaBean findMetaBean(java.lang.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(java.lang.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(java.lang.Class<?> beanType, MetaBean metaBean, java.lang.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, java.lang.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 java.lang.Object build(java.lang.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 progresspublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2007–2018 Joda.org. All rights reserved.