Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@jakarta.apache.org Received: (qmail 30314 invoked by uid 500); 16 Jun 2001 15:46:35 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: "Avalon Development" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 30300 invoked from network); 16 Jun 2001 15:46:34 -0000 From: "Stephen McConnell" To: "Avalon Development" Subject: Configuration.java Date: Sat, 16 Jun 2001 17:46:45 +0200 Message-ID: <000001c0f67b$8c06a570$0a01a8c0@osm.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0001_01C0F68C.4F8F7570" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal In-Reply-To: <3B2A3A26.23254279@apache.org> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N ------=_NextPart_000_0001_01C0F68C.4F8F7570 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit Have updated the javadoc description for getChildren method (contained a non-terminated statement). Steve. ------=_NextPart_000_0001_01C0F68C.4F8F7570 Content-Type: application/octet-stream; name="Configuration.java" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Configuration.java" /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software = License * version 1.1, a copy of which has been included with this = distribution in * the LICENSE file. */ package org.apache.avalon.framework.configuration; /** * Configuration is a interface encapsulating a = configuration node * used to retrieve configuration values. This is a "read only" = interface * preventing applications from modifying their own configurations. *
* * The contract surrounding the Configuration is that once * it is created, information never changes. The = Configuration * is built by the SAXConfigurationBuilder and the * ConfigurationImpl helper classes. * * @author Federico Barbieri * @author Pierpaolo Fumagalli * @author Stefano Mazzocchi * @author Berin Loritsch * @author Peter Donald */ public interface Configuration { /** * Return the name of the node. * * @post getName() !=3D null * * @return name of the Configuration node. */ String getName(); /** * Return a string describing location of Configuration. * Location can be different for different mediums (ie "file:line" = for normal XML files or * "table:primary-key" for DB based configurations); * * @return a string describing location of Configuration */ String getLocation(); /** * Return a new Configuration instance encapsulating = the * specified child node. * * @pre child !=3D null * @post getConfiguration() !=3D null * * @param child The name of the child node. * @return Configuration */ Configuration getChild( String child ); /** * Return a new Configuration instance encapsulating = the * specified child node. * * @pre child !=3D null * @post getConfiguration() !=3D null * * @param child The name of the child node. * @return Configuration */ Configuration getChild( String child, boolean createNew ); /** * Return an Iterator of Configuration * elements containing all node children. * * @return The child nodes with name */ Configuration[] getChildren(); /** * Return an Iterator of Configuration * elements containing all node children with the specified name. * * @pre name !=3D null * @post getConfigurations() !=3D null * * @param name The name of the children to get. * @return The child nodes with name */ Configuration[] getChildren( String name ); /** * Return an array of all attribute names. */ String[] getAttributeNames(); /** * Return the value of specified attribute. * * @pre paramName !=3D null * @post getAttribute !=3D null * * @param paramName The name of the parameter you ask the value of. * @return String value of attribute. * @exception ConfigurationException If no attribute with that name = exists. */ String getAttribute( String paramName ) throws = ConfigurationException; /** * Return the int value of the specified attribute = contained * in this node. * * @pre paramName !=3D null * @post getAttributeAsInteger() !=3D null * * @param paramName The name of the parameter you ask the value of. * @return int value of attribute * @exception ConfigurationException If no parameter with that name = exists. * or if conversion to = int fails. */ int getAttributeAsInteger( String paramName ) throws = ConfigurationException; /** * Returns the value of the attribute specified by its name as a * long. * * @pre paramName !=3D null * @post getAttributeAsLong() !=3D null * * @param paramName The name of the parameter you ask the value of. * @return long value of attribute * @exception ConfigurationException If no parameter with that name = exists. * or if conversion to = long fails. */ long getAttributeAsLong( String name ) throws = ConfigurationException; /** * Return the float value of the specified parameter = contained * in this node. * * @pre paramName !=3D null * @post getAttributeAsFloat() !=3D null * * @param paramName The name of the parameter you ask the value of. * @return float value of attribute * @exception ConfigurationException If no parameter with that name = exists. * or if conversion to = float fails. */ float getAttributeAsFloat( String paramName ) throws = ConfigurationException; /** * Return the boolean value of the specified parameter = contained * in this node.
* * @pre paramName !=3D null * @post getAttributeAsBoolean() !=3D null * * @param paramName The name of the parameter you ask the value of. * @return boolean value of attribute * @exception ConfigurationException If no parameter with that name = exists. * or if conversion to = boolean fails. */ boolean getAttributeAsBoolean( String paramName ) throws = ConfigurationException; /** * Return the String value of the node. * * @post getValue() !=3D null * * @return the value of the node. */ String getValue() throws ConfigurationException; /** * Return the int value of the node. * * @post getValueAsInteger() !=3D null * * @returns the value of the node. * * @exception ConfigurationException If conversion to = int fails. */ int getValueAsInteger() throws ConfigurationException; /** * Return the float value of the node. * * @post getValueAsFloat() !=3D null * * @return the value of the node. * @exception ConfigurationException If conversion to = float fails. */ float getValueAsFloat() throws ConfigurationException; /** * Return the boolean value of the node. * * @post getValueAsBoolean() !=3D null * * @return the value of the node. * @exception ConfigurationException If conversion to = boolean fails. */ boolean getValueAsBoolean() throws ConfigurationException; /** * Return the long value of the node.
* * @post getValueAsLong() !=3D null * * @return the value of the node. * @exception ConfigurationException If conversion to = long fails. */ long getValueAsLong() throws ConfigurationException; /** * Returns the value of the configuration element as a = String. * If the configuration value is not set, the default value will be * used. * * @pre defaultValue !=3D null * @post getValue(defaultValue) !=3D null * * @param defaultValue The default value desired. * @return String value of the Configuration, or = default * if none specified. */ String getValue( String defaultValue ); /** * Returns the value of the configuration element as an = int. * If the configuration value is not set, the default value will be * used. * * @pre defaultValue !=3D null * @post getValueAsInteger(defaultValue) !=3D null * * @param defaultValue The default value desired. * @return int value of the Configuration, or default * if none specified. */ int getValueAsInteger( int defaultValue ); /** * Returns the value of the configuration element as a = long. * If the configuration value is not set, the default value will be * used. * * @pre defaultValue !=3D null * @post getValueAsLong(defaultValue) !=3D null * * @param defaultValue The default value desired. * @return long value of the Configuration, or default * if none specified. */ long getValueAsLong( long defaultValue ); /** * Returns the value of the configuration element as a = float. * If the configuration value is not set, the default value will be * used. * * @pre defaultValue !=3D null * @post getValueAsFloat(defaultValue) !=3D null * * @param defaultValue The default value desired. * @return float value of the Configuration, or default * if none specified. */ float getValueAsFloat( float defaultValue ); /** * Returns the value of the configuration element as a = boolean. * If the configuration value is not set, the default value will be * used. * * @pre defaultValue !=3D null * @post getValueAsBoolean(defaultValue) !=3D null * * @param defaultValue The default value desired. * @return boolean value of the Configuration, or = default * if none specified. */ boolean getValueAsBoolean( boolean defaultValue ); /** * Returns the value of the attribute specified by its name as a * String, or the default value if no attribute by * that name exists or is empty. * * @pre name !=3D null * @pre defaultValue !=3D null * @post getAttribute(name, defaultValue) !=3D null * * @param name The name of the attribute you ask the value of. * @param defaultValue The default value desired. * @return String value of attribute. It will return the default * value if the named attribute does not exist, or if * the value is not set. */ String getAttribute( String name, String defaultValue ); /** * Returns the value of the attribute specified by its name as a * int, or the default value if no attribute by * that name exists or is empty. * * @pre name !=3D null * @pre defaultValue !=3D null * @post getAttributeAsInteger(name, defaultValue) !=3D null * * @param name The name of the attribute you ask the value of. * @param defaultValue The default value desired. * @return int value of attribute. It will return the default * value if the named attribute does not exist, or if * the value is not set. */ int getAttributeAsInteger( String name, int defaultValue ); /** * Returns the value of the attribute specified by its name as a * long, or the default value if no attribute by * that name exists or is empty. * * @pre name !=3D null * @pre defaultValue !=3D null * @post getAttributeAsLong(name, defaultValue) !=3D null * * @param name The name of the attribute you ask the value of. * @param defaultValue The default value desired. * @return long value of attribute. It will return the default * value if the named attribute does not exist, or if * the value is not set. */ long getAttributeAsLong( String name, long defaultValue ); /** * Returns the value of the attribute specified by its name as a * float, or the default value if no attribute by * that name exists or is empty. * * @pre name !=3D null * @pre defaultValue !=3D null * @post getAttributeAsFloat(name, defaultValue) !=3D null * * @param name The name of the attribute you ask the value of. * @param defaultValue The default value desired. * @return float value of attribute. It will return the default * value if the named attribute does not exist, or if * the value is not set. */ float getAttributeAsFloat( String name, float defaultValue ); /** * Returns the value of the attribute specified by its name as a * boolean, or the default value if no attribute by * that name exists or is empty. * * @pre name !=3D null * @pre defaultValue !=3D null * @post getAttributeAsBoolean(name, defaultValue) !=3D null * * @param name The name of the attribute you ask the value of. * @param defaultValue The default value desired. * @return boolean value of attribute. It will return the default * value if the named attribute does not exist, or if * the value is not set. */ boolean getAttributeAsBoolean( String name, boolean defaultValue ); } ------=_NextPart_000_0001_01C0F68C.4F8F7570 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: avalon-dev-help@jakarta.apache.org ------=_NextPart_000_0001_01C0F68C.4F8F7570--