treebolic.provider.xml.graph
Class AbstractParser

java.lang.Object
  extended by treebolic.provider.xml.graph.AbstractParser
Direct Known Subclasses:
GxlParser, GxmlParser

public abstract class AbstractParser
extends java.lang.Object

Graph parser

Author:
Bernard Bou

Constructor Summary
AbstractParser()
           
 
Method Summary
protected static org.w3c.dom.Element getFirstElementByTagName(org.w3c.dom.Element thisElement, java.lang.String thisTagName)
          Find DOM element with given tag
protected static org.w3c.dom.Element getFirstLevel1ElementByTagName(org.w3c.dom.Element thisElement, java.lang.String thisTagName)
          Find DOM element with given tag among first level children
protected static java.util.List<org.w3c.dom.Element> getLevel1ChildElementsByTagName(org.w3c.dom.Element thisElement, java.lang.String thisTagName)
          Find DOM elements with given tag among first level children
protected abstract  Graph parseGraph(org.w3c.dom.Document thisDocument)
          Parse graph from DOM document
 Model parseModel(java.net.URL thisUrl)
          Parse model
protected abstract  Settings parseSettings(org.w3c.dom.Document thisDocument)
          Parse settings from DOM document
private  Tree parseTree(org.w3c.dom.Document thisDocument)
          Parse tree from document
 Tree parseTree(java.net.URL thisUrl)
          Parse tree from url
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractParser

public AbstractParser()
Method Detail

parseGraph

protected abstract Graph parseGraph(org.w3c.dom.Document thisDocument)
Parse graph from DOM document

Returns:
tree if successful

parseSettings

protected abstract Settings parseSettings(org.w3c.dom.Document thisDocument)
Parse settings from DOM document

Returns:
graph if successful

parseModel

public Model parseModel(java.net.URL thisUrl)
Parse model

Returns:
model if successful

parseTree

public Tree parseTree(java.net.URL thisUrl)
Parse tree from url

Returns:
tree if successful

parseTree

private Tree parseTree(org.w3c.dom.Document thisDocument)
Parse tree from document

Returns:
tree if successful

getFirstElementByTagName

protected static org.w3c.dom.Element getFirstElementByTagName(org.w3c.dom.Element thisElement,
                                                              java.lang.String thisTagName)
Find DOM element with given tag

Parameters:
thisElement - starting DOM element
thisTagName - tag
Returns:
DOM element if found, null if none

getFirstLevel1ElementByTagName

protected static org.w3c.dom.Element getFirstLevel1ElementByTagName(org.w3c.dom.Element thisElement,
                                                                    java.lang.String thisTagName)
Find DOM element with given tag among first level children

Parameters:
thisElement - starting DOM element
thisTagName - tag
Returns:
DOM element if found, null if none

getLevel1ChildElementsByTagName

protected static java.util.List<org.w3c.dom.Element> getLevel1ChildElementsByTagName(org.w3c.dom.Element thisElement,
                                                                                     java.lang.String thisTagName)
Find DOM elements with given tag among first level children

Parameters:
thisElement - starting DOM element
thisTagName - tag
Returns:
DOM element if found, null if none