FlatFileReader
configured with the CSVRecordParserFactory
.public class CSVReader extends Object implements SmooksXMLReader, VisitorAppender
<?xml version="1.0"?> <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd"> <csv:reader fields="" separator="" quote="" skipLines="" rootElementName="" recordElementName=""> <csv:singleBinding beanId="" class="" /> </csv:reader> </smooks-resource-list>To maintain a
List
of binding instances in memory:
<?xml version="1.0"?> <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd"> <csv:reader fields="" separator="" quote="" skipLines="" rootElementName="" recordElementName=""> <csv:listBinding beanId="" class="" /> </csv:reader> </smooks-resource-list>To maintain a
Map
of binding instances in memory:
<?xml version="1.0"?> <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd"> <csv:reader fields="" separator="" quote="" skipLines="" rootElementName="" recordElementName=""> <csv:mapBinding beanId="" class="" keyField="" /> </csv:reader> </smooks-resource-list>
<csv:reader fields="name,address,$ignore$,item,quantity" />Within Smooks, the stream of SAX events generated by the "Acme-Order-List" message (and this parser) will generate an event stream equivalent to the following:
<csv-set> <csv-record number="1"> <name>Tom Fennelly</name> <address>Ireland</address> <item>V1234</item> <quantity>3</quantity> <csv-record> <csv-record number="2"> <name>Joe Bloggs</name> <address>England</address> <item>D9123</item> <quantity>7</quantity> <csv-record> </csv-set>Other profile based transformations can then be used to transform the CSV records in accordance with the requirements of the consuming entities.
Constructor and Description |
---|
CSVReader()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addVisitors(VisitorConfigMap visitorMap)
Deprecated.
Add visitors to the supplied Cisitor map.
|
ContentHandler |
getContentHandler()
Deprecated.
|
DTDHandler |
getDTDHandler()
Deprecated.
|
EntityResolver |
getEntityResolver()
Deprecated.
|
ErrorHandler |
getErrorHandler()
Deprecated.
|
boolean |
getFeature(String name)
Deprecated.
|
Object |
getProperty(String name)
Deprecated.
|
void |
initialize()
Deprecated.
|
void |
parse(InputSource csvInputSource)
Deprecated.
|
void |
parse(String systemId)
Deprecated.
The following methods are currently unimplemnted...
|
void |
setContentHandler(ContentHandler contentHandler)
Deprecated.
|
void |
setDTDHandler(DTDHandler arg0)
Deprecated.
|
void |
setEntityResolver(EntityResolver arg0)
Deprecated.
|
void |
setErrorHandler(ErrorHandler arg0)
Deprecated.
|
void |
setExecutionContext(ExecutionContext request)
Deprecated.
Set the Smooks
ExecutionContext on the implementing class. |
void |
setFeature(String name,
boolean value)
Deprecated.
|
void |
setProperty(String name,
Object value)
Deprecated.
|
@Initialize public void initialize()
public void addVisitors(VisitorConfigMap visitorMap)
VisitorAppender
addVisitors
in interface VisitorAppender
visitorMap
- The visitor map to be added to.public void setExecutionContext(ExecutionContext request)
SmooksXMLReader
ExecutionContext
on the implementing class.setExecutionContext
in interface SmooksXMLReader
request
- The Smooks ExecutionContext
.public void parse(InputSource csvInputSource) throws IOException, SAXException
parse
in interface XMLReader
IOException
SAXException
public void setContentHandler(ContentHandler contentHandler)
setContentHandler
in interface XMLReader
public ContentHandler getContentHandler()
getContentHandler
in interface XMLReader
public void parse(String systemId) throws IOException, SAXException
parse
in interface XMLReader
IOException
SAXException
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException
getFeature
in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
setFeature
in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException
public DTDHandler getDTDHandler()
getDTDHandler
in interface XMLReader
public void setDTDHandler(DTDHandler arg0)
setDTDHandler
in interface XMLReader
public EntityResolver getEntityResolver()
getEntityResolver
in interface XMLReader
public void setEntityResolver(EntityResolver arg0)
setEntityResolver
in interface XMLReader
public ErrorHandler getErrorHandler()
getErrorHandler
in interface XMLReader
public void setErrorHandler(ErrorHandler arg0)
setErrorHandler
in interface XMLReader
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException
getProperty
in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
setProperty
in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException
Copyright © 2020. All rights reserved.