com.sapportals.wcm.crt.configuration

Class DefaultConfiguration

java.lang.Object
  extended bycom.sapportals.wcm.crt.configuration.AbstractConfiguration
      extended bycom.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 String[] NO_ATTRIBUTES
           
protected static IConfiguration[] NO_CHILDREN
           
 
Constructor Summary
DefaultConfiguration(String name)
          Creates a new instance.
DefaultConfiguration(String name, String location)
          Creates a new instance.
DefaultConfiguration(String name, String location, HashMap attributes)
          Deprecated. as of NW04. Use DefaultConfiguration(final String name, final String location, Map attributes) instead.
DefaultConfiguration(String name, String location, Map attributes)
           
DefaultConfiguration(String name, String location, String namespace, String prefix)
          Creates a new instance.
 
Method Summary
 void addChild(IConfiguration childConfiguration)
          Adds a child configuration node to this node.
protected  void checkWriteable()
           
protected  StringBuffer dump(StringBuffer buffer, int in)
           
 String getAttribute(String name)
          Returns the string value of the specified attribute.
 String[] getAttributeNames()
          Returns an array of all attribute names.
 IConfiguration getChild(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(String name)
          Returns an array of all child nodes with the specified name.
 String getLocation()
          Returns a string describing the location of the configuration data.
 String getName()
          Returns the name of the node (not null ).
 String getNamespace()
          Returns the namespace this configuration node belongs to.
protected  String getPrefix()
          Returns the prefix of the namespace.
 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(String name, String value)
           
 void setValue(String value)
           
 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 String[] NO_ATTRIBUTES
Constructor Detail

DefaultConfiguration

public DefaultConfiguration(String name)
Creates a new instance.

Parameters:
name - The name of the configuration node.

DefaultConfiguration

public DefaultConfiguration(String name,
                            String location,
                            Map attributes)

DefaultConfiguration

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


DefaultConfiguration

public DefaultConfiguration(String name,
                            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(String name,
                            String location,
                            String namespace,
                            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 String getName()
Description copied from interface: IConfiguration
Returns the name of the node (not null ).

Returns:
the name of the node (not null ).

getNamespace

public String getNamespace()
                    throws ConfigurationException
Description copied from interface: IConfiguration
Returns the namespace this configuration node belongs to.

Returns:
the namespace this configuration node belongs to.
Throws:
ConfigurationException - Exception raised in failure situation

getLocation

public 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, ...

Returns:
location

getValue

public String getValue()
                throws ConfigurationException
Description copied from interface: IConfiguration
Returns the string value of this node.

Returns:
the string value of this node.
Throws:
ConfigurationException

getAttributeNames

public String[] getAttributeNames()
Description copied from interface: IConfiguration
Returns an array of all attribute names. The order of attributes is the array is undefinded.

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.

Returns:
an array of all child nodes.

getAttribute

public String getAttribute(String name)
                    throws ConfigurationException
Description copied from interface: IConfiguration
Returns the string value of the specified attribute.

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(String name,
                               boolean createNew)
Description copied from interface: IConfiguration
Returns the specified child node.

Parameters:
name - 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(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.

Parameters:
name - TBD: Description of the incoming method parameter
Returns:
an array of all child nodes.

setValue

public void setValue(String value)

setAttribute

public void setAttribute(String name,
                         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 StringBuffer dump(StringBuffer buffer,
                            int in)

toString

public String toString()

getPrefix

protected 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.

Specified by:
getPrefix in class AbstractConfiguration
Returns:
A non-null String (defaults to "")
Throws:
ConfigurationException - if no prefix was defined (prefix is null .

checkWriteable

protected final void checkWriteable()
                             throws IllegalStateException
Throws:
IllegalStateException


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. 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.