jefft       01/12/13 02:31:07

  Modified:    src/java/org/apache/avalon/framework/configuration
                        Configuration.java
  Log:
  * Give the javadocs <h3> and <h4> headers
  * Document the technique for determining if an attribute is present (thanks
    Vincent Massol for raising this).
  
  Revision  Changes    Path
  1.11      +19 -5     
jakarta-avalon/src/java/org/apache/avalon/framework/configuration/Configuration.java
  
  Index: Configuration.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/configuration/Configuration.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Configuration.java        2001/12/11 09:00:45     1.10
  +++ Configuration.java        2001/12/13 10:31:07     1.11
  @@ -15,6 +15,7 @@
    * This is a "read only" interface preventing applications from modifying 
their
    * own configurations. Once it is created, the information never changes.
    * </p>
  + * <h3>Data Model</h3>
    * <p>
    * The data model is a subset of XML's; a single-rooted hierarchical tree 
where each
    * node can contain multiple <em>attributes</em>, and leaf nodes can also
  @@ -23,6 +24,7 @@
    * class, or directly by a SAX parser using a [EMAIL PROTECTED] 
SAXConfigurationHandler} or
    * [EMAIL PROTECTED] NamespacedSAXConfigurationHandler} event handler.
    * </p>
  + * <h4>Namespace support</h4>
    * <p>
    * Since version 4.1, each <code>Configuration</code> node has a namespace
    * associated with it, in the form of a string, accessible through [EMAIL 
PROTECTED]
  @@ -30,6 +32,7 @@
    * return blank (""). See [EMAIL PROTECTED] DefaultConfigurationBuilder} for 
details on how
    * XML namespaces are mapped to <code>Configuration</code> namespaces.
    * </p>
  + * <h3>Example</h3>
    * <p>
    * As an example, consider two <code>Configuration</code>s (with and without
    * namespaces) built from this XML:
  @@ -72,7 +75,13 @@
    * <tr align="center"><td align="left"><code>[EMAIL PROTECTED] #getChild 
getChild}("doc:desc")[EMAIL PROTECTED] #getValue 
getValue}()</code></td><td>This is a highly fictitious config 
file</td><td>[EMAIL PROTECTED] ConfigurationException}</td></tr>
    * <tr align="center"><td align="left"><code>[EMAIL PROTECTED] #getChild 
getChild}("desc")[EMAIL PROTECTED] #getNamespace 
getNamespace}()</code></td><td>&nbsp;</td><td>http://myco.com/documentation";</td></tr>
    * </table>
  - *
  + * </p>
  + * <p>
  + * Type-safe utility methods are provided for retrieving attribute and 
element
  + * values as <code>String</code>, <code>int</code>, <code>long</code>,
  + * <code>float</code> and <code>boolean</code>.
  + * </p>
  + * <h3>Miscellanea</h3>
    * <p>
    * Currently, the configuration tree can only be traversed one node at a 
time,
    * eg., through [EMAIL PROTECTED] #getChild getChild("foo")} or [EMAIL 
PROTECTED] #getChildren}. In
  @@ -80,11 +89,16 @@
    * syntax.
    * </p>
    * <p>
  - * Type-safe utility methods are provided for retrieving attribute and 
element
  - * values as <code>String</code>, <code>int</code>, <code>long</code>,
  - * <code>float</code> and <code>boolean</code>.
  + * Checking for the existence of an attribute can be done as follows:
    * </p>
  - *
  + * <pre>
  + *String value = conf.getAttribute( "myAttribute", null );
  + * if ( null == value )
  + * {
  + *   // Do the processing applicable if the attribute isn't present.
  + * }
  + * </pre>
  + * 
    * @author <a href="mailto:[EMAIL PROTECTED]">Federico Barbieri</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to