|
ElegantJ Data Tables Java API Specification v1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.elegantj.data.dataprovider.AbstractDataProvider
com.elegantj.data.dataprovider.text.TextDataProvider
This class encapsulates functionality of a text data provider.
It provides data in a format in which the row separator, column separator,
text qualifier, column's fixed width are user-specified text.
Text data may contains the column names as first row.
And may be delimited by string or may be fixed width.
This bean provides powerful designing aspects by providing following user friendly property.
DataProvider the data provider
File the path of the source file
URL the URL of the source file
URLConnectionEnabled indicates whether the connection can be established through the URL or not
RowSeparator the row separator string
ColumnSeparator the column separator string
TextQualifier the text qualifier string
FirstRowAsColumnNames indicates whether the first row of the retrieved data is column names or not
ColumnsDelimited indicates whether the columns are delimited or fixed width
SkippedColumns the comma separated indexes of the columns to be skipped
ColumnsWidth the comma separated width of the columns
SortCriteria the criteria for sorting the data
FilterCriteria the criteria for filtering the data
FilterState indicates whether the filter criteria is applied or not
SaveOnlyFilteredData indicates to save only filtered rows or all rows
FetchSize the maximum number of rows which can be retrieved
AppendDataOnFetchNext indicates whether the next fetched data is appended or replaced to existing data
SkippedRows the total number of rows to be skipped
| Field Summary | |
static java.lang.String |
DEFAULT_COLUMN_SEPARATOR
Specifies the comma as a default column separator |
static java.lang.String |
DEFAULT_ROW_SEPARATOR
Specifies the newline character as a default row separator |
static java.lang.String |
DEFAULT_TEXT_QUALIFIER
Specifies the empty string as default text qualifier |
protected boolean |
forInput
Specifies the text file operation as input or output |
protected java.io.InputStream |
in
Specifies the input stream of the text file |
protected java.io.OutputStream |
out
Specifies the output stream of the text file |
| Fields inherited from class com.elegantj.data.dataprovider.AbstractDataProvider |
c1, changes, clientTable, columnNames, currentIndex, dataTable |
| Constructor Summary | |
TextDataProvider()
|
|
| Method Summary | |
boolean |
close()
Closes input / output stream of the text file |
java.lang.String |
getFile()
Gets the path of the text file. |
java.lang.String |
getSkippedColumns()
Gets the column indexes to be skipped |
java.lang.String |
getURL()
Gets the URL of the text file. |
boolean |
isFetchNext()
Determines whether fetching the next rows or not |
boolean |
isURLConnectionEnabled()
Gets the enability to connect through URL |
boolean |
nextData()
If more data can be fetched, it fetches and return true, otherwise return false |
boolean |
open(boolean input)
Opens input stream or output stream of the text file |
void |
readExternal(java.io.ObjectInput in)
|
void |
retrieve()
Retrives the data |
boolean |
retrieveData(java.io.InputStream is)
Retrieves the data from given input stream. |
void |
save()
Saves the transaction |
boolean |
saveData(java.io.OutputStream os)
Saves the data to given output stream. |
void |
setFile(java.lang.String path)
Sets the path of the text file. |
void |
setSkippedColumns(java.lang.String skipColumns)
Sets the column indexes to be skipped |
void |
setURL(java.lang.String url)
Sets the URL of the text file. |
void |
setURLConnectionEnabled(boolean b)
Sets the enability to connect through URL |
void |
writeExternal(java.io.ObjectOutput out)
Externalizable interface implementation to save and retrieve the state of this bean |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static java.lang.String DEFAULT_ROW_SEPARATOR
public static java.lang.String DEFAULT_COLUMN_SEPARATOR
public static java.lang.String DEFAULT_TEXT_QUALIFIER
protected transient boolean forInput
protected transient java.io.InputStream in
protected transient java.io.OutputStream out
| Constructor Detail |
public TextDataProvider()
| Method Detail |
public void setURLConnectionEnabled(boolean b)
b - true to enable the URL connectionpublic boolean isURLConnectionEnabled()
public void setFile(java.lang.String path)
path - the path of the text filepublic java.lang.String getFile()
public void setURL(java.lang.String url)
url - the URL of the text filepublic java.lang.String getURL()
public boolean open(boolean input)
input - true to open the input stream, false to open the output stream
public boolean close()
public void setSkippedColumns(java.lang.String skipColumns)
skipColumns - the string contains comma separated column indexespublic java.lang.String getSkippedColumns()
public boolean retrieveData(java.io.InputStream is)
is - the input stream from which to retrieve the data.public boolean saveData(java.io.OutputStream os)
os - the output stream to save the data to.public void retrieve()
public void save()
public boolean nextData()
public boolean isFetchNext()
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.ExternalizablewriteExternal in class AbstractDataProviderjava.io.IOException
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.ExternalizablereadExternal in class AbstractDataProviderjava.io.IOException
java.lang.ClassNotFoundException
|
ElegantJ Data Tables Java API Specification v1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||