|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.jackson.map.util.JSONWrappedObject
public class JSONWrappedObject
General-purpose wrapper class that can be used to decorate serialized value with arbitrary literal prefix and suffix. This can be used for example to construct arbitrary Javascript values (similar to how basic function name and parenthesis are used with JSONP).
JSONPObject| Field Summary | |
|---|---|
protected String |
_prefix
Literal String to output before serialized value. |
protected JavaType |
_serializationType
Optional static type to use for serialization; if null, runtime type is used. |
protected String |
_suffix
Literal String to output after serialized value. |
protected Object |
_value
Value to be serialized as JSONP padded; can be null. |
| Constructor Summary | |
|---|---|
JSONWrappedObject(String prefix,
String suffix,
Object value)
|
|
JSONWrappedObject(String prefix,
String suffix,
Object value,
Class<?> rawType)
|
|
JSONWrappedObject(String prefix,
String suffix,
Object value,
JavaType asType)
|
|
| Method Summary | |
|---|---|
String |
getPrefix()
|
JavaType |
getSerializationType()
|
String |
getSuffix()
|
Object |
getValue()
|
void |
serialize(JsonGenerator jgen,
SerializerProvider provider)
|
void |
serializeWithType(JsonGenerator jgen,
SerializerProvider provider,
TypeSerializer typeSer)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final String _prefix
protected final String _suffix
protected final Object _value
protected final JavaType _serializationType
| Constructor Detail |
|---|
public JSONWrappedObject(String prefix,
String suffix,
Object value)
public JSONWrappedObject(String prefix,
String suffix,
Object value,
JavaType asType)
public JSONWrappedObject(String prefix,
String suffix,
Object value,
Class<?> rawType)
| Method Detail |
|---|
public void serializeWithType(JsonGenerator jgen,
SerializerProvider provider,
TypeSerializer typeSer)
throws IOException,
JsonProcessingException
serializeWithType in interface JsonSerializableWithTypeIOException
JsonProcessingException
public void serialize(JsonGenerator jgen,
SerializerProvider provider)
throws IOException,
JsonProcessingException
serialize in interface JsonSerializableIOException
JsonProcessingExceptionpublic String getPrefix()
public String getSuffix()
public Object getValue()
public JavaType getSerializationType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||