T - public final class JAXBData<T> extends Object implements Data<T>
It stores either Object (defined by Generic <T>) or String.
On asking for Object of type <T>, it will respond with the object if it exists, or unmarshal the string and pass the result back.
On asking for String, it will respond with the String if it exists, or marshal the String and pass the result back.
| Modifier and Type | Method and Description |
|---|---|
T |
asObject()
Respond with the Object of type <T> if it exists, or unmarshal from String
and pass the result back.
|
T |
asObject(EnvJAXB env)
Respond with the Object of type <T> if it exists, or unmarshal from String
and pass the result back.
|
String |
asString()
Respond with the String if it exists, or marshal the String and pass the result back.
|
String |
asString(EnvJAXB env)
Respond with the String if it exists, or marshal the String and pass the result back.
|
void |
direct(InputStream input,
OutputStream output) |
InputStream |
getInputStream() |
Class<T> |
getTypeClass()
Return the Class Type supported by this DataObject
|
Data<T> |
in(Data.TYPE type) |
Data<T> |
load(InputStream is) |
Data<T> |
load(Reader rdr) |
Data<T> |
load(String str) |
Data<T> |
load(T t) |
Data<T> |
option(int option)
Set a particular option on an existing Out
if int is negative, it should remove the option
|
Data<T> |
out(Data.TYPE type) |
Data<T> |
to(OutputStream os) |
JAXBData<T> |
to(Writer writer) |
String |
toString()
For Debugging Convenience, we marshal to String if possible.
|
public String asString(EnvJAXB env) throws APIException
Explicitly use a specific Env for logging purposes
env - APIExceptionpublic String asString() throws APIException
asString in interface Data<T>APIExceptionpublic Data<T> to(OutputStream os) throws APIException, IOException
to in interface Data<T>APIExceptionIOExceptionpublic JAXBData<T> to(Writer writer) throws APIException, IOException
to in interface Data<T>APIExceptionIOExceptionpublic InputStream getInputStream() throws APIException
APIExceptionpublic T asObject(EnvJAXB env) throws APIException
Explicitly use a specific Env for logging purposes
env - APIExceptionpublic T asObject() throws APIException
However, use the Env the Data Object was created with.
asObject in interface Data<T>APIExceptionpublic Class<T> getTypeClass()
getTypeClass in interface Data<T>public String toString()
Since toString() must not throw exceptions, the function just catches and prints an error, which is probably not the behavior desired.
Therefore, use "asString()" where possible in actual Transactional code.
toString in class ObjectObject.toString()public Data<T> load(T t) throws APIException
load in interface Data<T>APIExceptionpublic Data<T> load(String str) throws APIException
load in interface Data<T>APIExceptionpublic Data<T> load(InputStream is) throws APIException
load in interface Data<T>APIExceptionpublic Data<T> load(Reader rdr) throws APIException
load in interface Data<T>APIExceptionpublic void direct(InputStream input, OutputStream output) throws APIException, IOException
direct in interface Data<T>APIExceptionIOExceptionCopyright © 2017. All rights reserved.