SAP NetWeaver '04

com.sapportals.wcm.crt.configuration
Class AbstractConfiguration

[contained in: com.sap.netweaver.bc.crt.par - bc.crt_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.crt.configuration.AbstractConfiguration
All Implemented Interfaces:
IConfiguration
Direct Known Subclasses:
DefaultConfiguration

public abstract class AbstractConfiguration
extends java.lang.Object
implements IConfiguration

This is an abstract IConfiguration implementation that deals with methods that can be abstracted away from underlying implementations.

Copyright (c) SAP AG 2001-2002


Constructor Summary
AbstractConfiguration()
           
 
Method Summary
 java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue)
          Returns the value of the attribute specified by its name as a String .
 boolean getAttributeAsBoolean(java.lang.String name)
          Returns the value of the attribute specified by its name as a boolean .
 boolean getAttributeAsBoolean(java.lang.String name, boolean defaultValue)
          Returns the value of the attribute specified by its name as a boolean .
 float getAttributeAsFloat(java.lang.String name)
          Returns the value of the attribute specified by its name as a float .
 float getAttributeAsFloat(java.lang.String name, float defaultValue)
          Returns the value of the attribute specified by its name as a float .
 int getAttributeAsInteger(java.lang.String name)
          Returns the value of the attribute specified by its name as an int .
 int getAttributeAsInteger(java.lang.String name, int defaultValue)
          Returns the value of the attribute specified by its name as an int .
 long getAttributeAsLong(java.lang.String name)
          Returns the value of the attribute specified by its name as a long .
 long getAttributeAsLong(java.lang.String name, long defaultValue)
          Returns the value of the attribute specified by its name as a long .
 IConfiguration getChild(java.lang.String name)
          Return the first Configuration object child of this associated with the given name.
protected abstract  java.lang.String getPrefix()
          Returns the prefix of the namespace.
 java.lang.String getValue(java.lang.String defaultValue)
          Returns the value of the configuration element as a String .
 boolean getValueAsBoolean()
          Returns the value of the configuration element as a boolean .
 boolean getValueAsBoolean(boolean defaultValue)
          Returns the value of the configuration element as a boolean .
 float getValueAsFloat()
          Returns the value of the configuration element as a float .
 float getValueAsFloat(float defaultValue)
          Returns the value of the configuration element as a float .
 int getValueAsInteger()
          Returns the value of the configuration element as an int .
 int getValueAsInteger(int defaultValue)
          Returns the value of the configuration element as an int .
 long getValueAsLong()
          Returns the value of the configuration element as a long .
 long getValueAsLong(long defaultValue)
          Returns the value of the configuration element as a long .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sapportals.wcm.crt.configuration.IConfiguration
getAttribute, getAttributeNames, getChild, getChildren, getChildren, getLocation, getName, getNamespace, getValue
 

Constructor Detail

AbstractConfiguration

public AbstractConfiguration()
Method Detail

getPrefix

protected abstract java.lang.String getPrefix()
                                       throws ConfigurationException
