org.alltimeflashdreamer.filelister.xml
Class FileListerXMLHandler

java.lang.Object
  extended byorg.apache.xerces.parsers.XMLParser
      extended byorg.apache.xerces.parsers.AbstractXMLDocumentParser
          extended byorg.apache.xerces.parsers.AbstractDOMParser
              extended byorg.apache.xerces.parsers.DOMParser
                  extended byorg.alltimeflashdreamer.util.xml.XMLDataHandler
                      extended byorg.alltimeflashdreamer.filelister.xml.FileListerXMLHandler
All Implemented Interfaces:
org.apache.xerces.xni.XMLDocumentHandler, org.apache.xerces.xni.XMLDTDContentModelHandler, org.apache.xerces.xni.XMLDTDHandler

public class FileListerXMLHandler
extends org.alltimeflashdreamer.util.xml.XMLDataHandler

Title: FileListerXMLHandler

Description: This is the parser and writer class for reading and writing the FileLister configuration XML file.

Organization: All Time Flash Dreamer

Version:
0.5.1
Author:
Copyright (c) 2002-2004 by Florian Steinsiepe

Field Summary
static String CONFIGFILE
          name of FileLister's configuration file
 
Fields inherited from class org.alltimeflashdreamer.util.xml.XMLDataHandler
ISVALIDATING, USECATALOGRESOLVER
 
Fields inherited from class org.apache.xerces.parsers.DOMParser
SYMBOL_TABLE, XMLGRAMMAR_POOL
 
Fields inherited from class org.apache.xerces.parsers.AbstractDOMParser
CORE_DOCUMENT_CLASS_NAME, CREATE_CDATA_NODES_FEATURE, CREATE_ENTITY_REF_NODES, CURRENT_ELEMENT_NODE, DEFAULT_DOCUMENT_CLASS_NAME, DEFER_NODE_EXPANSION, DOCUMENT_CLASS_NAME, fBaseURIStack, fCreateCDATANodes, fCreateEntityRefNodes, fCurrentCDATASection, fCurrentCDATASectionIndex, fCurrentEntityDecl, fCurrentNode, fCurrentNodeIndex, fDeferNodeExpansion, fDeferredDocumentImpl, fDeferredEntityDecl, fDocument, fDocumentClassName, fDocumentImpl, fDocumentIndex, fDocumentType, fDocumentTypeIndex, fDOMFilter, fErrorHandler, fFilterReject, fFirstChunk, fInCDATASection, fIncludeComments, fIncludeIgnorableWhitespace, fInDocument, fInDTD, fInDTDExternalSubset, fInternalSubset, fNamespaceAware, fRejectedElement, fSkippedElemStack, fStorePSVI, fStringBuffer, INCLUDE_COMMENTS_FEATURE, INCLUDE_IGNORABLE_WHITESPACE, NAMESPACES, PSVI_DOCUMENT_CLASS_NAME
 
Fields inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser
fDocumentSource, fDTDContentModelSource, fDTDSource
 
Fields inherited from class org.apache.xerces.parsers.XMLParser
ENTITY_RESOLVER, ERROR_HANDLER, fConfiguration
 
Fields inherited from interface org.apache.xerces.xni.XMLDTDHandler
CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE
 
Fields inherited from interface org.apache.xerces.xni.XMLDTDContentModelHandler
OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCE
 
Constructor Summary
FileListerXMLHandler(File xmlFile, boolean bLoadDefaults)
          Calls the superclass' constructor and initializes the internal objects JDBC, directory, index, system, link and zip, each representing one of the major sections in the xml file and being fully configured with the values of its section.
 
Method Summary
 Object[][] getData()
          Returns a list of key/value pairs, ordered as follows: jdbc, directory, system, index, link, zip.
 String[] getDescriptions()
          Returns a list of description texts (same order as the getData elements).
 Directory getDirectory()
          Returns the directory element within the config file.
 Index getIndex()
          Returns the index element within the config file.
 JDBC getJDBC()
          Returns the jdbc element within the config file.
 Link getLink()
          Returns the link element within the config file.
 System getSystem()
          Returns the system element within the config file.
 Zip getZip()
          Returns the zip element within the config file.
 void save(FileListerTableModel model)
          Reads all the values of the given model and updates the DOM.
 
