org.freehep.xml.io
Class XMLIOStreamManager

java.lang.Object
  extended by org.freehep.xml.io.XMLIOStreamManager
Direct Known Subclasses:
XMLIOFileManager

public class XMLIOStreamManager
extends Object

Class XMLIOStreamManager deals with xml files.

Version:
1.0
Author:
turri

Constructor Summary
XMLIOStreamManager()
          The main constructor
XMLIOStreamManager(InputStream xmlInputStream, OutputStream xmlOutputStream)
          The main constructor
 
Method Summary
 org.jdom.input.SAXBuilder getBuilder()
           
 org.jdom.Element getRootElement()
          From the input Stream convert the text in xml format and return the main root Element
 void saveRootElement(org.jdom.Element rootEl)
          Write to the output Stream performing an xml to text conversion
 void saveRootElement(org.jdom.Element rootEl, org.jdom.DocType docType)
           
 void setXMLInputStream(InputStream xmlInputStream)
          Set the input Stream
 void setXMLInputStream(InputStream xmlInputStream, String systemId)
           
 void setXMLOutputStream(OutputStream xmlOutputStream)
          Set the output Stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLIOStreamManager

public XMLIOStreamManager()
The main constructor


XMLIOStreamManager

public XMLIOStreamManager(InputStream xmlInputStream,
                          OutputStream xmlOutputStream)
The main constructor

Parameters:
xmlInputStream - the input Stream
xmlOutputStream - the output Stream
Method Detail

getBuilder

public org.jdom.input.SAXBuilder getBuilder()

setXMLInputStream

public void setXMLInputStream(InputStream xmlInputStream)
Set the input Stream

Parameters:
xmlInputStream - the input Stream

setXMLInputStream

public void setXMLInputStream(InputStream xmlInputStream,
                              String systemId)

setXMLOutputStream

public void setXMLOutputStream(OutputStream xmlOutputStream)
Set the output Stream

Parameters:
xmlOutputStream - the output Stream

getRootElement

public org.jdom.Element getRootElement()
                                throws org.jdom.JDOMException,
                                       IOException
From the input Stream convert the text in xml format and return the main root Element

Returns:
the jdom main Element
Throws:
org.jdom.JDOMException - from the build method of SAXBuilder
IOMException - for the specific implementations of InputStream
IOException
See Also:
SAXBuilder.build( InputStream )

saveRootElement

public void saveRootElement(org.jdom.Element rootEl)
                     throws IOException
Write to the output Stream performing an xml to text conversion

Parameters:
rootEl - is the root Element that gets converted to text and dumped in the output file.
Throws:
IOException - from the output method of XMLOutputter
See Also:
XMLOutputter.output( Document, OutputStream )

saveRootElement

public void saveRootElement(org.jdom.Element rootEl,
                            org.jdom.DocType docType)
                     throws IOException
Throws:
IOException


Copyright © 2000-2007 FreeHEP. All Rights Reserved.