org.xerial.util.xml.pullparser
Class DOMBuilder

java.lang.Object
  extended by org.xerial.util.xml.pullparser.DOMBuilder

public class DOMBuilder
extends Object

XML形式入力からDOMのElementを生成するためのクラス PROCESSING_INSTRUCTION, COMMENTは無視される

Author:
leo

Constructor Summary
DOMBuilder()
           
 
Method Summary
protected  Document createNewDOMDocument()
           
protected  String createQName(String prefix, String name)
           
 Element parse(Reader xmlReader)
          任意のReaderからDOMElementを生成
 Element parse(org.xmlpull.v1.XmlPullParser pullParser)
          現在のPullParserの位置の状態から部分木に対応するDOM Elementを生成する。 side effect: PullParserのparsingは、部分木分だけ進み、その部分木のEND_TAGを指した状態になる
protected  Element parseElement(org.xmlpull.v1.XmlPullParser pullParser, Document document)
           
protected  Element parseSubTree(org.xmlpull.v1.XmlPullParser pullParser)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMBuilder

public DOMBuilder()
Method Detail

parse

public Element parse(Reader xmlReader)
              throws org.xmlpull.v1.XmlPullParserException,
                     IOException,
                     XMLException
任意のReaderからDOMElementを生成

Parameters:
xmlReader - XMLの入力
Returns:
XMLの入力に対応するDOMのElement
Throws:
org.xmlpull.v1.XmlPullParserException - parserの生成に失敗したとき
IOException - XMLの読み込みに失敗したとき
XMLException - invalidなXMLが読み込まれた場合

parse

public Element parse(org.xmlpull.v1.XmlPullParser pullParser)
              throws XMLException,
                     IOException
現在のPullParserの位置の状態から部分木に対応するDOM Elementを生成する。 side effect: PullParserのparsingは、部分木分だけ進み、その部分木のEND_TAGを指した状態になる

Parameters:
pullParser -
Returns:
入力のXMLに対応するDOMのElement
Throws:
IOException - XMLの読み込みに失敗したとき
XMLException - invalidなXMLが読み込まれた場合

parseSubTree

protected Element parseSubTree(org.xmlpull.v1.XmlPullParser pullParser)
                        throws XMLException,
                               IOException
Throws:
XMLException
IOException

parseElement

protected Element parseElement(org.xmlpull.v1.XmlPullParser pullParser,
                               Document document)
                        throws org.xmlpull.v1.XmlPullParserException,
                               InvalidXMLException,
                               IOException
Throws:
org.xmlpull.v1.XmlPullParserException
InvalidXMLException
IOException

createQName

protected String createQName(String prefix,
                             String name)

createNewDOMDocument

protected Document createNewDOMDocument()
                                 throws XMLException
Throws:
XMLException


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.