BeanIO 2.0.4

org.beanio.stream.xml
Class XmlRecordParserFactory

java.lang.Object
  extended by org.beanio.stream.xml.XmlParserConfiguration
      extended by org.beanio.stream.xml.XmlRecordParserFactory
All Implemented Interfaces:
Cloneable, RecordParserFactory, XmlStreamConfigurationAware

public class XmlRecordParserFactory
extends XmlParserConfiguration
implements RecordParserFactory, XmlStreamConfigurationAware

Default RecordParserFactory for the XML stream format.

Since:
2.0
Author:
Kevin Seim

Constructor Summary
XmlRecordParserFactory()
          Constructs a new XmlRecordParserFactory.
 
Method Summary
 RecordMarshaller createMarshaller()
          Creates a parser for marshalling records.
 RecordReader createReader(Reader in)
          Creates a parser for reading records from an input stream.
 RecordUnmarshaller createUnmarshaller()
          Creates a parser for unmarshalling records.
 RecordWriter createWriter(Writer out)
          Creates a parser for writing records to an output stream.
 void init()
          Initializes the factory.
 void setConfiguration(XmlStreamConfiguration source)
          This method is invoked by a XML stream definition when a RecordReader implementation is registered.
 
Methods inherited from class org.beanio.stream.xml.XmlParserConfiguration
addNamespace, clone, getEncoding, getIndentation, getLineSeparator, getNamespaceMap, getVersion, isIndentationEnabled, isSuppressHeader, setEncoding, setIndentation, setLineSeparator, setNamespaces, setSuppressHeader, setVersion
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlRecordParserFactory

public XmlRecordParserFactory()
Constructs a new XmlRecordParserFactory.

Method Detail

init

public void init()
          throws IllegalArgumentException
Description copied from interface: RecordParserFactory
Initializes the factory. This method is called when a mapping file is loaded after all parser properties have been set, and is therefore ideally used to preemptively validate parser configuration settings.

Specified by:
init in interface RecordParserFactory
Throws:
IllegalArgumentException - if the parser configuration is invalid

createReader

public RecordReader createReader(Reader in)
                          throws IllegalArgumentException
Description copied from interface: RecordParserFactory
Creates a parser for reading records from an input stream.

Specified by:
createReader in interface RecordParserFactory
Parameters:
in - the input stream to read from
Returns:
the created RecordReader
Throws:
IllegalArgumentException - if this factory is improperly configured and a RecordReader cannot be created

createWriter

public RecordWriter createWriter(Writer out)
                          throws IllegalArgumentException
Description copied from interface: RecordParserFactory
Creates a parser for writing records to an output stream.

Specified by:
createWriter in interface RecordParserFactory
Parameters:
out - the output stream to write to
Returns:
the new RecordWriter
Throws:
IllegalArgumentException - if this factory is improperly configured and a RecordWriter cannot be created

createMarshaller

public RecordMarshaller createMarshaller()
                                  throws IllegalArgumentException
Description copied from interface: RecordParserFactory
Creates a parser for marshalling records.

Specified by:
createMarshaller in interface RecordParserFactory
Returns:
the created RecordMarshaller
Throws:
IllegalArgumentException - if this factory is improperly configured and a RecordMarshaller cannot be created

createUnmarshaller

public RecordUnmarshaller createUnmarshaller()
                                      throws IllegalArgumentException
Description copied from interface: RecordParserFactory
Creates a parser for unmarshalling records.

Specified by:
createUnmarshaller in interface RecordParserFactory
Returns:
the created RecordUnmarshaller
Throws:
IllegalArgumentException - if this factory is improperly configured and a RecordUnmarshaller cannot be created

setConfiguration

public void setConfiguration(XmlStreamConfiguration source)
Description copied from interface: XmlStreamConfigurationAware
This method is invoked by a XML stream definition when a RecordReader implementation is registered.

Specified by:
setConfiguration in interface XmlStreamConfigurationAware
Parameters:
source - the XML stream configuration

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim