|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
jp.go.kokken.Ankou.CompileResults
XML形式の結果をJTable形式に合わせます。
認められる入力形式は今のところ次のとおりです。
<result> <item> <IPU hidden="yes" IPUStartTime="00030.088"/> <IPU IPUEndTime="00060.088"/> </item> </result>
それぞれの<item>はTableで列になり、 <IPUやLUWなど>はセルとなります。行の数は 始めのitemの持つTAGの数で決められます。この例では2です。
attributeで、hidden属性がついている場合その行は表示されませんが getHiddenAttribute()で取得できます。音を再生する場合などで 使われる場合この属性が使われる事があるためです。 実装が簡易版なのでhidden属性が存在するだけで 非表示用データとなります。
getAttribute
またはgetHiddenAttribute
で
値を得るには、上の例では"IPU/@IPUStartTime"で検索
して下さい。
JTableのTableModelと隠し属性付のデータのTableModelは 別に保存されています。
入れ子クラスの概要 | |
(パッケージプライベート) class |
CompileResults.ReadOnlyTableModel
|
フィールドの概要 | |
(パッケージプライベート) int |
count
初めてレコードを作ったか(テーブル初期化のため) |
(パッケージプライベート) int |
depth
ツリーの深さ |
(パッケージプライベート) java.util.Vector |
headrecord
テーブルヘッダのVECTOR |
(パッケージプライベート) java.util.Vector |
hiddenheadrecord
テーブルヘッダのVECTOR |
(パッケージプライベート) CompileResults.ReadOnlyTableModel |
hiddenmodel
隠し属性つきのデータのテーブルの内容 |
(パッケージプライベート) java.util.Vector |
hiddenrecord
テーブルに登録するためのレコードのVECTOR (1 item) |
(パッケージプライベート) static org.apache.log4j.Logger |
logger
log4j logger |
(パッケージプライベート) CompileResults.ReadOnlyTableModel |
model
テーブルの内容 |
(パッケージプライベート) java.util.Vector |
prerecord
テーブルに登録した直前のVECTOR |
(パッケージプライベート) int |
previousdepth
一回前に読んだツリーの深さ |
(パッケージプライベート) java.util.Vector |
record
テーブルに登録するためのレコードのVECTOR (1 item) |
javax.swing.JTable |
table
そのまま使えるSWING component |
コンストラクタの概要 | |
CompileResults()
テーブルを初期化します。 |
メソッドの概要 | |
void |
addHiddenRow(java.util.Vector Names)
隠しデータのTableにレコード行を追加します。 |
void |
addRow(java.util.Vector Names)
JTableにレコード行を追加します。 |
void |
characters(char[] ch,
int start,
int length)
Receive notification of character data. |
void |
endDocument()
Receive notification of the end of the document. |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
Receive notification of the end of an element. |
void |
error(org.xml.sax.SAXParseException e)
Receive notification of a recoverable error. |
void |
fatalError(org.xml.sax.SAXParseException e)
Receive notification of a non-recoverable error. |
java.lang.String |
getAttribute(java.lang.String AttributeName,
int column)
属性を探してその値を返します。 |
java.lang.String |
getHiddenAttribute(java.lang.String AttributeName,
int column)
表示されない属性を探してその値を返します。 |
void |
registerResults(java.lang.String results)
結果の文字列からテーブルを作ります。 |
void |
setHeadColumn(java.util.Vector columnNames)
JTableを初期化しテーブルの一番上の行の表示を設定します。 |
void |
setHiddenHeadColumn(java.util.Vector columnNames)
隠し属性データのTableを初期化しテーブルの一番上の行の表示を設定します。 |
void |
startDocument()
Receive notification of the beginning of the document. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
Receive notification of the beginning of an element. |
java.io.InputStream |
string2InputStream(java.lang.String aStr)
文字列をInputStreamへ変換(ひどいメモリの無駄?) |
void |
warning(org.xml.sax.SAXParseException e)
Receive notification of a warning. |
クラス org.xml.sax.helpers.DefaultHandler から継承したメソッド |
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
static org.apache.log4j.Logger logger
public javax.swing.JTable table
CompileResults.ReadOnlyTableModel model
CompileResults.ReadOnlyTableModel hiddenmodel
int depth
int previousdepth
int count
java.util.Vector record
java.util.Vector prerecord
java.util.Vector headrecord
java.util.Vector hiddenrecord
java.util.Vector hiddenheadrecord
コンストラクタの詳細 |
public CompileResults()
メソッドの詳細 |
public void setHeadColumn(java.util.Vector columnNames) throws org.xml.sax.SAXException
columnNames
- 表示する文字列のVector
java.lang.Exception
- エラーがおきた時
org.xml.sax.SAXException
public void setHiddenHeadColumn(java.util.Vector columnNames) throws org.xml.sax.SAXException
columnNames
- 表示する文字列のVector
java.lang.Exception
- エラーがおきた時
org.xml.sax.SAXException
public void addRow(java.util.Vector Names) throws org.xml.sax.SAXException
Names
- 表示する文字列のVector
org.xml.sax.SAXException
- エラーがおきた時public void addHiddenRow(java.util.Vector Names) throws org.xml.sax.SAXException
Names
- 表示する文字列のVector
org.xml.sax.SAXException
- エラーがおきた時public java.io.InputStream string2InputStream(java.lang.String aStr) throws java.io.IOException
http://www.monyplaza.net/tips/java/java_tips5.xtpを利用
[JavaHouse-Brewers:38470] Re: String データをInputStream で読み込む方法 を参考
aStr
- 変換元文字列
java.io.IOException
- 文字列用ストリームのオープン又は、
書込みで例外発生public void registerResults(java.lang.String results) throws java.lang.IllegalArgumentException, org.xml.sax.SAXException, java.io.IOException
results
- 結果の文字列
java.lang.IllegalArgumentException
- 結果が空の時
org.xml.sax.SAXException
- XMLパースエラー
java.io.IOException
- IOエラー(普通は起こらないはず)public java.lang.String getHiddenAttribute(java.lang.String AttributeName, int column)
AttributeName
- 探す属性名column
- 何番目の値を返すか指定
public java.lang.String getAttribute(java.lang.String AttributeName, int column)
AttributeName
- 探す属性名column
- 何番目の値を返すか指定
public void startDocument() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.public void endDocument() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
itemレコードを読み込んでテーブルを作成する メインの関数です。1回目にitemレコードを読んだ時に setHeadColumn(String[] columnNames)を利用して テーブルの初期化を行ないます。以降、 レコードが大きい場合は原則として切り捨てます。
uri
- The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed.localName
- The local name (without prefix), or the
empty string if Namespace processing is not being
performed.qName
- The qualified name (with prefix), or the
empty string if qualified names are not available.atts
- The attributes attached to the element. If
there are no attributes, it shall be an empty
Attributes object.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
uri
- The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed.localName
- The local name (without prefix), or the
empty string if Namespace processing is not being
performed.qName
- The qualified XML 1.0 name (with prefix), or the
empty string if qualified names are not available.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
ch
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.DefaultHandler.ignorableWhitespace(char[], int, int)
,
Locator
public void warning(org.xml.sax.SAXParseException e)
e
- The warning information encapsulated in a
SAX parse exception.public void error(org.xml.sax.SAXParseException e)
e
- The error information encapsulated in a
SAX parse exception.public void fatalError(org.xml.sax.SAXParseException e)
e
- The error information encapsulated in a
SAX parse exception.
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |