StAX Mapper 1.0.0.Final-redhat-1

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).
 

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

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

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.0.0.Final-redhat-1

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.