Package org.beanio.stream.xml
Class XmlRecordParserFactory
- java.lang.Object
-
- org.beanio.stream.xml.XmlParserConfiguration
-
- org.beanio.stream.xml.XmlRecordParserFactory
-
- All Implemented Interfaces:
java.lang.Cloneable
,RecordParserFactory
,XmlStreamConfigurationAware
public class XmlRecordParserFactory extends XmlParserConfiguration implements RecordParserFactory, XmlStreamConfigurationAware
DefaultRecordParserFactory
for the XML stream format.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description XmlRecordParserFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RecordMarshaller
createMarshaller()
Creates a parser for marshalling records.RecordReader
createReader(java.io.Reader in)
Creates a parser for reading records from an input stream.RecordUnmarshaller
createUnmarshaller()
Creates a parser for unmarshalling records.RecordWriter
createWriter(java.io.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 aRecordReader
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
-
-
-
-
Method Detail
-
init
public void init() throws java.lang.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 interfaceRecordParserFactory
- Throws:
java.lang.IllegalArgumentException
- if the parser configuration is invalid
-
createReader
public RecordReader createReader(java.io.Reader in) throws java.lang.IllegalArgumentException
Description copied from interface:RecordParserFactory
Creates a parser for reading records from an input stream.- Specified by:
createReader
in interfaceRecordParserFactory
- Parameters:
in
- the input stream to read from- Returns:
- the created
RecordReader
- Throws:
java.lang.IllegalArgumentException
- if this factory is improperly configured and aRecordReader
cannot be created
-
createWriter
public RecordWriter createWriter(java.io.Writer out) throws java.lang.IllegalArgumentException
Description copied from interface:RecordParserFactory
Creates a parser for writing records to an output stream.- Specified by:
createWriter
in interfaceRecordParserFactory
- Parameters:
out
- the output stream to write to- Returns:
- the new
RecordWriter
- Throws:
java.lang.IllegalArgumentException
- if this factory is improperly configured and aRecordWriter
cannot be created
-
createMarshaller
public RecordMarshaller createMarshaller() throws java.lang.IllegalArgumentException
Description copied from interface:RecordParserFactory
Creates a parser for marshalling records.- Specified by:
createMarshaller
in interfaceRecordParserFactory
- Returns:
- the created
RecordMarshaller
- Throws:
java.lang.IllegalArgumentException
- if this factory is improperly configured and aRecordMarshaller
cannot be created
-
createUnmarshaller
public RecordUnmarshaller createUnmarshaller() throws java.lang.IllegalArgumentException
Description copied from interface:RecordParserFactory
Creates a parser for unmarshalling records.- Specified by:
createUnmarshaller
in interfaceRecordParserFactory
- Returns:
- the created
RecordUnmarshaller
- Throws:
java.lang.IllegalArgumentException
- if this factory is improperly configured and aRecordUnmarshaller
cannot be created
-
setConfiguration
public void setConfiguration(XmlStreamConfiguration source)
Description copied from interface:XmlStreamConfigurationAware
This method is invoked by a XML stream definition when aRecordReader
implementation is registered.- Specified by:
setConfiguration
in interfaceXmlStreamConfigurationAware
- Parameters:
source
- the XML stream configuration
-
-