public class JAXBStringifier<T> extends Object implements IOStringifier<T>
| Constructor and Description |
|---|
JAXBStringifier(Class<?>... classes) |
JAXBStringifier(QName qname,
Class<?>... classes) |
| Modifier and Type | Method and Description |
|---|---|
JAXBStringifier<T> |
asFragment(boolean fragment)
Set Generate Fragment
|
JAXBStringifier<T> |
pretty(boolean pretty)
Set Pretty XML, where possible
|
void |
refresh(Env env)
The Service will call this when (service-defined) configurations change.
|
void |
serviceDestroy(Env env)
Parallel to servicePrestart, serviceDestroy tells the implementor that
the service is ending, and to take this opportunity to close out any
content under it's control that can or should be closed explicitly.
|
void |
servicePrestart(Env env)
The Service using LifeCycle Elements is required to call this method at
the appropriate startup time.
|
String |
stringify(Env env,
T input,
boolean... options)
Marshal from a String to an Object T, using contents from Env as necessary.
|
void |
stringify(Env env,
T input,
OutputStream os,
boolean... options)
Marshal from a String to an Object T, using contents from Env as necessary.
|
void |
stringify(Env env,
T input,
Writer writer,
boolean... options)
Marshal from an Object T onto a Writer, using contents from Env as necessary.
|
void |
threadDestroy(Env env)
Parallel to threadPrestart, threadDestroy tells the implementor that the
service is ending this particular thread, and to take this opportunity to
close out any content specific to this thread that can be closed.
|
void |
threadPrestart(Env env)
Many cases of implementations are not thread safe, and mechanisms must be
derived to accomodate them by holding per Thread.
|
public JAXBStringifier(Class<?>... classes) throws APIException
APIExceptionpublic JAXBStringifier(QName qname, Class<?>... classes) throws APIException
APIExceptionpublic void stringify(Env env, T input, Writer writer, boolean... options) throws APIException
IOStringifier
Implementations should use the Env to call "env.startTime(
stringify in interface IOStringifier<T>APIExceptionpublic void stringify(Env env, T input, OutputStream os, boolean... options) throws APIException
IOStringifier
Implementations should use the Env to call "env.startXMLTime()" to mark
XML time, since this is often a costly process.
stringify in interface IOStringifier<T>APIExceptionpublic String stringify(Env env, T input, boolean... options) throws APIException
Stringifier
Implementations should use the Env to call "env.startXMLTime()" to mark
XML time, since this is often a costly process.
stringify in interface Stringifier<T>APIExceptionpublic void servicePrestart(Env env) throws APIException
LifeCycle
An excellent use is to establish security credentials with a backend
after appropriate configurations have been read and available as part of
the Env Object.
servicePrestart in interface LifeCycleAPIExceptionpublic void threadPrestart(Env env) throws APIException
LifeCycle
ThreadLocal is a valuable resource, but start up times within the
thread, depending on what it is, can be substantial.
Use ThreadPrestart to do all that is possible before actually performing work, i.e. inside of a client transaction.
threadPrestart in interface LifeCycleAPIExceptionpublic void refresh(Env env) throws APIException
LifeCycleThis mechanism allows the Service to recognize events, such as file changes, and pass on the event to all LifeCycle implementors.
The code should take the opportunity to evaluate configuration and change as necessary.
RefreshableThreadObject, because it implements LifeCycle, and
responds to the refresh command.refresh in interface LifeCycleAPIExceptionpublic void threadDestroy(Env env) throws APIException
LifeCyclethreadDestroy in interface LifeCycleAPIExceptionpublic void serviceDestroy(Env env) throws APIException
LifeCycleserviceDestroy in interface LifeCycleAPIExceptionpublic JAXBStringifier<T> pretty(boolean pretty)
IOStringifierpretty in interface IOStringifier<T>public JAXBStringifier<T> asFragment(boolean fragment)
IOStringifierasFragment in interface IOStringifier<T>Copyright © 2017. All rights reserved.