SAP NetWeaver '04

com.sapportals.wcm.crt.configuration
Class DefaultConfiguration

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

public class DefaultConfiguration
extends AbstractConfiguration

This is the default implementation of a configuration node.

Copyright (c) SAP AG 2001-2002

Copyright (c) SAP AG 2001-2002


Field Summary
protected static java.lang.String[] NO_ATTRIBUTES
           
protected static IConfiguration[] NO_CHILDREN
           
 
Constructor Summary
DefaultConfiguration(java.lang.String name)
          Creates a new instance.
DefaultConfiguration(java.lang.String name, java.lang.String location)
          Creates a new instance.
DefaultConfiguration(java.lang.String name, java.lang.String location, java.util.HashMap attributes)
          Deprecated. as of NW04. Use DefaultConfiguration(final String name, final String location, Map attributes) instead.
DefaultConfiguration(java.lang.String name, java.lang.String location, java.util.Map attributes)
           
DefaultConfiguration(java.lang.String name, java.lang.String location, java.lang.String namespace, java.lang.String prefix)
          Creates a new instance.
 
Method Summary
 void addChild(IConfiguration childConfiguration)
          Adds a child configuration node to this node.
protected  void checkWriteable()
           
protected  java.lang.StringBuffer dump(java.lang.StringBuffer buffer, int in)
           
 java.lang.String getAttribute(java.lang.String name)
          Returns the string value of the specified attribute.
 java.lang.String[] getAttributeNames()
          Returns an array of all attribute names.
 IConfiguration getChild(java.lang.String name, boolean createNew)
          Returns the specified child node.
 int getChildCount()
          Returns the number of child nodes.
 IConfiguration[] getChildren()
          Returns an array of all child nodes.
 IConfiguration[] getChildren(java.lang.String name)
          Returns an array of all child nodes with the specified name.
 java.lang.String getLocation()
          Returns a string describing the location of the configuration data.
 java.lang.String getName()
          Returns the name of the node (not null ).
 java.lang.String getNamespace()
          Returns the namespace this configuration node belongs to.
protected  java.lang.String getPrefix()
          Returns the prefix of the namespace.
 java.lang.String getValue()
          Returns the string value of this node.
 void makeReadOnly()
          Sets the read-only flag for this node.
 void removeChild(IConfiguration childConfiguration)
          Removes the child configuration node from this node.
 void setAttribute(java.lang.String name, java.lang.String value)
           
 void setValue(java.lang.String value)
           
 java.lang.String toString()
           
 
Methods inherited from class com.sapportals.wcm.crt.configuration.AbstractConfiguration
getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsFloat, getAttributeAsFloat, getAttributeAsInteger, getAttributeAsInteger, getAttributeAsLong, getAttributeAsLong, getChild, getValue, getValueAsBoolean, getValueAsBoolean, getValueAsFloat, getValueAsFloat, getValueAsInteger, getValueAsInteger, getValueAsLong, getValueAsLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_CHILDREN

protected static final IConfiguration[] NO_CHILDREN

NO_ATTRIBUTES

protected static final java.lang.String[] NO_ATTRIBUTES
Constructor Detail

DefaultConfiguration

public DefaultConfiguration(java.lang.String name)
Creates a new instance.
Parameters:
name - The name of the configuration node.

DefaultConfiguration

public DefaultConfiguration(java.lang.String name,
                            java.lang.String location,
                            java.util.Map attributes)

DefaultConfiguration

public DefaultConfiguration(java.lang.String name,
                            java.lang.String location,
                            java.util.HashMap attributes)
Deprecated. as of NW04. Use DefaultConfiguration(final String name, final String location, Map attributes) instead.


DefaultConfiguration

public DefaultConfiguration(java.lang.String name,
                            java.lang.String location)
Creates a new instance.
Parameters:
name - The name of the configuration node.
location - A client specific location string, examples: line number (for file-based persistence), identifier, URI, database table, ...

DefaultConfiguration

public DefaultConfiguration(java.lang.String name,
                            java.lang.String location,
                            java.lang.String namespace,
                            java.lang.String prefix)
Creates a new instance.
Parameters:
name - The name of the configuration node.
location - A client specific location string, examples: line number (for file-based persistence), identifier, URI, database table, ...
namespace - A namespace string
prefix -  
Method Detail

