|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDatasourceBasic
A one-way navigable datasource, that has read-only data. Columns are wrapped in com.dynamide.Field objects that are registered with the com.dynamide.Session so that the Widgets can automatically get live data. If you wish to provide navigation such as seekBegin(), seekEnd(), go(relative) and to provide update capability such as setFieldValue(...) then use com.dynamide.db.IDatasource instead.
Implementations may wish to provide the following method or constructor arguments which are not part of the interface:
Method Summary | |
---|---|
java.lang.Object |
get(java.lang.String what)
Implementors can return an Object from this method, but make sure that toString() makes sense. |
IDatasource |
getDatasourceHelper()
By default, return a com.dynamide.db.DatasourceHelper(IDatasourceBasic), e.g. |
Field |
getField(java.lang.String fieldName)
Maintain a list of Field objects, and register them with the Session; return the live Field when asked by this method. |
java.util.Map |
getFields()
|
java.lang.String |
getID()
A unique name within the Application for this datasource, it becomes the ID by which Widgets can discover the datasource. |
java.util.Iterator |
iterator()
Return an Iterator which knows how to properly iterate over your implementation. |
Method Detail |
---|
java.lang.String getID()
IDatasource getDatasourceHelper()
private IDatasource m_datasourceHelper = null; public IDatasource getDatasourceHelper(){ if (m_datasourceHelper == null){ m_datasourceHelper = new DatasourceHelper(this); } return m_datasourceHelper; }or return a subclass of DatasourceHelper or a class that implements IDatasource by forwarding correct methods to this class, e.g. your own policy. Under most circumstances, DatasourceHelper should fulfil all requirements. DatasourceHelper simply wraps your IDatasourceBasic and makes it able to respond to the calls in IDatasource.
Field getField(java.lang.String fieldName)
java.util.Map getFields()
java.lang.Object get(java.lang.String what) throws java.lang.Exception
java.lang.Exception
java.util.Iterator iterator()
public class MyClass implements IDatasourceBasic{ public class MyDatasourceIterator implements Iterator { private MyClass m_target; private int m_iterCount = 0; public SessionDatasourceIterator(MyClass target){ m_target = target; } public Object next(){ m_iterCount++; return m_target; } public boolean hasNext(){ return (m_iterCount < 1); } public void remove(){ throw new UnsupportedOperationException(); } } }
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |