se.kmr.scam.client.http.util
Class PreferenceConfigParser

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byse.kmr.scam.client.http.util.PreferenceConfigParser
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class PreferenceConfigParser
extends DefaultHandler

Application preferences configuration parser. Example of preference configuration XML contents:


  <preferences class="se.foo.fie.fum.PreferenceBean" beanName="applPrefBean">

    <!-- Standard preference parameters -->
    <init-param name="locale" value="sv"/>
    <init-param name="resultPageLength" value="10"/>
    <init-param name="progSortOrder" value="ascending"/>

    <!-- Application specific preference parameters -->
    <init-param name="foo" value="fooValue"/>

  </preferences>
 

Version:
$Revision: 1.4 $
Author:
GH/Ateles Consulting AB
Created:
2002-07-24

Constructor Summary
PreferenceConfigParser()
           
 
Method Summary
 String getPreferencesBeanName()
          Gets current preferences bean name for application scope attribute.
 String getPreferencesClass()
          Gets current preferences object class.
 Hashtable getPreferencesMap()
          Gets current preferences map.
 void parse(InputStream is)
          Parse the given input stream.
 void parse(String filename)
          Parses the given XML-file.
 void startElement(String namespaceURI, String localName, String qName, Attributes atts)
          Receives notifiacation of the start of an element.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferenceConfigParser

public PreferenceConfigParser()
Method Detail

parse

public void parse(String filename)
Parses the given XML-file.

Parameters:
filename -

parse

public void parse(InputStream is)
Parse the given input stream.

Parameters:
is - Parse this stream.

getPreferencesClass

public String getPreferencesClass()
Gets current preferences object class.

Returns:
The class of the bean to create.

getPreferencesBeanName

public String getPreferencesBeanName()
Gets current preferences bean name for application scope attribute.

Returns:
The bean instance attribute name.

getPreferencesMap

public Hashtable getPreferencesMap()
Gets current preferences map.

Returns:
Preference name/value map

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Receives notifiacation of the start of an element.

Parameters:
localName - - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - - The qualified name (with prefix), or the empty string if qualified names are not available.
atts - - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
SAXException


Copyright © 2003 SCAM. All Rights Reserved.