|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.joda.beans.ser.DefaultDeserializer
public class DefaultDeserializer
Default deserializer that expects the input to match the current classpath beans.
This uses the standard MetaBean, MetaProperty and BeanBuilder.
Implementations must be thread-safe singletons.
| Field Summary | |
|---|---|
static SerDeserializer |
INSTANCE
Singleton. |
| Constructor Summary | |
|---|---|
protected |
DefaultDeserializer()
Creates an instance. |
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final SerDeserializer INSTANCE
| Constructor Detail |
|---|
protected DefaultDeserializer()
| Method Detail |
|---|
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 null
public 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 type
public 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 null
public void setValue(BeanBuilder<?> builder,
MetaProperty<?> metaProp,
Object value)
SerDeserializer
setValue in interface SerDeserializerbuilder - the builder, null if not interested in the parse progressmetaProp - the meta-property, not nullvalue - the parsed value, may be null
public 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 progress
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||