Returns the prefix of the namespace. This is only used as a serialization hint, therefore is not part of the client API. It should be included in all Configuration implementations though.
Returns:
A non-null String (defaults to "")
Throws:
ConfigurationException - if no prefix was defined (prefix is null .

getValueAsInteger

public int getValueAsInteger()
                      throws ConfigurationException
Returns the value of the configuration element as an int . Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary numbers begin with 0b, all other values are assumed to be decimal.
Specified by:
getValueAsInteger in interface IConfiguration
Returns:
the value
Throws:
ConfigurationException - if an error occurs

getValueAsInteger

public int getValueAsInteger(int defaultValue)
Returns the value of the configuration element as an int . Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary numbers begin with 0b, all other values are assumed to be decimal.
Specified by:
getValueAsInteger in interface IConfiguration
Parameters:
defaultValue - the default value to return if value malformed or empty
Returns:
the value

getValueAsLong

public long getValueAsLong()
                    throws ConfigurationException
Returns the value of the configuration element as a long . Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary numbers begin with 0b, all other values are assumed to be decimal.
Specified by:
getValueAsLong in interface IConfiguration
Returns:
the value
Throws:
ConfigurationException - if an error occurs

getValueAsLong

public long getValueAsLong(long defaultValue)
Returns the value of the configuration element as a long . Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary numbers begin with 0b, all other values are assumed to be decimal.
Specified by:
getValueAsLong in interface IConfiguration
Parameters:
defaultValue - the default value to return if value malformed or empty
Returns:
the value

getValueAsFloat

public float getValueAsFloat()
                      throws ConfigurationException
Returns the value of the configuration element as a float .
Specified by:
getValueAsFloat in interface IConfiguration
Returns:
the value
Throws:
ConfigurationException - if an error occurs

getValueAsFloat

public float getValueAsFloat(float defaultValue)
Returns the value of the configuration element as a float .
Specified by:
getValueAsFloat in interface IConfiguration
Parameters:
defaultValue - the default value to return if value malformed or empty
Returns:
the value

getValueAsBoolean

public boolean getValueAsBoolean()
                          throws ConfigurationException
Returns the value of the configuration element as a boolean .
Specified by:
getValueAsBoolean in interface IConfiguration
Returns:
the value
Throws:
ConfigurationException - if an error occurs

getValueAsBoolean

public boolean getValueAsBoolean(boolean defaultValue)
Returns the value of the configuration element as a boolean .
Specified by:
getValueAsBoolean in interface IConfiguration
Parameters:
defaultValue - the default value to return if value malformed or empty
Returns:
the value

getValue

public java.lang.String getValue(java.lang.String defaultValue)
Returns the value of the configuration element as a String .
Specified by:
getValue in interface IConfiguration
Parameters:
defaultValue - the default value to return if value malformed or empty
Returns:
the value

getAttributeAsInteger

public int getAttributeAsInteger(java.lang.String name)
                          throws ConfigurationException
Returns the value of the attribute specified by its name as an int . Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary numbers begin with 0b, all other values are assumed to be decimal.
Specified by:
getAttributeAsInteger in interface IConfiguration
Parameters:
name - the name of the attribute
Returns:
the value
Throws:
ConfigurationException - if an error occurs

getAttributeAsInteger

public int getAttributeAsInteger(java.lang.String name,
                                 int defaultValue)
Returns the value of the attribute specified by its name as an int . Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary numbers begin with 0b, all other values are assumed to be decimal.
Specified by:
getAttributeAsInteger in interface IConfiguration
Parameters:
name - the name of the attribute
defaultValue - the default value to return if value malformed or empty
Returns:
the value

getAttributeAsLong

public long getAttributeAsLong(java.lang.String name)
                        throws ConfigurationException
Returns the value of the attribute specified by its name as a long . Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary numbers begin with 0b, all other values are assumed to be decimal.
Specified by:
getAttributeAsLong in interface IConfiguration
Parameters:
name - the name of the attribute
Returns:
the value
Throws:
ConfigurationException - if an error occurs

getAttributeAsLong

public long getAttributeAsLong(java.lang.String name,
                               long defaultValue)
Returns the value of the attribute specified by its name as a long . Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary numbers begin with 0b, all other values are assumed to be decimal.
Specified by:
getAttributeAsLong in interface IConfiguration
Parameters:
name - the name of the attribute
defaultValue - the default value to return if value malformed or empty
Returns:
the value

getAttributeAsFloat

public float getAttributeAsFloat(java.lang.String name)
                          throws ConfigurationException
Returns the value of the attribute specified by its name as a float .
Specified by:
getAttributeAsFloat in interface IConfiguration
Parameters:
name - the name of the attribute
Returns:
the value
Throws:
ConfigurationException - if an error occurs

getAttributeAsFloat

public float getAttributeAsFloat(java.lang.String name,
                                 float defaultValue)
Returns the value of the attribute specified by its name as a float .
Specified by:
getAttributeAsFloat in interface IConfiguration
Parameters:
name - the name of the attribute
defaultValue - the default value to return if value malformed or empty
Returns:
the value

getAttributeAsBoolean

public boolean getAttributeAsBoolean(java.lang.String name)
                              throws ConfigurationException
Returns the value of the attribute specified by its name as a boolean .
Specified by:
getAttributeAsBoolean in interface IConfiguration
Parameters:
name - the name of the attribute
Returns:
the value
Throws:
ConfigurationException - if an error occurs

getAttributeAsBoolean

public boolean getAttributeAsBoolean(java.lang.String name,
                                     boolean defaultValue)
Returns the value of the attribute specified by its name as a boolean .
Specified by:
getAttributeAsBoolean in interface IConfiguration
Parameters:
name - the name of the attribute
defaultValue - the default value to return if value malformed or empty
Returns:
the value

getAttribute

public java.lang.String getAttribute(java.lang.String name,
                                     java.lang.String defaultValue)
Returns the value of the attribute specified by its name as a String .
Specified by:
getAttribute in interface IConfiguration
Parameters:
name - the name of the attribute
defaultValue - the default value to return if value malformed or empty
Returns:
the value

getChild

public IConfiguration getChild(java.lang.String name)
Return the first Configuration object child of this associated with the given name.
Specified by:
getChild in interface IConfiguration
Parameters:
name - the name of the child
Returns:
the child Configuration

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.