Methods inherited from class org.alltimeflashdreamer.util.xml.XMLDataHandler
cloneDocument, getAttributeValue, getChildNode, getFile, getFirstChildElement, getFirstChildNode, getFirstLevelNodes, getFirstText, getFirstTextString, getNodeByName, getNodeNames, getNodeNames, getRootNode, getUniqueElement, isFileChanged, reload, removeCatalog, write, write, write, write, write
 
Methods inherited from class org.apache.xerces.parsers.DOMParser
getEntityResolver, getErrorHandler, getFeature, getProperty, parse, parse, setEntityResolver, setErrorHandler, setFeature, setProperty
 
Methods inherited from class org.apache.xerces.parsers.AbstractDOMParser
abort, attributeDecl, characters, comment, createAttrNode, createElementNode, doctypeDecl, elementDecl, emptyElement, endAttlist, endCDATA, endConditional, endDocument, endDTD, endElement, endExternalSubset, endGeneralEntity, endParameterEntity, externalEntityDecl, getDocument, getDocumentClassName, handleBaseURI, handleBaseURI, ignorableWhitespace, ignoredCharacters, internalEntityDecl, notationDecl, processingInstruction, reset, setCharacterData, setDocumentClassName, setLocale, startAttlist, startCDATA, startConditional, startDocument, startDTD, startElement, startExternalSubset, startGeneralEntity, startParameterEntity, textDecl, unparsedEntityDecl, xmlDecl
 
Methods inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser
any, element, empty, endContentModel, endGroup, getDocumentSource, getDTDContentModelSource, getDTDSource, occurrence, pcdata, separator, setDocumentSource, setDTDContentModelSource, setDTDSource, startContentModel, startGroup
 
Methods inherited from class org.apache.xerces.parsers.XMLParser
parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIGFILE

public static final String CONFIGFILE
name of FileLister's configuration file

See Also:
Constant Field Values
Constructor Detail

FileListerXMLHandler

public FileListerXMLHandler(File xmlFile,
                            boolean bLoadDefaults)
                     throws IOException,
                            SAXException
Calls the superclass' constructor and initializes the internal objects JDBC, directory, index, system, link and zip, each representing one of the major sections in the xml file and being fully configured with the values of its section.

Parameters:
xmlFile - the file to be parsed
bLoadDefaults - whether to load the default values or not
Throws:
IOException - thrown on file access
SAXException - thrown on parsing of the config file
Method Detail

getData

public Object[][] getData()
Returns a list of key/value pairs, ordered as follows: jdbc, directory, system, index, link, zip. The order within the list elements is defined by the order in the config file.

Returns:
a two-dimensional array of config element names and values

getDescriptions

public String[] getDescriptions()
Returns a list of description texts (same order as the getData elements).

Returns:
the description list

save

public void save(FileListerTableModel model)
          throws IOException,
                 FileListerException
Reads all the values of the given model and updates the DOM. After this, a new instance of PropertyFileParameters is created to verify the new contents of the DOM. If the check is successful, the whole XML document is written down to the file from which it was parsed. If during this updating of the DOM, the checking of the parameters or the writing of the DOM fails, the upcoming exception is thrown.

Parameters:
model - the model containing the modified data
Throws:
IOException - if the writing failed somehow
FileListerException - if a change in the configuration isn't allowed

getJDBC

public JDBC getJDBC()
Returns the jdbc element within the config file.

Returns:
the class representing the jdbc element/tag

getDirectory

public Directory getDirectory()
Returns the directory element within the config file.

Returns:
the class representing the directory element/tag

getIndex

public Index getIndex()
Returns the index element within the config file.

Returns:
the class representing the index element/tag

getSystem

public System getSystem()
Returns the system element within the config file.

Returns:
the class representing the system element/tag

getLink

public Link getLink()
Returns the link element within the config file.

Returns:
the class representing the link element/tag

getZip

public Zip getZip()
Returns the zip element within the config file.

Returns:
the class representing the zip element/tag