public interface JaxbContextBuilder
| Modifier and Type | Field and Description |
|---|---|
static BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> |
CAN_MARSHAL_ALL
The can marshal all function.
|
static BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> |
CAN_MARSHAL_ONLY_PREDEFINED_DATA
The can marshal only predefined data function.
|
static BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> |
CAN_UNMARSHAL_ALL
The can unmarshal all function.
|
static BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> |
CAN_UNMARSHAL_ONLY_PREDEFINED_DATA
The can unmarshal only predefined data function.
|
static JaxbDependenciesResolver |
DEFAULT_DEPENDENCIES_RESOLVER
The default dependencies resolver implementation.
|
| Modifier and Type | Method and Description |
|---|---|
JaxbContextBuilder |
add(JaxbContextData data)
Add jaxb context meta data to the jaxb context builder.
|
default JaxbContextBuilder |
add(String contextPath)
Add the given context path (package names which are separated by colon) to the jaxb context
builder.
|
default JaxbContextBuilder |
addAll(Iterable<? extends JaxbContextData> data)
Add all jaxb context meta data to the jaxb context builder.
|
default JaxbContextBuilder |
addAll(Iterator<? extends JaxbContextData> data)
Add all jaxb context meta data to the jaxb context builder.
|
static JaxbContextBuilder |
builder()
Creates a new jaxb context builder.
|
default JaxbContextWrapper |
buildJaxbContext()
Build default jaxb context that is defined by the added meta data.
|
JaxbContextWrapper |
buildJaxbContext(Object value)
Build jaxb context for the given object (POJO) or for the given class or array of classes with
the specified dependencies resolver.
|
default Marshaller |
buildMarshaller()
Build marshaller with the context which is defined by the added meta data.
|
Marshaller |
buildMarshaller(Object value)
Build marshaller for the given object (POJO) or for the given class or array of classes with
the specified dependencies resolver.
|
default Schema |
buildSchema()
Build schema of the default jaxb context (defined by the added meta data).
|
Schema |
buildSchema(Object value)
Build schema of the specified value (POJO), a single class or an array of classes.
|
default Unmarshaller |
buildUnmarshaller()
Build unmarshaller with the context which is defined by the added meta data.
|
Unmarshaller |
buildUnmarshaller(Object value)
Build unmarshaller for the given object (POJO) or for the given class or array of classes with
the specified dependencies resolver.
|
boolean |
canMarshal(Class<?> clazz)
Determines whether the marshaller can encode an object of the given class into xml.
|
boolean |
canUnmarshal(Class<?> clazz)
Determines whether the unmarshaller can decode xml into an object of the given class.
|
JaxbContextBuilder |
copy()
Copy jaxb context builder.
|
JaxbContextBuilder |
initJaxbContext()
Inits default jaxb context.
|
default JaxbContextBuilder |
process(JaxbContextDataProvider dataProvider)
Process the jaxb context meta data provider and add it's data to the jaxb context builder.
|
default JaxbContextBuilder |
processAll(Iterable<? extends JaxbContextDataProvider> dataProviders)
Process the jaxb context meta data providers and add their data to the jaxb context builder.
|
default JaxbContextBuilder |
processAll(Iterator<? extends JaxbContextDataProvider> dataProviders)
Process the jaxb context meta data providers and add their data to the jaxb context builder.
|
JaxbContextBuilder |
withAttachmentMarshaller(AttachmentMarshaller attachmentMarshaller)
Set attachment marshaller.
|
JaxbContextBuilder |
withAttachmentUnmarshaller(AttachmentUnmarshaller attachmentUnmarshaller)
Set attachment unmarshaller.
|
JaxbContextBuilder |
withCanMarshal(BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> function)
Sets a function of the builder to determine whether the builder is responsible for the given
class.
|
JaxbContextBuilder |
withCanUnmarshal(BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> function)
Sets a function of the builder to determine whether the builder is responsible for the given
class.
|
JaxbContextBuilder |
withContextClassLoader(ClassLoader classLoader)
Specifies the class loader to use.
|
JaxbContextBuilder |
withDependenciesResolver(JaxbDependenciesResolver resolver)
Specifies the dependencies resolver to use.
|
JaxbContextBuilder |
withFormattedOutput(boolean formattedOutput)
Specify whether the xml output should be formatted or not.
|
JaxbContextBuilder |
withSchemaBuilder(SchemaBuilder schemaBuilder)
Specifies the schema builder to generate the schema.
|
JaxbContextBuilder |
withSchemaMode(SchemaMode schemaMode)
Specifies whether to add a schema to the marshaller or unmarshaller.
|
JaxbContextBuilder |
withValidationEventHandler(ValidationEventHandler validationEventHandler)
Set validation event handler of marshaller and unmarshaller.
|
JaxbContextBuilder |
withXmlAdapters(Collection<? extends XmlAdapter<?,?>> xmlAdapters)
Sets xml adapters of marshaller and unmarshaller.
|
static final JaxbDependenciesResolver DEFAULT_DEPENDENCIES_RESOLVER
static final BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> CAN_MARSHAL_ALL
XmlRootElement. This is the default behaviour.withCanMarshal(BiFunction)static final BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> CAN_UNMARSHAL_ALL
XmlRootElement. This is the default behaviour.withCanUnmarshal(BiFunction)static final BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> CAN_MARSHAL_ONLY_PREDEFINED_DATA
withCanMarshal(BiFunction)static final BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> CAN_UNMARSHAL_ONLY_PREDEFINED_DATA
withCanUnmarshal(BiFunction)static JaxbContextBuilder builder()
JaxbContextBuilder copy()
JaxbContextBuilder withCanMarshal(BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> function)
function - the functioncanMarshal(Class)JaxbContextBuilder withCanUnmarshal(BiFunction<Class<?>,Map<String,JaxbContextData>,Boolean> function)
function - the functioncanUnmarshal(Class)JaxbContextBuilder withSchemaMode(SchemaMode schemaMode)
schemaMode - the schema modeSchemaMode.NEVER,
SchemaMode.ALWAYS,
SchemaMode.MARSHAL,
SchemaMode.UNMARSHAL,
SchemaMode.EXTERNAL_XSDJaxbContextBuilder withSchemaBuilder(SchemaBuilder schemaBuilder)
SchemaBuilder.builder()).schemaBuilder - the schema builderJaxbContextBuilder withDependenciesResolver(JaxbDependenciesResolver resolver)
To turn off dependency resolving set null here.
resolver - the resolverJaxbContextBuilder withContextClassLoader(ClassLoader classLoader)
classLoader - the class loaderJaxbContextBuilder withFormattedOutput(boolean formattedOutput)
formattedOutput - the formatted outputJaxbContextBuilder withXmlAdapters(Collection<? extends XmlAdapter<?,?>> xmlAdapters)
xmlAdapters - the xml adaptersJaxbContextBuilder withAttachmentMarshaller(AttachmentMarshaller attachmentMarshaller)
attachmentMarshaller - the attachment marshallerJaxbContextBuilder withAttachmentUnmarshaller(AttachmentUnmarshaller attachmentUnmarshaller)
attachmentUnmarshaller - the attachment unmarshallerJaxbContextBuilder withValidationEventHandler(ValidationEventHandler validationEventHandler)
validationEventHandler - the validation event handlerdefault JaxbContextBuilder add(String contextPath)
JAXBContext.newInstance(String).contextPath - the context path (package names which are separated by colon)JaxbContextBuilder add(JaxbContextData data)
data - the datadefault JaxbContextBuilder addAll(Iterable<? extends JaxbContextData> data)
data - the datadefault JaxbContextBuilder addAll(Iterator<? extends JaxbContextData> data)
data - the datadefault JaxbContextBuilder process(JaxbContextDataProvider dataProvider)
dataProvider - the data providerdefault JaxbContextBuilder processAll(Iterable<? extends JaxbContextDataProvider> dataProviders)
dataProviders - the data providersdefault JaxbContextBuilder processAll(Iterator<? extends JaxbContextDataProvider> dataProviders)
dataProviders - the data providersboolean canUnmarshal(Class<?> clazz)
withCanUnmarshal(BiFunction) will be used.clazz - the classtrue if the unmarshaller can decode xml into an object of the given class,
otherwise falseboolean canMarshal(Class<?> clazz)
withCanMarshal(BiFunction) will be used.clazz - the classtrue if the marshaller can decode an object of the given class into xml,
otherwise falsedefault Unmarshaller buildUnmarshaller()
Unmarshaller buildUnmarshaller(Object value)
JAXBContext.newInstance(Class[]).value - the value (POJO) that should be processed by the unmarshaller or a single
class or an array of classesJaxbDependenciesResolverdefault Marshaller buildMarshaller()
Marshaller buildMarshaller(Object value)
JAXBContext.newInstance(Class[]).value - the value (POJO) that should be processed by the marshaller or a single class
or an array of classesJaxbDependenciesResolverJaxbContextBuilder initJaxbContext()
default JaxbContextWrapper buildJaxbContext()
JaxbContextWrapper buildJaxbContext(Object value)
JAXBContext.newInstance(Class[]).value - the value (POJO) that should be processed by the jaxb context or a single
class or an array of classesdefault Schema buildSchema()
Copyright © 2020 bremersee.org. All rights reserved.