Top Description Fields Constructors Methods
org.jooq.util.jaxb.tools

public final Class MiniJAXB

extends Object
Class Inheritance
Annotations
@Internal
Static Imports
java.util.Arrays.asList

This class allows for mashalling / unmarshalling XML content to jOOQ configuration objects.

With jOOQ 3.12, the JAXB dependency has been removed in favour of this home grown solution. Due to the modularisation that happened with JDK 9+ and the removal of JAXB from the JDK 11+, it is unreasonable to leave the burden of properly configuring transitive JAXB dependency to jOOQ users.

Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private static final JooqLogger
private static final Map<String, String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
public static <T> T

Returns:

The modified first argument.
append
(T first, T second)

Appends a second JAXB annotated object to a first one using Maven's combine.children="append" semantics.

private static DocumentBuilder
builder(Class<?> type)

private static long
copyLarge(Reader reader, Writer writer)

private static Map<String, Field>
fieldsByElementName(Map<Class<?>, Map<String, Field>> fieldsByClass, Class<?> type)

private static String
private static Schema
getSchema(Class<?> type, String namespace)

public static String
public static void
public static void
public static <T extends XMLAppendable> T
unmarshal(Reader reader, Class<T> type)

public static <T extends XMLAppendable> T
public static <T extends XMLAppendable> T
unmarshal(String xml, Class<T> type)

public static <T extends XMLAppendable> T
unmarshal(File xml, Class<T> type)

private static <T extends XMLAppendable> T
private static void
unmarshal0(Object result, Element element, Map<Class<?>, Map<String, Field>> fieldsByClass)

private static void
unmarshalList0(List<Object> result, Element element, String name, Class<?> type, Map<Class<?>, Map<String, Field>> fieldsByClass)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

logback to summary
private static final JooqLogger log
PROVIDED_SCHEMASback to summary
private static final Map<String, String> PROVIDED_SCHEMAS

Constructor Detail

MiniJAXBback to summary
public MiniJAXB()

Method Detail

addDefaultNamespaceback to summary
private static void addDefaultNamespace(InputSource in, Class<?> type) throws IOException
appendback to summary
public static <T> T append(T first, T second)

Appends a second JAXB annotated object to a first one using Maven's combine.children="append" semantics.

Returns:T

The modified first argument.

Annotations
@SuppressWarnings:rawtypes, unchecked
builderback to summary
private static DocumentBuilder builder(Class<?> type)
copyLargeback to summary
private static long copyLarge(Reader reader, Writer writer) throws IOException
fieldsByElementNameback to summary
private static Map<String, Field> fieldsByElementName(Map<Class<?>, Map<String, Field>> fieldsByClass, Class<?> type)
getNamespaceback to summary
private static String getNamespace(Class<?> type)
getSchemaback to summary
private static Schema getSchema(Class<?> type, String namespace)
marshalback to summary
public static String marshal(XMLAppendable object)
marshalback to summary
public static void marshal(XMLAppendable object, OutputStream out)
marshalback to summary
public static void marshal(XMLAppendable object, Writer out)
unmarshalback to summary
public static <T extends XMLAppendable> T unmarshal(Reader reader, Class<T> type)
unmarshalback to summary
public static <T extends XMLAppendable> T unmarshal(InputStream in, Class<T> type)
unmarshalback to summary
public static <T extends XMLAppendable> T unmarshal(String xml, Class<T> type)
unmarshalback to summary
public static <T extends XMLAppendable> T unmarshal(File xml, Class<T> type)
unmarshal0back to summary
private static <T extends XMLAppendable> T unmarshal0(InputSource in, Class<T> type)
unmarshal0back to summary
private static void unmarshal0(Object result, Element element, Map<Class<?>, Map<String, Field>> fieldsByClass) throws Exception
unmarshalList0back to summary
private static void unmarshalList0(List<Object> result, Element element, String name, Class<?> type, Map<Class<?>, Map<String, Field>> fieldsByClass) throws Exception