|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.jackson.map.ser.BeanPropertyWriter
public abstract class BeanPropertyWriter
Base bean property handler class, which implements common parts of reflection-based functionality for accessing a property value and serializing it.
| Nested Class Summary | |
|---|---|
static class |
BeanPropertyWriter.NonDefaultField
Property writer that outputs all property if and only if it has non-null value. |
static class |
BeanPropertyWriter.NonDefaultMethod
Property writer that outputs all property if and only if it has non-null value. |
static class |
BeanPropertyWriter.NonNullField
Property writer that outputs all property if and only if it has non-null value. |
static class |
BeanPropertyWriter.NonNullMethod
Property writer that outputs all property if and only if it has non-null value. |
static class |
BeanPropertyWriter.StdField
Basic property writer that outputs property entry independent of what value property has. |
static class |
BeanPropertyWriter.StdMethod
Basic property writer that outputs property entry independent of what value property has. |
| Field Summary | |
|---|---|
protected Class<?> |
_cfgSerializationType
Type to use for locating serializer; normally same as return type of the accessor method, but may be overridden by annotations. |
protected String |
_name
Logical name of the property; will be used as the field name under which value for the property is written. |
protected JsonSerializer<Object> |
_serializer
Serializer to use for writing out the value: null if it can not be known statically; non-null if it can. |
| Constructor Summary | |
|---|---|
BeanPropertyWriter(String name,
JsonSerializer<Object> ser,
Class<?> serType)
|
|
| Method Summary | |
|---|---|
abstract Object |
get(Object bean)
Method that can be used to access value of the property this Object describes, from given bean instance. |
abstract Type |
getGenericPropertyType()
Get the generic property type of this property writer. |
String |
getName()
|
abstract Class<?> |
getReturnType()
|
Class<?> |
getSerializationType()
|
boolean |
hasSerializer()
|
abstract void |
serializeAsField(Object bean,
JsonGenerator jgen,
SerializerProvider prov)
Method called to access property that this bean stands for, from within given bean, and to serialize it as a Json Object field using appropriate serializer. |
abstract BeanPropertyWriter |
withSerializer(JsonSerializer<Object> ser)
Method that will construct and return a new writer that has same properties as this writer, but uses specified serializer instead of currently configured one (if any). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final String _name
protected final Class<?> _cfgSerializationType
protected final JsonSerializer<Object> _serializer
| Constructor Detail |
|---|
public BeanPropertyWriter(String name,
JsonSerializer<Object> ser,
Class<?> serType)
| Method Detail |
|---|
public abstract BeanPropertyWriter withSerializer(JsonSerializer<Object> ser)
public final boolean hasSerializer()
public final Class<?> getSerializationType()
public abstract Class<?> getReturnType()
public final String getName()
public abstract void serializeAsField(Object bean,
JsonGenerator jgen,
SerializerProvider prov)
throws Exception
Exception
public abstract Object get(Object bean)
throws Exception
Note: method is final as it should not need to be overridden -- rather,
calling method(s) (serializeAsField(java.lang.Object, org.codehaus.jackson.JsonGenerator, org.codehaus.jackson.map.SerializerProvider)) should be overridden
to change the behavior
Exceptionpublic abstract Type getGenericPropertyType()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||