com.hamaf.hikyaku.util
クラス XmlUtil

java.lang.Object
  上位を拡張 com.hamaf.hikyaku.util.XmlUtil

public class XmlUtil
extends java.lang.Object

タイトル: XmlUtil is opretion DOM Utility.

説明: XMLの操作を行うユーティリティクラス

著作権: Copyright (c) 2003

バージョン:
1.0
作成者:
Hamanaka

コンストラクタの概要
XmlUtil()
           
 
メソッドの概要
static org.w3c.dom.Document createDocument()
          Describe createDocument method : create new Document Object.
static org.w3c.dom.Document createDocument(java.io.InputStream input)
          Describe createDocument method : create new Document from Xml File.
static org.w3c.dom.Document createDocument(java.lang.String fileName)
          Describe createDocument method : create new Document from Xml File.
static org.w3c.dom.Node getNextElement(org.w3c.dom.Node nd)
          Describe getNextElement method : return First Next Element.
static org.w3c.dom.Node getPreviousElement(org.w3c.dom.Node nd)
          Describe getPreviousElement method : return First Previous Element.
static void writeXml(org.w3c.dom.Document xml, java.io.OutputStream out, java.lang.String encode)
          Describe writeXml method : Document write to OutputStream.
static void writeXml(org.w3c.dom.Document xml, java.lang.String fileName, java.lang.String encode)
          Describe writeXml method : Document write to File.
static void writeXml(org.w3c.dom.Document xml, java.io.Writer out, java.lang.String encode)
          Describe writeXml method : Document write to Writer.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

XmlUtil

public XmlUtil()
メソッドの詳細

createDocument

public static final org.w3c.dom.Document createDocument()
                                                 throws java.lang.Exception
Describe createDocument method : create new Document Object. 新しい空のドキュメントオブジェクトを生成して戻します。

戻り値:
a Document : 生成したDocument
例外:
java.lang.Exception

createDocument

public static final org.w3c.dom.Document createDocument(java.lang.String fileName)
                                                 throws java.lang.Exception
Describe createDocument method : create new Document from Xml File.
指定された、XML File(URL指定)より DOM を構築して戻します。

パラメータ:
fileName - a String : Document を構築する XML File のURL
戻り値:
a Document : 生成したDocument
例外:
java.lang.Exception

createDocument

public static final org.w3c.dom.Document createDocument(java.io.InputStream input)
                                                 throws java.lang.Exception
Describe createDocument method : create new Document from Xml File.
渡された入力ストリームより DOM を構築して戻します。

パラメータ:
input - an InputStream : Document を構築する入力ストリーム
戻り値:
a Document : 生成したDocument
例外:
java.lang.Exception

writeXml

public static final void writeXml(org.w3c.dom.Document xml,
                                  java.io.Writer out,
                                  java.lang.String encode)
                           throws java.lang.Exception
Describe writeXml method : Document write to Writer.
DOMをXML形式でライターに書き出します。
文字コードに対応したWriterを指定すること。

パラメータ:
xml - a Document : 出力するDocument Object
out - an Writer : 出力先のWriter
encode - a StreamResult : 出力する文字コード(規定値 UTF-8)
例外:
java.lang.Exception

writeXml

public static final void writeXml(org.w3c.dom.Document xml,
                                  java.io.OutputStream out,
                                  java.lang.String encode)
                           throws java.lang.Exception
Describe writeXml method : Document write to OutputStream.
DOMをXML形式でストリームに書き出します。

パラメータ:
xml - a Document : 出力するDocument Object
out - an OntputStream : 出力先のストリーム
encode - a StreamResult : 出力する文字コード(規定値 UTF-8)
例外:
java.lang.Exception

writeXml

public static final void writeXml(org.w3c.dom.Document xml,
                                  java.lang.String fileName,
                                  java.lang.String encode)
                           throws java.lang.Exception
Describe writeXml method : Document write to File.
DOMをXML形式でファイルに書き出します。

パラメータ:
xml - a Document : 出力するDocument Object
fileName - a String : 出力先のファイルのフルパス名
encode - a StreamResult : 出力する文字コード(規定値 UTF-8)
例外:
java.lang.Exception

getPreviousElement

public static final org.w3c.dom.Node getPreviousElement(org.w3c.dom.Node nd)
Describe getPreviousElement method : return First Previous Element. 渡されたノードのすぐ上のエレメントノードを戻します。該当するノードが存在しない場合は null が返されます。

パラメータ:
nd - a Node : 元になるノード
戻り値:
a Node : すぐ上のエレメントノード

getNextElement

public static final org.w3c.dom.Node getNextElement(org.w3c.dom.Node nd)
Describe getNextElement method : return First Next Element. 渡されたノードのすぐ下のエレメントノードを戻します。該当するノードが存在しない場合は null が返されます。

パラメータ:
nd - a Node : 元になるノード
戻り値:
a Node : すぐ下のエレメントノード