getName

public java.lang.String getName()
Description copied from interface: IConfiguration
Returns the name of the node (not null ).
Following copied from interface: com.sapportals.wcm.crt.configuration.IConfiguration
Returns:
the name of the node (not null ).

getNamespace

public java.lang.String getNamespace()
                              throws ConfigurationException
Description copied from interface: IConfiguration
Returns the namespace this configuration node belongs to.
Following copied from interface: com.sapportals.wcm.crt.configuration.IConfiguration
Returns:
the namespace this configuration node belongs to.
Throws:
ConfigurationException - Exception raised in failure situation

getLocation

public java.lang.String getLocation()
Description copied from interface: IConfiguration
Returns a string describing the location of the configuration data. This string is client specific, examples: line number (for file-based persistence), identifier, URI, database table, ...
Following copied from interface: com.sapportals.wcm.crt.configuration.IConfiguration
Returns:
location

getValue

public java.lang.String getValue()
                          throws ConfigurationException
Description copied from interface: IConfiguration
Returns the string value of this node.
Following copied from interface: com.sapportals.wcm.crt.configuration.IConfiguration
Returns:
the string value of this node.
Throws:
ConfigurationException -  

getAttributeNames

public java.lang.String[] getAttributeNames()
Description copied from interface: IConfiguration
Returns an array of all attribute names. The order of attributes is the array is undefinded.
Following copied from interface: com.sapportals.wcm.crt.configuration.IConfiguration
Returns:
an array of all attribute names.

getChildren

public IConfiguration[] getChildren()
Description copied from interface: IConfiguration
Returns an array of all child nodes. If the node has no children the array is empty.
Following copied from interface: com.sapportals.wcm.crt.configuration.IConfiguration
Returns:
an array of all child nodes.

getAttribute

public java.lang.String getAttribute(java.lang.String name)
                              throws ConfigurationException
Description copied from interface: IConfiguration
Returns the string value of the specified attribute.
Following copied from interface: com.sapportals.wcm.crt.configuration.IConfiguration
Parameters:
name - The name of the attribute.
Returns:
the string value of the specified attribute.
Throws:
ConfigurationException - If the attribute does not exist.

getChild

public IConfiguration getChild(java.lang.String name,
                               boolean createNew)
Description copied from interface: IConfiguration
Returns the specified child node.

Following copied from interface: com.sapportals.wcm.crt.configuration.IConfiguration
Parameters:
child - The name of the child node.
createNew - If true , an empty IConfiguration node will be created and returned if the specified child does not exist. If false , null will be returned if the specified child doesn't exist.
Returns:
<{IConfiguration}>

getChildren

public IConfiguration[] getChildren(java.lang.String name)
Description copied from interface: IConfiguration
Returns an array of all child nodes with the specified name. If the node has no children with the specified name the array is empty.
Following copied from interface: com.sapportals.wcm.crt.configuration.IConfiguration
Parameters:
name - TBD: Description of the incoming method parameter
Returns:
an array of all child nodes.

setValue

public void setValue(java.lang.String value)

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)

addChild

public void addChild(IConfiguration childConfiguration)
Adds a child configuration node to this node.
Parameters:
childConfiguration - child to be added

removeChild

public void removeChild(IConfiguration childConfiguration)
Removes the child configuration node from this node.
Parameters:
childConfiguration - The child node to remove.

getChildCount

public int getChildCount()
Returns the number of child nodes.
Returns:
the number of child nodes.

makeReadOnly

public void makeReadOnly()
Sets the read-only flag for this node. The add/remove methods will throw an IllegalStateException.

dump

protected java.lang.StringBuffer dump(java.lang.StringBuffer buffer,
                                      int in)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPrefix

protected java.lang.String getPrefix()
                              throws ConfigurationException
Description copied from class: AbstractConfiguration
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.
Overrides:
getPrefix in class AbstractConfiguration
Following copied from class: com.sapportals.wcm.crt.configuration.AbstractConfiguration
Returns:
A non-null String (defaults to "")
Throws:
ConfigurationException - if no prefix was defined (prefix is null .

checkWriteable

protected final void checkWriteable()
                             throws java.lang.IllegalStateException

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.