org.rimudb.configuration
Class TableDescriptorLoader

java.lang.Object
  extended by org.rimudb.configuration.TableDescriptorLoader

public class TableDescriptorLoader
extends java.lang.Object

This class is responsible for loading and saving the TableDescritor XML documents. The method loadFromFile(File file) is used to load the document from a file. The method saveToFile(Document document, File file) is used to save a document to a file. The method convertToDescriptorModel(Document document) is used to convert a Document to a DescriptorModel. The method convertToDocument(DescriptorModel descriptorModel) is used convert a DescriptorModel to a Document. DescriptorModels are used internally by the editor.

Author:
Simon Ritchie

Constructor Summary
TableDescriptorLoader()
           
 
Method Summary
 DescriptorModel convertToDescriptorModel(org.w3c.dom.Document document)
          Create a DescriptorModel from the Document.
 org.w3c.dom.Document convertToDocument(DescriptorModel descriptorModel)
          Create a Document from the DescriptorModel
 TableMetaData convertToTableMetaData(org.w3c.dom.Document document)
          Create a TableMetaData from the Document.
 org.w3c.dom.Document loadFromFile(java.io.File file, boolean validate)
           
 org.w3c.dom.Document loadFromResource(java.lang.String rootFilename, java.lang.String packageFilename, boolean validate)
           
 void saveToFile(org.w3c.dom.Document document, java.io.File file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableDescriptorLoader

public TableDescriptorLoader()
Method Detail

convertToDescriptorModel

public DescriptorModel convertToDescriptorModel(org.w3c.dom.Document document)
Create a DescriptorModel from the Document.

Parameters:
document - Document
Returns:
DescriptorModel

convertToTableMetaData

public TableMetaData convertToTableMetaData(org.w3c.dom.Document document)
Create a TableMetaData from the Document.

Parameters:
document - Document
Returns:
DescriptorModel

convertToDocument

public org.w3c.dom.Document convertToDocument(DescriptorModel descriptorModel)
                                       throws java.net.MalformedURLException,
                                              org.xml.sax.SAXException,
                                              javax.xml.parsers.ParserConfigurationException
Create a Document from the DescriptorModel

Parameters:
descriptorModel - DescriptorModel
Returns:
Document
Throws:
java.net.MalformedURLException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

saveToFile

public void saveToFile(org.w3c.dom.Document document,
                       java.io.File file)
                throws javax.xml.transform.TransformerFactoryConfigurationError,
                       java.io.IOException,
                       javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerFactoryConfigurationError
java.io.IOException
javax.xml.transform.TransformerException

loadFromFile

public org.w3c.dom.Document loadFromFile(java.io.File file,
                                         boolean validate)
                                  throws javax.xml.parsers.ParserConfigurationException,
                                         org.xml.sax.SAXException,
                                         java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

loadFromResource

public org.w3c.dom.Document loadFromResource(java.lang.String rootFilename,
                                             java.lang.String packageFilename,
                                             boolean validate)
                                      throws RimuDBException
Throws:
RimuDBException


Copyright © 2008-2011 Simon Ritchie. All Rights Reserved.