Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Oracle Application Development Framework Model and Business Components Java API Reference VERSION B16005-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.adf.model.adapter.dataformat
Class CSVHandler

`java.lang.Object
oracle.adf.model.adapter.dataformat.CSVHandler`

All Implemented Interfaces:
  FormatDataHandler, FormatStructureHandler

public class CSVHandler
extends java.lang.Object
implements FormatDataHandler, FormatStructureHandler

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.

Since:
  10.1.3
Version:
  1.0

Field Summary
`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` | `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

### FILTERING_COLTYPE_MAP

    public static final java.lang.String FILTERING_COLTYPE_MAP

### FILTERING_COLFORMAT_MAP

    public static final java.lang.String FILTERING_COLFORMAT_MAP

Constructor Detail

### CSVHandler

    public 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.
Parameters:
  `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

### setParameters

    public void setParameters(ParameterDefinition[] params)

  Sets the parameter names for the definition. The parameter names will be used to define the structure of the data.

### setFilterConditions

    public void setFilterConditions(boolean isAll,
                                    java.lang.String[] conditions)

  Sets the filtering conditions for the csv data.

### setColTypeMap

    public void setColTypeMap(java.util.Map colTypeMap)

  Sets the map for column name -type.

### setColFormatMap

    public void setColFormatMap(java.util.Map colFormatMap)

  Sets the map for column name - format.

### getStructure

    public StructureDefinition getStructure(java.lang.String name,
                                            DefinitionContext ctx)

  Returns the structure definition extracted for the data format.
  Specified by:
    `getStructure` in interface `FormatStructureHandler`
  Parameters:
    `name` - name of the root structure.
    `ctx` - definition context information.
  Returns:
    the structure information extracted.

### getResult

    public java.lang.Object getResult(java.util.Map params,
                                      java.lang.String returnType)

  Returns the resulting data extracted from the input.
  Specified by:
    `getResult` in interface `FormatDataHandler`
  Parameters:
    `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.
  Returns:
    Object of the type defined by the `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.

### getResult

    public java.util.Iterator getResult(java.util.Map params)

  Returns the resulting data extracted from the input.
  Parameters:
    `params` - parameters passed containig the context information.
  Returns:
    `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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Oracle Application Development Framework Model and Business Components Java API Reference VERSION B16005-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1997, 2005, Oracle. All rights reserved.