Class StiDataSource
java.lang.Object
com.stimulsoft.base.serializing.StiSerializedObject
com.stimulsoft.report.dictionary.dataSources.StiDataSource
- All Implemented Interfaces:
IStiJsonReportObject,IStiSerializable,IStiSerializableRef,IStiName,IStiEnumerator,ICloneable,IStiAlias,IStiInherited,IStiStateSaveRestore,Cloneable
- Direct Known Subclasses:
StiDataSourceEmpty,StiDataStoreSource
public abstract class StiDataSource
extends StiSerializedObject
implements IStiSerializableRef, Cloneable, IStiStateSaveRestore, IStiEnumerator, IStiName, IStiInherited, IStiJsonReportObject, IStiAlias, ICloneable
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanbooleanFields inherited from interface com.stimulsoft.base.serializing.interfaceobject.IStiSerializableRef
REFERENCE_EMPTY, REFERENCE_REPORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidInternal use only.voidClear all states.voidClear all earlier saved object states.clone()abstract voidconnect()abstract voidvoidfetchParentRelations(boolean activePreferred) voidFirst()Sets a position at the beginning.get(int index) final StringgetAlias()Gets or sets of the Data Source alias.Returns the name to categories of the Data Source.GetChildDataSource(String relationName) Returns the child Data Source by the relation name.Returns a collection of Child relations.final intGetColumnIndex(String columnName) Returns the index of a column in the data source.Gets or sets the column collection.final Object[][][]GetConditions(StiDataBand dataBand) booleanGets or sets value which indicates that datasource not connect to the data automatically.final intgetCount()Gets count of elements.final ObjectReturns the value by the column name and the current position in the Data Source.final ObjectReturns the value by the column name and index of row in the Data Source.protected StiDatabaseabstract Class<? extends StiDatabase> final DataRowGetDataRow(int index) final DataTableGets DataTable.final StiDictionaryGets or sets the dictionary in which this Data Source is located.final booleanbooleangetIsBof()Gets value indicates that this position specifies to the beginning of data.final booleanGets value indicates which Data Source is connected with data.booleanGets value indicates that no data.booleangetIsEof()Gets value indicates that this position specifies to the data end.Indexer to work with the current row of data.getKey()final intGetLevel()Returns level of data in hierarchical band.final StringgetName()Gets or sets of the Data Source name.Gets or sets the parameter collection.final StiDataRowGetParentData(String relationName) Returns the parent row with data for the indicated relation.GetParentDataSource(String relationName) Returns the parent Data Source by the relation name.Returns the colection of Parent relations.intGets the current position.intfinal intgetRelations(String relationName) final StiRowsCollectiongetRows()Gets or sets rows collection.protected final StiStatesManagerGets the component states manager.protected final voidprotected final voidbooleanisEmpty()voidLast()Sets a position on the last element.voidLoadFromJsonObject(JSONObject jObject) voidNext()Sets a position on the next element.voidvoidPrior()Sets a position on the previous element.final voidfinal voidvoidrestoreState(String stateName) Restores the earlier saved object state.voidRestoreState(String stateName) Restores the earlier saved object state.voidSaves the current state of an object.final voidvoidvoidsetConnectOnStart(boolean value) voidsetCorrectName(String correctName) final voidSetData(StiDataBand dataBand, String relationName, Object filterMethod, ArrayList<String> sortColumns, boolean reinit, StiComponent component) final voidsetDataTable(DataTable value) final voidSetDetails(String relationName) Set the details data for Data Source.final voidsetDictionary(StiDictionary value) final voidApply filter to data.final voidsetInherited(boolean value) voidsetIsBof(boolean value) voidsetIsEof(boolean value) voidfinal voidvoidvoidsetPosition(int value) voidsetPositionValue(int positionValue) final voidsetRows(StiRowsCollection value) final voidSetSort(Object[][][] conditions, ArrayList<String> sortColumns, StiComponent component, StiDataBand databand, ArrayList<StiGroupHeaderBand> groupHeaders) Sorts data.voidsetVariableParameters(List<StiDataParameter> variableParameters) intsize()toString()Returns the text view of the Data Source.Methods inherited from class com.stimulsoft.base.serializing.StiSerializedObject
cleanReference, getReference, setReferenceMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stimulsoft.base.serializing.interfaceobject.IStiSerializableRef
getReference, setReference
-
Field Details
-
initForSubreport
public boolean initForSubreport -
columnsIndexs
-
detailRows
-
RowToLevel
-
connectOnStart
public boolean connectOnStart -
connectionOrder
-
columns
-
-
Constructor Details
-
StiDataSource
public StiDataSource() -
StiDataSource
Creates a new Data Source.- Parameters:
name- Data Source name.alias- Data Source alias.
-
-
Method Details
-
getKey
- Returns:
- the key
-
setKey
- Parameters:
key- the key to set
-
getInherited
public final boolean getInherited()- Specified by:
getInheritedin interfaceIStiInherited
-
setInherited
public final void setInherited(boolean value) - Specified by:
setInheritedin interfaceIStiInherited
-
getDatabaseClass
-
getName
Gets or sets of the Data Source name. -
setName
-
setCorrectName
-
getPosition
public int getPosition()Gets the current position.- Specified by:
getPositionin interfaceIStiEnumerator
-
setPosition
public void setPosition(int value) - Specified by:
setPositionin interfaceIStiEnumerator
-
getRealCount
public final int getRealCount() -
getCount
public final int getCount()Gets count of elements.- Specified by:
getCountin interfaceIStiEnumerator
-
getIsBof
public boolean getIsBof()Gets value indicates that this position specifies to the beginning of data.- Specified by:
getIsBofin interfaceIStiEnumerator
-
setIsBof
public void setIsBof(boolean value) - Specified by:
setIsBofin interfaceIStiEnumerator
-
getIsEof
public boolean getIsEof()Gets value indicates that this position specifies to the data end.- Specified by:
getIsEofin interfaceIStiEnumerator
-
setIsEof
public void setIsEof(boolean value) - Specified by:
setIsEofin interfaceIStiEnumerator
-
getIsEmpty
public boolean getIsEmpty()Gets value indicates that no data.- Specified by:
getIsEmptyin interfaceIStiEnumerator
-
First
public void First()Sets a position at the beginning.- Specified by:
Firstin interfaceIStiEnumerator
-
Prior
public void Prior()Sets a position on the previous element.- Specified by:
Priorin interfaceIStiEnumerator
-
Next
public void Next()Sets a position on the next element.- Specified by:
Nextin interfaceIStiEnumerator
-
Last
public void Last()Sets a position on the last element.- Specified by:
Lastin interfaceIStiEnumerator
-
getStates
Gets the component states manager. -
saveState
Saves the current state of an object.- Specified by:
saveStatein interfaceIStiStateSaveRestore- Parameters:
stateName- A name of the state being saved.
-
ClearAllStates
public void ClearAllStates()Clear all earlier saved object states. -
SetData
public final void SetData(StiDataBand dataBand, String relationName, Object filterMethod, ArrayList<String> sortColumns, boolean reinit, StiComponent component) -
GetConditions
-
SetDetails
Set the details data for Data Source.- Parameters:
relationName- Relation to find Parent of the Data Source.
-
getRelations
-
SetFilter
Apply filter to data.- Parameters:
filterMethod-
-
SetSort
public final void SetSort(Object[][][] conditions, ArrayList<String> sortColumns, StiComponent component, StiDataBand databand, ArrayList<StiGroupHeaderBand> groupHeaders) Sorts data. If data source is not able to sort data then this command is ignored.- Parameters:
sortColumns- Array with group conditions. 0 dimension - data rows, 1 dimension - group condition, 2 dimension - sort directioncolumns- Parameters of sorting. Example: new string[] {"ASC", "Company", "DESC", "ParentRelation", "DATE"}
-
ResetDetailsRows
public final void ResetDetailsRows() -
ResetData
public final void ResetData() -
GetDataRow
-
GetParentData
Returns the parent row with data for the indicated relation.- Parameters:
relationName- Relation name.- Returns:
- Relation string.
-
GetParentRelations
Returns the colection of Parent relations.- Returns:
- Collection.
-
fetchParentRelations
-
GetChildRelations
Returns a collection of Child relations.- Returns:
- Collection.
-
GetParentDataSource
Returns the parent Data Source by the relation name.- Parameters:
relationName- Relation name.- Returns:
- Data Source.
-
GetChildDataSource
Returns the child Data Source by the relation name.- Parameters:
relationName- Relation name.- Returns:
- Data Source.
-
prepareData
public void prepareData() -
InvokeConnecting
protected final void InvokeConnecting() -
InvokeDisconnecting
protected final void InvokeDisconnecting() -
getDatabase
-
disconnect
public void disconnect() -
getIsConnected
public final boolean getIsConnected()Gets value indicates which Data Source is connected with data. -
getParameters
Gets or sets the parameter collection. -
setParameters
-
getItem
Indexer to work with the current row of data. Returns the value by the column name and the current position in the Data Source. Indexer calls the method GetData. ColumnName - name of column. -
GetData
Returns the value by the column name and the current position in the Data Source.- Parameters:
columnName- Column name.- Returns:
- Value.
-
GetData
Returns the value by the column name and index of row in the Data Source.- Parameters:
columnName- Column name.rowIndex- Index of row in the Data Source.- Returns:
- Value.
-
GetColumnIndex
Returns the index of a column in the data source.- Parameters:
columnName- Column name.- Returns:
- Index.
-
getRows
Gets or sets rows collection. -
setRows
-
CheckColumnsIndexs
public final void CheckColumnsIndexs()Internal use only. -
toString
Returns the text view of the Data Source. -
GetLevel
public final int GetLevel()Returns level of data in hierarchical band.- Returns:
-
GetCategoryName
Returns the name to categories of the Data Source. -
getConnectOnStart
public boolean getConnectOnStart()Gets or sets value which indicates that datasource not connect to the data automatically. -
setConnectOnStart
public void setConnectOnStart(boolean value) -
getDataTable
Gets DataTable. -
connect
- Throws:
StiException
-
connect
- Throws:
StiException
-
setDataTable
-
getDictionary
Gets or sets the dictionary in which this Data Source is located. -
setDictionary
-
getAlias
Gets or sets of the Data Source alias. -
setAlias
-
getColumns
Gets or sets the column collection. -
setColumns
-
getData
-
restoreState
Description copied from interface:IStiStateSaveRestoreRestores the earlier saved object state.- Specified by:
restoreStatein interfaceIStiStateSaveRestore- Parameters:
stateName- A name of the state being restored.
-
RestoreState
Restores the earlier saved object state.- Parameters:
stateName- A name of the state being restored.
-
clearAllStates
public void clearAllStates()Description copied from interface:IStiStateSaveRestoreClear all states.- Specified by:
clearAllStatesin interfaceIStiStateSaveRestore
-
isEmpty
public boolean isEmpty() -
get
-
setPositionValue
public void setPositionValue(int positionValue) -
getPositionValue
public int getPositionValue() -
size
public int size() -
clone
- Specified by:
clonein interfaceICloneable- Overrides:
clonein classObject
-
SaveToJsonObject
- Specified by:
SaveToJsonObjectin interfaceIStiJsonReportObject- Throws:
JSONException
-
LoadFromJsonObject
- Specified by:
LoadFromJsonObjectin interfaceIStiJsonReportObject- Throws:
JSONException
-
getVariableParameters
- Returns:
- the variableParameters
-
setVariableParameters
- Parameters:
variableParameters- the variableParameters to set
-
getVariableParameterByName
-
get
-