|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjimm.datavision.source.DataSource
public abstract class DataSource
An abstract data source.
Column,
Table,
Query| Field Summary | |
|---|---|
protected java.lang.String |
metadataURL
|
protected Query |
query
|
protected Report |
report
|
| Constructor Summary | |
|---|---|
DataSource(Report r,
Query q)
|
|
| Method Summary | |
|---|---|
void |
addColumn(Column col)
Called from ReportReader.column to add a column to a
data source. |
boolean |
alreadyUsedSourceFile()
Returns true if this data source uses a file to retrieve
data and and has already done so. |
abstract boolean |
areRecordsSelectable()
Used to enable/disable the "Select Records" menu item. |
abstract boolean |
areRecordsSortable()
Used to enable/disable the "Sort By" menu item. |
abstract boolean |
canGroupRecords()
Used to enable/disable the "Group By" menu item. |
abstract boolean |
canJoinTables()
Used to enable/disable the "Table Linker" menu item. |
boolean |
canRunReports()
Used to enable/disable the "Run" and "Export" menu items. |
abstract java.util.Iterator |
columns()
Returns an iterator over all columns. |
java.util.Iterator |
columnsInTablesUsedInReport()
Returns an iterator over all the columns in only the tables used by the report, or over all columns if this data source does not have tables. |
boolean |
containsReferenceTo(Parameter p)
Returns true if the specified parameter exists within this
data source's query. |
protected abstract void |
doWriteXML(XMLWriter out)
|
abstract DataCursor |
execute()
|
abstract Column |
findColumn(java.lang.Object id)
Given an id, returns the column that has that id. |
Query |
getQuery()
|
Report |
getReport()
|
java.lang.String |
getSourceFile()
Gets the path to a data source file. |
int |
indexOfSelectable(Selectable sel)
Returns the index of the specified selectable. |
abstract boolean |
isConnectionEditable()
Used to enable/disable the "Connection" menu item. |
abstract boolean |
isSQLGenerated()
Used to enable/disable the "SQL Query Text" menu item. |
boolean |
needsSourceFile()
Returns true if this data source uses a file to retrieve
data and does not yet have one. |
void |
readMetadataFrom(java.lang.String urlString)
Reads metadata from a URL. |
void |
reloadColumns()
Called from Report.reloadColumns/code>, this method gives the
data source a chance to tell its ancillary objects (such as the query)
to reload column objects. |
void |
removeSort(Selectable s)
|
void |
reuseSourceFile()
Tells this data source to re-use (perhaps re-open) the current data source file. |
void |
setSourceFile(java.lang.String filePath)
Accepts the path to a data source file. |
abstract java.util.Iterator |
tables()
Returns an iterator over all tables, or null if the
data source does not have tables (for example, a character-separated
file data source). |
abstract java.util.Iterator |
tablesUsedInReport()
Returns an iterator over all tables actually used in the report, or null if the data source does not have tables (for example,
a character-separated file data source). |
boolean |
usesSourceFile()
Returns true if this data source uses a file to retrieve
data. |
void |
writeXML(XMLWriter out)
Writes this data source and its query as an XML tag. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Report report
protected Query query
protected java.lang.String metadataURL
| Constructor Detail |
|---|
public DataSource(Report r,
Query q)
| Method Detail |
|---|
public abstract boolean canJoinTables()
true if the "Table Linker" menu item
should be enabled.public abstract boolean isSQLGenerated()
true if the "SQL Query Text" menu item
should be enabled.public abstract boolean isConnectionEditable()
true if the "Connection" menu item
should be enabled.public abstract boolean areRecordsSelectable()
true if the "Select Records" menu item
should be enabled.public abstract boolean areRecordsSortable()
true if the "Sort By" menu item
should be enabled.public abstract boolean canGroupRecords()
true if the "Group By" menu item
should be enabled.public boolean canRunReports()
true if the "Run" and "Export"
menu items should be enabled.public boolean usesSourceFile()
true if this data source uses a file to retrieve
data. The default implementation returns false.
true if this data source uses a file to retrieve
datapublic boolean needsSourceFile()
true if this data source uses a file to retrieve
data and does not yet have one. The default implementation returns false.
true if this data source uses a file to retrieve
data and doesn't yet have onepublic boolean alreadyUsedSourceFile()
true if this data source uses a file to retrieve
data and and has already done so. The default implementation returns false.
true if this data source uses a file to retrieve
data
public void setSourceFile(java.lang.String filePath)
throws java.io.FileNotFoundException
filePath - the full path to a file
java.io.FileNotFoundExceptionpublic java.lang.String getSourceFile()
public void reuseSourceFile()
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic Report getReport()
public Query getQuery()
public abstract DataCursor execute()
throws java.lang.Exception
java.lang.Exceptionpublic void addColumn(Column col)
ReportReader.column to add a column to a
data source.
The default implementation does nothing.
col - a columnpublic void reloadColumns()
Report.reloadColumns/code>, this method gives the
data source a chance to tell its ancillary objects (such as the query)
to reload column objects.
This is necessary, for example, after a SQL database data source has
reloaded all of its table and column information. The old column
objects no longer exist. New ones (with the same ids, we assume) have
taken their place.
public void readMetadataFrom(java.lang.String urlString)
throws java.lang.Exception
urlString - where to get the metadata
java.lang.ExceptionMetadataReaderpublic abstract Column findColumn(java.lang.Object id)
null.
null if no column with the specified
id existspublic int indexOfSelectable(Selectable sel)
sel - a selectablepublic abstract java.util.Iterator tables()
null if the
data source does not have tables (for example, a character-separated
file data source).
null iterator over all tablespublic abstract java.util.Iterator tablesUsedInReport()
null if the data source does not have tables (for example,
a character-separated file data source).
null iterator over all tables used
in the reportpublic abstract java.util.Iterator columns()
public java.util.Iterator columnsInTablesUsedInReport()
public void removeSort(Selectable s)
public boolean containsReferenceTo(Parameter p)
true if the specified parameter exists within this
data source's query.
p - a parameter
true if the specified parameter exists within
the queryQuery.containsReferenceTo(jimm.datavision.Parameter)public void writeXML(XMLWriter out)
writeXML in interface Writeableout - a writer that knows how to write XMLprotected abstract void doWriteXML(XMLWriter out)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||