|
||||||||||
| 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(org.milyn.delivery.VisitorConfigMap visitorMap)
Deprecated. |
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(org.milyn.container.ExecutionContext request)
Deprecated. |
void |
setFeature(String name,
boolean value)
Deprecated. |
void |
setProperty(String name,
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(org.milyn.delivery.VisitorConfigMap visitorMap)
addVisitors in interface org.milyn.delivery.VisitorAppenderpublic void setExecutionContext(org.milyn.container.ExecutionContext request)
setExecutionContext in interface org.milyn.xml.SmooksXMLReader
public void parse(InputSource csvInputSource)
throws IOException,
SAXException
parse in interface XMLReaderIOException
SAXExceptionpublic void setContentHandler(ContentHandler contentHandler)
setContentHandler in interface XMLReaderpublic ContentHandler getContentHandler()
getContentHandler in interface XMLReader
public void parse(String systemId)
throws IOException,
SAXException
parse in interface XMLReaderIOException
SAXException
public boolean getFeature(String name)
throws SAXNotRecognizedException,
SAXNotSupportedException
getFeature in interface XMLReaderSAXNotRecognizedException
SAXNotSupportedException
public void setFeature(String name,
boolean value)
throws SAXNotRecognizedException,
SAXNotSupportedException
setFeature in interface XMLReaderSAXNotRecognizedException
SAXNotSupportedExceptionpublic DTDHandler getDTDHandler()
getDTDHandler in interface XMLReaderpublic void setDTDHandler(DTDHandler arg0)
setDTDHandler in interface XMLReaderpublic EntityResolver getEntityResolver()
getEntityResolver in interface XMLReaderpublic void setEntityResolver(EntityResolver arg0)
setEntityResolver in interface XMLReaderpublic ErrorHandler getErrorHandler()
getErrorHandler in interface XMLReaderpublic void setErrorHandler(ErrorHandler arg0)
setErrorHandler in interface XMLReader
public Object getProperty(String name)
throws SAXNotRecognizedException,
SAXNotSupportedException
getProperty in interface XMLReaderSAXNotRecognizedException
SAXNotSupportedException
public void setProperty(String name,
Object value)
throws SAXNotRecognizedException,
SAXNotSupportedException
setProperty in interface XMLReaderSAXNotRecognizedException
SAXNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||