com.mmoui.manager.services
Interface ConfigurationReader


public interface ConfigurationReader

An interface through which modules can read back their XML configuration data. This interface is defined in a manner similar to SAX ContentHandler objects (as a SAX reader will be calling these entities).

A valid Bundle configuration file always has the following form:

   <Bundle name="%BUNDLE_NAME%">
     %CONFIGURATION_BLOCK%
   </Bundle>
 
Failure to follow this format or failure to follow the restrictions indicated may result in the bundle's configuration being lost. Parse errors which are the result of a module are corrected by removing the module's XML data.

Version:
$Id: ConfigurationReader.java 200 2009-05-11 06:45:38Z mpdelbuono $
Author:
Matthew P. Del Buono
See Also:
org.xml.sax.ContentHandler

Method Summary
 void endElement(java.lang.String element)
          Indicates that an element has ended.
 void processData(char[] data)
          Indicates that data is available in the current element.
 void startElement(java.lang.String element, java.util.Map<java.lang.String,java.lang.String> attributes)
          Indicates that a new element has started with the specified name and optional attributes
 

Method Detail

startElement

void startElement(java.lang.String element,
                  java.util.Map<java.lang.String,java.lang.String> attributes)
                  throws java.io.IOException
Indicates that a new element has started with the specified name and optional attributes

Parameters:
element - The name of the element that is starting
attributes - A list of attributes, mapped from their name to their value, specified during the element start tag
Throws:
java.io.IOException - If a parsing error occurs

endElement

void endElement(java.lang.String element)
                throws java.io.IOException
Indicates that an element has ended. If this is a Bundle element, this indicates the last tag that this reader will receive. If any information was not received, the bundle should attempt to load defaults if it has not already. If this was received immediately after the Bundle start tag, it may indicate that the configuration data for this bundle was discarded due to errors (and thus the bundle should attempt to load defaults).

Parameters:
element - The name of the element that ended
Throws:
java.io.IOException - If a parsing error occurs

processData

void processData(char[] data)
                 throws java.io.IOException

Indicates that data is available in the current element. It cannot be guaranteed that all of the data will arrive all at once for an element -- consecutive calls to processData indicate data which should be concatenated together. Likewise, it cannot be guaranteed that data will always arrive one character at a time, even if it tends to do so.

Ignorable whitespace (per the XML specification) may or may not be reported by this method. This behavior is dependent upon the backend parser being used, which will be user- and implementation- dependent.

Parameters:
data - The block of available data
Throws:
java.io.IOException - If a parsing error occurs