Top Description Inners Fields Constructors Methods
org.springframework.http.codec.xml

pack-priv abstract Class Jaxb2Helper

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashSet, .List, .Set, java.util.function.BiConsumer, javax.xml.XMLConstants, javax.xml.namespace.QName, javax.xml.stream.events.XMLEvent, jakarta.xml.bind.annotation.XmlRootElement, .XmlSchema, .XmlSeeAlso, .XmlType, reactor.core.publisher.Flux, .SynchronousSink, org.springframework.lang.Nullable, org.springframework.util.Assert, .ClassUtils

Helper class for JAXB2.
Author
Arjen Poutsma
Since
6.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final String
JAXB_DEFAULT_ANNOTATION_VALUE

The default value for JAXB annotations.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static void
findQNames(Class<?> clazz, Set<QName> qNames, Set<Class<?>> completedClasses)

private static String
localPart(String value, Class<?> outputClass)

private static String
namespace(String value, Class<?> outputClass)

public static Flux<List<XMLEvent>>
split(Flux<XMLEvent> xmlEventFlux, Set<QName> names)

Split a flux of XMLEvents into a flux of XMLEvent lists, one list for each branch of the tree that starts with one of the given qualified names.

public static Set<QName>
toQNames(Class<?> clazz)

Returns the set of qualified names for the given class, according to the mapping rules in the JAXB specification.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

JAXB_DEFAULT_ANNOTATION_VALUEback to summary
private static final String JAXB_DEFAULT_ANNOTATION_VALUE

The default value for JAXB annotations.

See Also
XmlRootElement#name(), XmlRootElement#namespace(), XmlType#name(), XmlType#namespace()

Constructor Detail

Jaxb2Helperback to summary
pack-priv Jaxb2Helper()

Method Detail

findQNamesback to summary
private static void findQNames(Class<?> clazz, Set<QName> qNames, Set<Class<?>> completedClasses)
localPartback to summary
private static String localPart(String value, Class<?> outputClass)
namespaceback to summary
private static String namespace(String value, Class<?> outputClass)
splitback to summary
public static Flux<List<XMLEvent>> split(Flux<XMLEvent> xmlEventFlux, Set<QName> names)

Split a flux of XMLEvents into a flux of XMLEvent lists, one list for each branch of the tree that starts with one of the given qualified names. That is, given the XMLEvents shown here, and the name "child", this method returns a flux of two lists, each of which containing the events of a particular branch of the tree that starts with "child".

  1. The first list, dealing with the first branch of the tree:
    1. javax.xml.stream.events.StartElement child
    2. javax.xml.stream.events.Characters foo
    3. javax.xml.stream.events.EndElement child
  2. The second list, dealing with the second branch of the tree:
    1. javax.xml.stream.events.StartElement child
    2. javax.xml.stream.events.Characters bar
    3. javax.xml.stream.events.EndElement child
toQNamesback to summary
public static Set<QName> toQNames(Class<?> clazz)

Returns the set of qualified names for the given class, according to the mapping rules in the JAXB specification.

org.springframework.http.codec.xml back to summary

private Class Jaxb2Helper.SplitHandler

extends Object
implements BiConsumer<XMLEvent, SynchronousSink<List<XMLEvent>>>
Class Inheritance
All Implemented Interfaces
java.util.function.BiConsumer

Field Summary

Modifier and TypeField and Description
private int
private int
private List<XMLEvent>
private final Set<QName>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
accept(XMLEvent
the first input argument
event
,
SynchronousSink<List<XMLEvent>>
the second input argument
sink
)

Implements java.util.function.BiConsumer.accept.

Performs this operation on the given arguments.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

barrierback to summary
private int barrier
elementDepthback to summary
private int elementDepth
eventsback to summary
private List<XMLEvent> events
Annotations
@Nullable
namesback to summary
private final Set<QName> names

Constructor Detail

SplitHandlerback to summary
public SplitHandler(Set<QName> names)

Method Detail

acceptback to summary
public void accept(XMLEvent event, SynchronousSink<List<XMLEvent>> sink)

Implements java.util.function.BiConsumer.accept.

Doc from java.util.function.BiConsumer.accept.

Performs this operation on the given arguments.

Parameters
event:XMLEvent

the first input argument

sink:SynchronousSink<List<XMLEvent>>

the second input argument

Annotations
@Override