JaxbUtils
Utilities to convert from and to JAXB-XML format.
API
class JaxbUtils {
DtoMapper<T> mapperFor(Class<T> mappedType, JaxbUtils.JaxbCustomizer... customizers)
Try<T> tryRead(Class<T> mappedType, String stringUtf8, JaxbUtils.JaxbCustomizer... customizers) (1)
Try<T> tryRead(Class<T> mappedType, DataSource source, JaxbUtils.JaxbCustomizer... customizers) (2)
void write(T pojo, DataSink sink, JaxbUtils.JaxbCustomizer... customizers) (3)
String toStringUtf8(T pojo, JaxbUtils.JaxbCustomizer... customizers) (4)
void generateSchema(JAXBContext jaxbContext, DataSink dataSink) (5)
JAXBContext jaxbContextFor(Class<?> primaryClass, Class<?>... additionalClassesToBeBound) (6)
JAXBContext jaxbContextFor(Class<?> dtoClass, boolean useCache)
}
1 | tryRead(Class, String, JaxbUtils_JaxbCustomizer)
Tries to deserialize JAXB-XML content from given UTF8 encoded String into an instance of given mappedType . |
2 | tryRead(Class, DataSource, JaxbUtils_JaxbCustomizer)
Tries to deserialize JAXB-XML content from given DataSource into an instance of given mappedType . |
3 | write(T, DataSink, JaxbUtils_JaxbCustomizer)
Writes given pojo to given DataSink . |
4 | toStringUtf8(T, JaxbUtils_JaxbCustomizer)
Converts given pojo to an UTF8 encoded String . |
5 | generateSchema(JAXBContext, DataSink)
Generates the schema documents for given JAXBContext and writes them to given DataSink . |
6 | jaxbContextFor(Class, Class)
not cached |
Members
tryRead(Class, String, JaxbUtils_JaxbCustomizer)
Tries to deserialize JAXB-XML content from given UTF8 encoded String into an instance of given mappedType .
tryRead(Class, DataSource, JaxbUtils_JaxbCustomizer)
Tries to deserialize JAXB-XML content from given DataSource into an instance of given mappedType .
write(T, DataSink, JaxbUtils_JaxbCustomizer)
Writes given pojo to given DataSink .
generateSchema(JAXBContext, DataSink)
Generates the schema documents for given JAXBContext and writes them to given DataSink .