public class JAXBDF<T> extends BaseDataFactory implements OldDataFactory<T>, IOObjectifier<T>, IOStringifier<T>
| Constructor and Description |
|---|
JAXBDF(EnvJAXB env,
Class<?>... classes) |
JAXBDF(EnvJAXB env,
QName qname,
Class<?>... classes) |
JAXBDF(EnvJAXB env,
Schema schema,
Class<?>... classes) |
JAXBDF(EnvJAXB env,
Schema schema,
QName qname,
Class<?>... classes) |
| Modifier and Type | Method and Description |
|---|---|
IOStringifier<T> |
asFragment(boolean fragment)
Set Generate Fragment
|
Class<T> |
getTypeClass() |
Data<T> |
newData() |
Data<T> |
newData(Env env) |
Data<T> |
newData(T type) |
Data<T> |
newDataFromStream(Env env,
InputStream input) |
Data<T> |
newDataFromString(String string) |
T |
newInstance()
Create a new object of type T.
|
T |
objectify(Env env,
InputStream is)
Marshal to Object T from an InputStream, using contents from Env as necessary.
|
T |
objectify(Env env,
Reader rdr)
Marshal to Object T from a Reader, using contents from Env as necessary.
|
T |
objectify(Env env,
String input)
Marshal to Object T from a String, using contents from Env as necessary.
|
T |
objectify(InputStream is) |
T |
objectify(Reader rdr) |
T |
objectify(String text) |
IOStringifier<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.
|
String |
stringify(T type) |
void |
stringify(T type,
OutputStream os) |
void |
stringify(T type,
Writer writer) |
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.
|
genSchema, getQNamepublic JAXBDF(EnvJAXB env, Class<?>... classes) throws APIException
APIExceptionpublic JAXBDF(EnvJAXB env, Schema schema, Class<?>... classes) throws APIException
APIExceptionpublic JAXBDF(EnvJAXB env, QName qname, Class<?>... classes) throws APIException
APIExceptionpublic JAXBDF(EnvJAXB env, Schema schema, QName qname, Class<?>... classes) throws APIException
APIExceptionpublic T newInstance() throws APIException
ObjectifiernewInstance in interface Objectifier<T>newInstance in interface OldDataFactory<T>APIExceptionpublic IOStringifier<T> pretty(boolean pretty)
IOStringifierpretty in interface IOStringifier<T>public IOStringifier<T> asFragment(boolean fragment)
IOStringifierasFragment in interface IOStringifier<T>public 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 Data<T> newData()
newData in interface DataFactory<T>public Data<T> newDataFromStream(Env env, InputStream input) throws APIException
newDataFromStream in interface OldDataFactory<T>APIExceptionpublic Data<T> newDataFromString(String string)
newDataFromString in interface OldDataFactory<T>public String stringify(T type) throws APIException
stringify in interface OldDataFactory<T>APIExceptionpublic void stringify(T type, Writer writer) throws APIException
stringify in interface OldDataFactory<T>APIExceptionpublic void stringify(T type, OutputStream os) throws APIException
stringify in interface OldDataFactory<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 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 T objectify(Env env, Reader rdr) throws APIException
IOObjectifier
Implementations should use the Env to call "env.startXMLTime()" to mark
XML time, since this is often a costly process.
objectify in interface IOObjectifier<T>APIExceptionpublic T objectify(Reader rdr) throws APIException
objectify in interface OldDataFactory<T>APIExceptionpublic T objectify(Env env, InputStream is) throws APIException
IOObjectifier
Implementations should use the Env to call "env.startXMLTime()" to mark
XML time, since this is often a costly process.
objectify in interface IOObjectifier<T>APIExceptionpublic T objectify(InputStream is) throws APIException
objectify in interface OldDataFactory<T>APIExceptionpublic T objectify(Env env, String input) throws APIException
Objectifier
Implementations should use the Env to call "env.startXMLTime()" to mark
XML time, since this is often a costly process.
objectify in interface Objectifier<T>APIExceptionpublic T objectify(String text) throws APIException
objectify in interface OldDataFactory<T>APIExceptionpublic Class<T> getTypeClass()
getTypeClass in interface DataFactory<T>Copyright © 2017. All rights reserved.