public class FieldReaderDataSource extends DataSource<Reader>
XPathEntityProcessor
The datasouce may be configured as follows
<datasource name="f1" type="FieldReaderDataSource" />
The entity which uses this datasource must keep the url value as the variable name url="field-name"
The fieldname must be resolvable from VariableResolver
This may be used with any EntityProcessor
which uses a DataSource
<Reader
> eg: XPathEntityProcessor
Supports String, BLOB, CLOB data types and there is an extra field (in the entity) 'encoding' for BLOB types
Modifier and Type | Field and Description |
---|---|
protected String |
dataField |
protected VariableResolver |
vr |
Constructor and Description |
---|
FieldReaderDataSource() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Cleans up resources of this DataSource after use.
|
Reader |
getData(String query)
Get records for the given query.The return type depends on the
implementation .
|
void |
init(Context context,
Properties initProps)
Initializes the DataSource with the
Context and
initialization properties. |
protected VariableResolver vr
protected String dataField
public void init(Context context, Properties initProps)
DataSource
Context
and
initialization properties.
This is invoked by the DataImporter
after creating an
instance of this class.
init
in class DataSource<Reader>
public Reader getData(String query)
DataSource
getData
in class DataSource<Reader>
query
- The query string. It can be a SQL for JdbcDataSource or a URL
for HttpDataSource or a file location for FileDataSource or a custom
format for your own custom DataSource.public void close()
DataSource
close
in class DataSource<Reader>
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.