StAX Mapper 1.1.0.Final-redhat-2

org.jboss.staxmapper
Interface XMLMapper


public interface XMLMapper

An XML mapper. Allows the creation of extensible streaming XML parsers.

Author:
David M. Lloyd

Nested Class Summary
static class XMLMapper.Factory
          A factory for creating an instance of XMLMapper.
 
Method Summary
 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).
 void registerRootElement(QName name, XMLElementReader<?> reader)
          Add a known root element which can be read by XMLExtendedStreamReader.handleAny(Object).
 void unregisterRootAttribute(QName name)
          Removes a previously registered root attribute.
 void unregisterRootElement(QName name)
          Removes a previously registered root element.
 

Method Detail

registerRootElement

void registerRootElement(QName name,
                         XMLElementReader<?> reader)
Add a known root element which can be read by XMLExtendedStreamReader.handleAny(Object).

Parameters:
name - the element name
reader - the reader which handles the element

unregisterRootElement

void unregisterRootElement(QName name)
Removes a previously registered root element.

Parameters:
name - the element name

registerRootAttribute

void registerRootAttribute(QName name,
                           XMLAttributeReader<?> reader)
Add a known root attribute which can be read by XMLExtendedStreamReader.handleAttribute(Object, int).

Parameters:
name - the attribute name
reader - the reader which handles the attribute

unregisterRootAttribute

void unregisterRootAttribute(QName name)
Removes a previously registered root attribute.

Parameters:
name - the element name

parseDocument

void parseDocument(Object rootObject,
                   XMLStreamReader reader)
                   throws XMLStreamException
Parse a document. The document must have a known, registered root element which can accept the given root object.

Parameters:
rootObject - the root object to send in
reader - the reader from which the document should be read
Throws:
XMLStreamException - if an error occurs

deparseDocument

void deparseDocument(XMLElementWriter<?> writer,
                     Object rootObject,
                     XMLStreamWriter streamWriter)
                     throws XMLStreamException
Format the element writer's output on to an XML stream writer.

Parameters:
writer - the element writer
rootObject - the root object to send in
streamWriter - the stream writer
Throws:
XMLStreamException - if an exception occurs

deparseDocument

@Deprecated
void deparseDocument(XMLContentWriter contentWriter,
                                XMLStreamWriter streamWriter)
                     throws XMLStreamException
Deprecated. 

Format the content writer's output on to an XML stream writer.

Parameters:
contentWriter - the content writer
streamWriter - the stream writer
Throws:
XMLStreamException - if an exception occurs

StAX Mapper 1.1.0.Final-redhat-2

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.