com.bowstreet.builders.webapp.methods
Class XmlDataRetriever

java.lang.Object
  extended by com.bowstreet.builders.webapp.methods.XmlDataRetriever
All Implemented Interfaces:
DataRetriever, com.bowstreet.builders.webapp.methods.DateFormatClient, SortableData

public class XmlDataRetriever
extends java.lang.Object
implements DataRetriever, SortableData, com.bowstreet.builders.webapp.methods.DateFormatClient

Data retriever implementation which accesses XML data.


Field Summary
static java.lang.String DB_SVC_PATH
           
 
Fields inherited from interface com.bowstreet.builders.webapp.methods.SortableData
CASE_INSENSITIVE, DATES, DEFAULT_TYPE, NUMBERS
 
Constructor Summary
XmlDataRetriever()
          Default constructor - leaves data uninitialized.
XmlDataRetriever(IXml data)
          Construct from given data.
XmlDataRetriever(IXml data, boolean clone)
          Construct from given data, optionally cloning the data.
 
Method Summary
 boolean equals(java.lang.Object other)
          Override of Object method - XmlDataRetrievers are equal if their data is.
 IXml getData(int startRow)
          Return rows starting at specified position.
 java.lang.String getDateFormatPattern()
          Return the current date format pattern.
 int getFetchSize()
          Indicate preferred chunk size for data retrieval.
 int getRowCount()
          Return total number of rows in this data set.
static IXml getRowSubset(IXml data, int startRow, int rowCount)
          Utility method to get a group of rows from within an IXml table.
static IXml getRowSubset(IXml data, int startRow, int rowCount, java.lang.String filter)
          Utility method to get a group of rows from within an IXml table.
 void setData(IXml data)
          Set data to use.
 void setDateFormatPattern(java.lang.String dateFormatPattern)
          Set the format pattern to use when parsing dates.
 void setFetchSize(int fetchSize)
          Set fetch size (not part of retriever interface)
 void setFilter(java.lang.String filter, int skipCount)
           
 boolean sort(java.lang.String sortBy, java.lang.String sortType, boolean ascending)
          Sort data according to the text of the given column.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DB_SVC_PATH

public static final java.lang.String DB_SVC_PATH
See Also:
Constant Field Values
Constructor Detail

XmlDataRetriever

public XmlDataRetriever()
Default constructor - leaves data uninitialized.


XmlDataRetriever

public XmlDataRetriever(IXml data)
Construct from given data.


XmlDataRetriever

public XmlDataRetriever(IXml data,
                        boolean clone)
Construct from given data, optionally cloning the data.

Parameters:
data -
clone -
Method Detail

equals

public boolean equals(java.lang.Object other)
Override of Object method - XmlDataRetrievers are equal if their data is.

Overrides:
equals in class java.lang.Object

getData

public IXml getData(int startRow)
Return rows starting at specified position. Number of rows should be equal to what getFetchSize would return, if possible.

Specified by:
getData in interface DataRetriever

getDateFormatPattern

public java.lang.String getDateFormatPattern()
Return the current date format pattern.

Specified by:
getDateFormatPattern in interface com.bowstreet.builders.webapp.methods.DateFormatClient

getFetchSize

public int getFetchSize()
Indicate preferred chunk size for data retrieval.

Specified by:
getFetchSize in interface DataRetriever

getRowCount

public int getRowCount()
Return total number of rows in this data set.

Specified by:
getRowCount in interface DataRetriever

getRowSubset

public static IXml getRowSubset(IXml data,
                                int startRow,
                                int rowCount)
Utility method to get a group of rows from within an IXml table.


getRowSubset

public static IXml getRowSubset(IXml data,
                                int startRow,
                                int rowCount,
                                java.lang.String filter)
Utility method to get a group of rows from within an IXml table.

Parameters:
filter - TODO

setData

public void setData(IXml data)
Set data to use.


setDateFormatPattern

public void setDateFormatPattern(java.lang.String dateFormatPattern)
Set the format pattern to use when parsing dates.

Specified by:
setDateFormatPattern in interface com.bowstreet.builders.webapp.methods.DateFormatClient
Parameters:
dateFormatPattern - pattern string as used by SimpleDateFormat.

setFetchSize

public void setFetchSize(int fetchSize)
Set fetch size (not part of retriever interface)


setFilter

public void setFilter(java.lang.String filter,
                      int skipCount)

sort

public boolean sort(java.lang.String sortBy,
                    java.lang.String sortType,
                    boolean ascending)
Sort data according to the text of the given column. Sorted data will be available next time it is fetched from the data source.

Specified by:
sort in interface SortableData
Parameters:
sortBy - name of the column whose data controls sort order
sortType - how to interpret and compare the data - NUMBERS, DATES, CASE_INSENSITIVE or DEFAULT_TYPE
ascending - true if data should be sorted in ascending order
Returns:
indication of sorting success


Copyright © 2009 IBM. All Rights Reserved.