org.simBio.sim.dm.util
Class DOMHandler

java.lang.Object
  extended by org.simBio.sim.dm.util.DOMHandler

public class DOMHandler
extends java.lang.Object

This class handle the DOM tree.

Version:
$Id: DOMHandler.java,v 1.2 2007/09/10 06:30:00 mikaelwing Exp $
Author:
Shohei Hido

Constructor Summary
DOMHandler()
           
 
Method Summary
static org.w3c.dom.Document getCapsuledDocument(org.w3c.dom.Node node)
          Adding a Node to a new instance of DOM Document.
static java.io.InputStream getCapsuledInputStream(org.w3c.dom.Node node)
          Adding a Node to a new instance of DOM Document and return document as input stream.
static java.io.InputStream getDocumentAsInputStream(org.w3c.dom.Node node)
          Get document as input stream.
static java.io.BufferedReader getDocumentAsReader(org.w3c.dom.Node node)
          Get document as buffered reader.
static org.w3c.dom.Document newInstance()
          Create a new instance of DOM Document.
static org.w3c.dom.Document newInstance(java.lang.String qualifiedName)
          Create a new instance of DOM Document.
static org.w3c.dom.Document parseXML(java.io.InputStream input)
          Parse XML-file.
static void writeXML(org.w3c.dom.Document doc, java.io.OutputStream output)
          Write XML-file.
static void writeXML(org.w3c.dom.Node node, java.io.OutputStream output)
          Write XML-file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMHandler

public DOMHandler()
Method Detail

parseXML

public static org.w3c.dom.Document parseXML(java.io.InputStream input)
Parse XML-file.

Parameters:
input - XML-file as InputStream
Returns:
DOM Document
Throws:
java.lang.RuntimeException - if error parsing XML

writeXML

public static void writeXML(org.w3c.dom.Document doc,
                            java.io.OutputStream output)
Write XML-file.

Parameters:
doc - DOM Document
output - XML-file as OutputStream

newInstance

public static org.w3c.dom.Document newInstance()
Create a new instance of DOM Document.

Returns:
DOM Document

newInstance

public static org.w3c.dom.Document newInstance(java.lang.String qualifiedName)
Create a new instance of DOM Document.

Parameters:
qualifiedName - of the DOM Document
Returns:
DOM Document

getCapsuledDocument

public static org.w3c.dom.Document getCapsuledDocument(org.w3c.dom.Node node)
Adding a Node to a new instance of DOM Document.

Parameters:
node -
Returns:
DOM Document

writeXML

public static void writeXML(org.w3c.dom.Node node,
                            java.io.OutputStream output)
Write XML-file.

Parameters:
node -
output - XML-file as OutputStream

getDocumentAsReader

public static java.io.BufferedReader getDocumentAsReader(org.w3c.dom.Node node)
Get document as buffered reader.

Parameters:
node -
Returns:
BufferedReader

getDocumentAsInputStream

public static java.io.InputStream getDocumentAsInputStream(org.w3c.dom.Node node)
Get document as input stream.

Parameters:
node -
Returns:
InputStream

getCapsuledInputStream

public static java.io.InputStream getCapsuledInputStream(org.w3c.dom.Node node)
Adding a Node to a new instance of DOM Document and return document as input stream.

Parameters:
node -
Returns:
InputStream


Copyright © 2002-2008 Cell/Biodinamics simulation project. All Rights Reserved.