|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.milyn.csv.CSVReader
FlatFileReader configured with the CSVRecordParserFactory.
public class CSVReader
CSV Reader.
This CSV Reader can be plugged into the Smooks (for example) in order to convert a CSV based message stream into a stream of SAX events to be consumed by the DOMBuilder.
<?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 Summary | |
|---|---|
CSVReader()
Deprecated. |
|
| Method Summary | |
|---|---|
void |
addVisitors(VisitorConfigMap visitorMap)
Deprecated. |
org.xml.sax.ContentHandler |
getContentHandler()
Deprecated. |
org.xml.sax.DTDHandler |
getDTDHandler()
Deprecated. |
org.xml.sax.EntityResolver |
getEntityResolver()
Deprecated. |
org.xml.sax.ErrorHandler |
getErrorHandler()
Deprecated. |
boolean |
getFeature(java.lang.String name)
Deprecated. |
java.lang.Object |
getProperty(java.lang.String name)
Deprecated. |
void |
initialize()
Deprecated. |
void |
parse(org.xml.sax.InputSource csvInputSource)
Deprecated. |
void |
parse(java.lang.String systemId)
Deprecated. The following methods are currently unimplemnted... |
void |
setContentHandler(org.xml.sax.ContentHandler contentHandler)
Deprecated. |
void |
setDTDHandler(org.xml.sax.DTDHandler arg0)
Deprecated. |
void |
setEntityResolver(org.xml.sax.EntityResolver arg0)
Deprecated. |
void |
setErrorHandler(org.xml.sax.ErrorHandler arg0)
Deprecated. |
void |
setExecutionContext(ExecutionContext request)
Deprecated. |
void |
setFeature(java.lang.String name,
boolean value)
Deprecated. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CSVReader()
| Method Detail |
|---|
@Initialize public void initialize()
public void addVisitors(VisitorConfigMap visitorMap)
addVisitors in interface VisitorAppenderpublic void setExecutionContext(ExecutionContext request)
setExecutionContext in interface SmooksXMLReader
public void parse(org.xml.sax.InputSource csvInputSource)
throws java.io.IOException,
org.xml.sax.SAXException
parse in interface org.xml.sax.XMLReaderjava.io.IOException
org.xml.sax.SAXExceptionpublic void setContentHandler(org.xml.sax.ContentHandler contentHandler)
setContentHandler in interface org.xml.sax.XMLReaderpublic org.xml.sax.ContentHandler getContentHandler()
getContentHandler in interface org.xml.sax.XMLReader
public void parse(java.lang.String systemId)
throws java.io.IOException,
org.xml.sax.SAXException
parse in interface org.xml.sax.XMLReaderjava.io.IOException
org.xml.sax.SAXException
public boolean getFeature(java.lang.String name)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
getFeature in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public void setFeature(java.lang.String name,
boolean value)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
setFeature in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedExceptionpublic org.xml.sax.DTDHandler getDTDHandler()
getDTDHandler in interface org.xml.sax.XMLReaderpublic void setDTDHandler(org.xml.sax.DTDHandler arg0)
setDTDHandler in interface org.xml.sax.XMLReaderpublic org.xml.sax.EntityResolver getEntityResolver()
getEntityResolver in interface org.xml.sax.XMLReaderpublic void setEntityResolver(org.xml.sax.EntityResolver arg0)
setEntityResolver in interface org.xml.sax.XMLReaderpublic org.xml.sax.ErrorHandler getErrorHandler()
getErrorHandler in interface org.xml.sax.XMLReaderpublic void setErrorHandler(org.xml.sax.ErrorHandler arg0)
setErrorHandler in interface org.xml.sax.XMLReader
public java.lang.Object getProperty(java.lang.String name)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
getProperty in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public void setProperty(java.lang.String name,
java.lang.Object value)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
setProperty in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||