Aspire是一個RAD工具
Aspire可使用於多種servlet引擎
目前發展中的功能包含Crystal reports及Oracle reports等報表工具的整合界面
一
層次數據集並不是一個新的名詞
本篇重在講述層次數據集的結構和與其相關的Java API
現在你可能會問了
本篇主要焦點是服務於Java程序員的Java編程的API怎麼運用層次數據集
二
層次數據集可以表示為一個JavaAPI
<AspireDataSet>
<!
<key
<key
<!
<loop name=
</loop>
<loop name=
</loop>
</AspireDataSet>
這是一系列的key/value對
<loop name=
<row>
<!
<key
<key
<!
<loop name=
</loop>
<!
<loop name=
</loop>
</row>
<row>
</row>
</loop>
這裡唯一一個不成對的結構就是row結構了
三
當我把層次數據集以XML的形式展示的時候
package lgen;
import com
/**
* Represents a Hierarchical Data Set
* An hds is a collection of rows
* You can step through the rows using ILoopForwardIterator
* You can find out about the columns via IMetaData
* An hds is also a collection loops originated using the current row
*/
public interface ihds extends ILoopForwardIterator
{
/**
* Returns the parent if available
* Returns null if there is no parent
*/
public ihds getParent() throws DataException;
/**
* For the current row return a set of
* child loop names
* what the current row is
* @see ILoopForwardIterator
*/
public IIterator getChildNames() throws DataException;
/**
* Given a child name return the child Java object
* represented by ihds again
*/
public ihds getChild(String childName) throws DataException;
/**
* returns a column that is similar to SUM
* set of rows that are children to this row
*/
public String getAggregatevalue(String keyname) throws DataException;
/**
* Returns the column names of this loop or table
* @see IMetaData
*/
public IMetaData getMetaData() throws DataException;
/**
* Releases any resources that may be held by this loop of data
* or table
*/
public void close() throws DataException;
}
簡單的說來
如何在IHDS裡遍歷行記錄的接口: ILoopForwardIterator
package lgen;
import com
public interface ILoopForwardIterator
{
/**
* getvalue from the current row matching the key
*/
public String getvalue(final String key);
public void moveToFirst() throws DataException;
public void moveToNext() throws DataException;
public boolean isAtTheEnd() throws DataException;
}
IMetaData: 用於讀取列名的接口
package com
public interface IMetaData
{
public IIterator getIterator();
public int getColumnCount();
public int getIndex(final String attributeName)
throws FieldNameNotFoundException;
}
你是怎麼得到層次數據集的?你又可以怎麼去用他?
現在我們已經知道了層次數據集的結構了
下面具體介紹了這裡面的細節:
閱讀Aspire JAR的基礎的使用方法:
Aspire是一個很小的jar文件
一個早期的標志性的對Aspire的評論參見:
為你的層次數據集創建定義文件:
一個層次數據集的定義實例:
###################################
# ihdsTest data definition: section
###################################
request
request
#section
request
r
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28233.html