org.qsos.transformation
Class XMLizer

java.lang.Object
  extended by org.qsos.transformation.XMLizer
All Implemented Interfaces:
IXMLizer

public class XMLizer
extends java.lang.Object
implements IXMLizer

The aim of this class is to do the conversion into a xml document of the java modelisation. In order to do the conversion, the library jdom is used.

Author:
Romain Pelisse , Arthur Clerfeuille

Constructor Summary
XMLizer()
           
 
Method Summary
 java.lang.String docToString(org.jdom.Document doc)
          This method converts a document (org.jdom.Document) into a String.
 org.jdom.Element transformAnIElement(IElement item)
          This method is a recursive method which allows to create all the xml node corresponding to the elemnt in the java representation.
 java.lang.String transformToXml(ISheet sheet)
          This method takes an ISheet, representing the xml file and convert it into a string which is the content of an xml file.
 void transformToXml(ISheet target, java.lang.String path)
          This method takes a Sheet and create the xml file given by the path
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLizer

public XMLizer()
Method Detail

transformToXml

public java.lang.String transformToXml(ISheet sheet)
This method takes an ISheet, representing the xml file and convert it into a string which is the content of an xml file.

Specified by:
transformToXml in interface IXMLizer
Parameters:
sheet - the sheet in the java modelisation.
Returns:
String the string representation of the xml.

transformToXml

public void transformToXml(ISheet target,
                           java.lang.String path)
This method takes a Sheet and create the xml file given by the path

Specified by:
transformToXml in interface IXMLizer
Parameters:
target - the sheet in the java modelisation.
path - the path of the file to create.

docToString

public java.lang.String docToString(org.jdom.Document doc)
This method converts a document (org.jdom.Document) into a String.

Specified by:
docToString in interface IXMLizer
Parameters:
doc - the document to convert.
Returns:
String the string representation of the doc.

transformAnIElement

public org.jdom.Element transformAnIElement(IElement item)
This method is a recursive method which allows to create all the xml node corresponding to the elemnt in the java representation. It returns the Element in the jdom representation.

Parameters:
item - the IElement to convert.
Returns:
Element the jdom Element corresponding.