com.quadrique.jbuildingblocks.core.application.parameters
Class JbbConfigurationParameters

java.lang.Object
  extended by com.quadrique.jbuildingblocks.core.application.parameters.JbbConfigurationParameters

public class JbbConfigurationParameters
extends Object

This class is used to retrieve the application configuration. The configuration is stored in an xml file (e.g. "server.xml") and provide to the application its configuration parameters

Version:
1.0.0
Author:
Hervé Rivere

Constructor Summary
JbbConfigurationParameters()
          Constructor
 
Method Summary
 String get(String zTag)
          Retrieve the value associated to the given tag
 String get(String zTag, String zAttribute)
          Retrieve the value associated to the given tag and attribute
 boolean getAsBool(String zTag, String zAttribute)
          Retrieve the value associated to the given tag and attribute
 int getAsInt(String zTag)
          Retrieve the value associated to the given tag and convert it to an int
 Document getDocument()
           
static JbbConfigurationParameters getInstance()
          This method returns an instance of the ConfigurationParameters class.
 void initialize(String zConfigFileName)
          Open the config file (if any)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JbbConfigurationParameters

public JbbConfigurationParameters()
Constructor

Method Detail

getInstance

public static final JbbConfigurationParameters getInstance()
This method returns an instance of the ConfigurationParameters class. If there has been already one instantiation, the same instance is returned so that it can be shared accross the application. A typical usage would be: ConfigurationParameters.getInstance().getXxxx() or ConfigurationParameters lConfig = ConfigurationParameters.getInstance();


initialize

public void initialize(String zConfigFileName)
                throws Exception
Open the config file (if any)

Parameters:
zConfigFileName - the full config file name
Throws:
Exception

get

public String get(String zTag)
           throws Exception
Retrieve the value associated to the given tag

Returns:
the value associated to this tag or an empty string
Throws:
Exception

getAsInt

public int getAsInt(String zTag)
             throws Exception
Retrieve the value associated to the given tag and convert it to an int

Returns:
the int value associated to this tag
Throws:
Exception

get

public String get(String zTag,
                  String zAttribute)
           throws Exception
Retrieve the value associated to the given tag and attribute

Returns:
the value associated to this tag/attribute or an empty string
Throws:
Exception

getAsBool

public boolean getAsBool(String zTag,
                         String zAttribute)
                  throws Exception
Retrieve the value associated to the given tag and attribute

Returns:
the boolean value associated to this tag/attribute
Throws:
Exception

getDocument

public Document getDocument()
Returns:
the document


Copyright © 2001-2008 Quadrique Corporation. All Rights Reserved.