org.xerial.util.xml.index
Class DataGuide

java.lang.Object
  extended by org.xerial.util.xml.pullparser.AbstractSAXEventHandler
      extended by org.xerial.util.xml.index.DataGuide
All Implemented Interfaces:
SAXEventHandler

public class DataGuide
extends AbstractSAXEventHandler

DataGuideを作成する

Author:
leo

Field Summary
static String ROOT_TAG
           
 
Constructor Summary
DataGuide()
           
 
Method Summary
 void closeTag()
           
 void endTag(org.xmlpull.v1.XmlPullParser parser)
           
 void generateFrom(Reader xmlReader)
          readerからXMLを読み込んで、DataGuideを生成する
 void generateFrom(String xmlFile)
          xml fileを読んでDataGuideを生成する。
 int getPathID(SinglePath path)
          DataGuideをたどって、与えられたpathに該当するノードIDを得る
 int getTagID(String tagName)
          DataGuide中のノードIDを返す
 void init()
           
static void main(String[] args)
           
 void newAttribute(String attributeName)
           
 int newTag(String tagName)
           
 void outputGraphviz(OutputStream out)
           
 void startDocument(org.xmlpull.v1.XmlPullParser parser)
           
 void startTag(org.xmlpull.v1.XmlPullParser parser)
           
 
Methods inherited from class org.xerial.util.xml.pullparser.AbstractSAXEventHandler
endDocument, text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_TAG

public static final String ROOT_TAG
See Also:
Constant Field Values
Constructor Detail

DataGuide

public DataGuide()
Method Detail

getPathID

public int getPathID(SinglePath path)
DataGuideをたどって、与えられたpathに該当するノードIDを得る

Parameters:
path -
Returns:
ノードID. 該当するパスが存在しないときには-1

getTagID

public int getTagID(String tagName)
DataGuide中のノードIDを返す

Parameters:
tagName - タグの名前。attributeの場合は, @id のような形式
Returns:
node ID. タグに対応するノードが見つからない場合には、-1

newTag

public int newTag(String tagName)
           throws XMLException
Throws:
XMLException

newAttribute

public void newAttribute(String attributeName)
                  throws XMLException
Throws:
XMLException

closeTag

public void closeTag()

init

public void init()

startDocument

public void startDocument(org.xmlpull.v1.XmlPullParser parser)
                   throws XMLException
Specified by:
startDocument in interface SAXEventHandler
Overrides:
startDocument in class AbstractSAXEventHandler
Throws:
XMLException

startTag

public void startTag(org.xmlpull.v1.XmlPullParser parser)
              throws XMLException
Specified by:
startTag in interface SAXEventHandler
Overrides:
startTag in class AbstractSAXEventHandler
Throws:
XMLException

endTag

public void endTag(org.xmlpull.v1.XmlPullParser parser)
            throws XMLException
Specified by:
endTag in interface SAXEventHandler
Overrides:
endTag in class AbstractSAXEventHandler
Throws:
XMLException

generateFrom

public void generateFrom(String xmlFile)
                  throws FileNotFoundException,
                         Exception,
                         IOException,
                         XerialException
xml fileを読んでDataGuideを生成する。

Parameters:
xmlFile -
Throws:
FileNotFoundException
XMLParserException
XMLException
IOException
XerialException
Exception

generateFrom

public void generateFrom(Reader xmlReader)
                  throws Exception,
                         IOException,
                         XerialException
readerからXMLを読み込んで、DataGuideを生成する

Parameters:
xmlReader -
Throws:
FileNotFoundException
XMLParserException
Exception
IOException
XerialException

outputGraphviz

public void outputGraphviz(OutputStream out)

main

public static void main(String[] args)
                 throws OptionParserException
Throws:
OptionParserException


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