|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1) E10653-04 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.adf.model.adapter.dataformat.CSVHandler
public class CSVHandler
Format handler for character separated values.
This class generates structures according to the JSR 227 specification from a CSV data stream by parsing the data. The data types are guessed from the value of the first data line. It can extract values from a CSV data stream as well.
Data controls that deals with CSV data can use this class to generate data and structure.
Nested Class Summary | |
---|---|
class |
CSVHandler.CSVDataEvent
Event that the CSV handler sends during processing csv data. |
Field Summary | |
---|---|
static java.lang.String |
EV_EOD
End of data event. |
static java.lang.String |
FILTERING_COLFORMAT_MAP
|
static java.lang.String |
FILTERING_COLTYPE_MAP
|
Constructor Summary | |
---|---|
CSVHandler(java.io.InputStream is,
boolean isFirstRowNames,
java.lang.String encodingStyle,
java.lang.String delim,
java.lang.String quoteChar)
Creats a CSV format handler object. |
Method Summary | |
---|---|
java.util.Iterator |
getResult(java.util.Map params)
Returns the resulting data extracted from the input. |
java.lang.Object |
getResult(java.util.Map params,
java.lang.String returnType)
Returns the resulting data extracted from the input. |
StructureDefinition |
getStructure(java.lang.String name,
DefinitionContext ctx)
Returns the structure definition extracted for the data format. |
void |
setColFormatMap(java.util.Map colFormatMap)
Sets the map for column name - format. |
void |
setColTypeMap(java.util.Map colTypeMap)
Sets the map for column name -type. |
void |
setDataEventListener(FormatDataEventListener listener)
Sets the data event listener. |
void |
setFilterConditions(boolean isAll,
java.lang.String[] conditions)
Sets the filtering conditions for the csv data. |
void |
setParameters(ParameterDefinition[] params)
Sets the parameter names for the definition. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILTERING_COLTYPE_MAP
public static final java.lang.String FILTERING_COLFORMAT_MAP
public static final java.lang.String EV_EOD
Constructor Detail |
---|
public CSVHandler(java.io.InputStream is, boolean isFirstRowNames, java.lang.String encodingStyle, java.lang.String delim, java.lang.String quoteChar)
is
- input stream that contains the CSV data.isFirstRowNames
- flag to indicate if the first row of the CSV data
can be treated as column names.encodingStyle
- encoding style of the data.delim
- character value separators.quoteChar
- value that can be treated as quote.Method Detail |
---|
public void setDataEventListener(FormatDataEventListener listener)
public void setParameters(ParameterDefinition[] params)
public void setFilterConditions(boolean isAll, java.lang.String[] conditions)
public void setColTypeMap(java.util.Map colTypeMap)
public void setColFormatMap(java.util.Map colFormatMap)
public StructureDefinition getStructure(java.lang.String name, DefinitionContext ctx)
getStructure
in interface FormatStructureHandler
name
- name of the root structure.ctx
- definition context information.
public java.lang.Object getResult(java.util.Map params, java.lang.String returnType)
getResult
in interface FormatDataHandler
params
- parameters passed containig the context information.returnType
- data type of the returned value. This can be passed as null.
If no return type is specified, an Iterator of Map will be returned.
returnType
parameter.
If the type is available, an instance of that object is created. If no
type is specified an Iterator
of Map
objects
for the result will be created.
If no data found it can return null. The Map
contains the value of attributes as defined in the data structure.
For complex data, Map
s can contain other
Map
s as well.public java.util.Iterator getResult(java.util.Map params)
params
- parameters passed containig the context information.
Iterator
of Map
objects for the result.
If no data found it can return null. The Map
contains the value of attributes as defined in the data structure.
For complex data, Map
s can contain other iterator of
Map
s as well.
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1) E10653-04 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |