|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.netseeker.ejoe.adapter.BaseAdapter de.netseeker.ejoe.adapter.UTF8StringAdapter de.netseeker.ejoe.adapter.json.JsonLibAdapter
public class JsonLibAdapter
Multimode SerializeAdapter supporting JSON via the JSON-lib. By default this adapter is write-only: It is able to serialize Objects to JSON but does just return JSON strings on read operations. The read mode can be switched but then Objects according to what JSON-lib creates will be returned.
Constructor Summary | |
---|---|
JsonLibAdapter()
Creates a write-only instance of this adapter. |
|
JsonLibAdapter(boolean writeOnly)
Creates either a write-only or a mixed-mode instance of this adapter. |
Method Summary | |
---|---|
java.lang.String |
getContentType()
|
java.lang.Object |
read(java.io.InputStream in)
Deserializes an object out of an given InputStream |
void |
write(java.lang.Object obj,
java.io.OutputStream out)
Serializes an object into an output stream |
Methods inherited from class de.netseeker.ejoe.adapter.BaseAdapter |
---|
handleClassLoaderChange, isSelfBuffered, requiresCustomEOFHandling |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JsonLibAdapter()
public JsonLibAdapter(boolean writeOnly)
writeOnly
- whether to uses write-only mode or notMethod Detail |
---|
public java.lang.Object read(java.io.InputStream in) throws java.lang.Exception
SerializeAdapter
read
in interface SerializeAdapter
read
in class UTF8StringAdapter
in
- the input stream to use for deserialization
java.lang.Exception
public void write(java.lang.Object obj, java.io.OutputStream out) throws java.lang.Exception
SerializeAdapter
write
in interface SerializeAdapter
write
in class UTF8StringAdapter
obj
- object that should get serializedout
- the outputstream into which the object should serialized
java.lang.Exception
public java.lang.String getContentType()
getContentType
in interface SerializeAdapter
getContentType
in class UTF8StringAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |