public interface XMLMapper
| Modifier and Type | Interface and Description |
|---|---|
static class |
XMLMapper.Factory
A factory for creating an instance of
XMLMapper. |
| Modifier and Type | Method and Description |
|---|---|
void |
deparseDocument(XMLContentWriter contentWriter,
XMLStreamWriter streamWriter)
Deprecated.
|
void |
deparseDocument(XMLElementWriter<?> writer,
Object rootObject,
XMLStreamWriter streamWriter)
Format the element writer's output on to an XML stream writer.
|
void |
parseDocument(Object rootObject,
XMLStreamReader reader)
Parse a document.
|
void |
registerRootAttribute(QName name,
XMLAttributeReader<?> reader)
Add a known root attribute which can be read by
XMLExtendedStreamReader.handleAttribute(Object, int). |
<T> void |
registerRootElement(QName name,
Supplier<XMLElementReader<T>> supplier)
Add a known root element which can be read by
XMLExtendedStreamReader.handleAny(Object). |
<T> void |
registerRootElement(QName name,
XMLElementReader<T> reader)
Add a known root element which can be read by
XMLExtendedStreamReader.handleAny(Object). |
default <T,N extends Namespace> |
registerRootElement(String localName,
Set<N> namespaces,
Function<N,XMLElementReader<T>> readerFactory)
Convenience method that registers a root element associated with a known set of namespaces, whose reader can be created from the specified factory.
|
void |
unregisterRootAttribute(QName name)
Removes a
previously registered root attribute. |
void |
unregisterRootElement(QName name)
Removes a
previously registered root element. |
<T> void registerRootElement(QName name, XMLElementReader<T> reader)
XMLExtendedStreamReader.handleAny(Object).name - the element namereader - the reader which handles the element<T> void registerRootElement(QName name, Supplier<XMLElementReader<T>> supplier)
XMLExtendedStreamReader.handleAny(Object).name - the element namesupplier - provider for the reader which handles the element
It is recommended that supplier always creates new instance of the XMLElementReader
instead of caching and returning always same instance. This way unused parsers can get GC-ed
when not needed.default <T,N extends Namespace> void registerRootElement(String localName, Set<N> namespaces, Function<N,XMLElementReader<T>> readerFactory)
T - the operating type of the readerN - the namespace typelocalName - the local name of the known root elementnamespaces - a set of known namespaces for the specified the root elementfactory - a factory for creating an element reader for the specified the root elementvoid unregisterRootElement(QName name)
previously registered root element.name - the element namevoid registerRootAttribute(QName name, XMLAttributeReader<?> reader)
XMLExtendedStreamReader.handleAttribute(Object, int).name - the attribute namereader - the reader which handles the attributevoid unregisterRootAttribute(QName name)
previously registered root attribute.name - the element namevoid parseDocument(Object rootObject, XMLStreamReader reader) throws XMLStreamException
rootObject - the root object to send inreader - the reader from which the document should be readXMLStreamException - if an error occursvoid deparseDocument(XMLElementWriter<?> writer, Object rootObject, XMLStreamWriter streamWriter) throws XMLStreamException
writer - the element writerrootObject - the root object to send instreamWriter - the stream writerXMLStreamException - if an exception occurs@Deprecated void deparseDocument(XMLContentWriter contentWriter, XMLStreamWriter streamWriter) throws XMLStreamException
contentWriter - the content writerstreamWriter - the stream writerXMLStreamException - if an exception occursCopyright © 2024 JBoss by Red Hat. All rights reserved.