You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by oh...@apache.org on 2005/10/05 21:36:28 UTC
svn commit: r295090 -
/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/
Author: oheger
Date: Wed Oct 5 12:36:15 2005
New Revision: 295090
URL: http://svn.apache.org/viewcvs?rev=295090&view=rev
Log:
Javadoc and Checkstyle
Modified:
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationFactory.java
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationKey.java
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationUtils.java
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalXMLConfiguration.java
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/JNDIConfiguration.java
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/SubsetConfiguration.java
Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationFactory.java?rev=295090&r1=295089&r2=295090&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationFactory.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationFactory.java Wed Oct 5 12:36:15 2005
@@ -59,10 +59,10 @@
/** Constant for the additional section.*/
private static final String SEC_ADDITIONAL = SEC_ROOT + "additional/";
-
+
/** Constant for the optional attribute.*/
private static final String ATTR_OPTIONAL = "optional";
-
+
/** Constant for the fileName attribute.*/
private static final String ATTR_FILENAME = "fileName";
@@ -154,7 +154,7 @@
// awareness must be configured before the digester rules are loaded.
configureNamespace(digester);
}
-
+
// Configure digester to always enable the context class loader
digester.setUseContextClassLoader(true);
// Put the composite builder object below all of the other objects.
@@ -516,6 +516,13 @@
return conf;
}
+ /**
+ * Creates the object, a <code>FileConfiguration</code>.
+ *
+ * @param attributes the actual attributes
+ * @return the file configuration
+ * @throws Exception if the object could not be created
+ */
protected FileConfiguration createConfiguration(Attributes attributes) throws Exception
{
return (FileConfiguration) super.createObject(attributes);
@@ -530,11 +537,24 @@
*/
public class PropertiesConfigurationFactory extends FileConfigurationFactory
{
+ /**
+ * Creates a new instance of <code>PropertiesConfigurationFactory</code>.
+ */
public PropertiesConfigurationFactory()
{
super(null);
}
+ /**
+ * Creates the new configuration object. Based on the file name
+ * provided in the attributes either a <code>PropertiesConfiguration</code>
+ * or a <code>XMLPropertiesConfiguration</code> object will be
+ * returned.
+ *
+ * @param attributes the attributes
+ * @return the new configuration object
+ * @throws Exception if an error occurs
+ */
protected FileConfiguration createConfiguration(Attributes attributes) throws Exception
{
String filename = attributes.getValue(ATTR_FILENAME);
@@ -558,11 +578,24 @@
*/
public class PropertyListConfigurationFactory extends FileConfigurationFactory
{
+ /**
+ * Creates a new instance of <code>PropertyListConfigurationFactory</code>.
+ */
public PropertyListConfigurationFactory()
{
super(null);
}
+ /**
+ * Creates the new configuration object. Based on the file name
+ * provided in the attributes either a <code>XMLPropertyListConfiguration</code>
+ * or a <code>PropertyListConfiguration</code> object will be
+ * returned.
+ *
+ * @param attributes the attributes
+ * @return the new configuration object
+ * @throws Exception if an error occurs
+ */
protected FileConfiguration createConfiguration(Attributes attributes) throws Exception
{
String filename = attributes.getValue(ATTR_FILENAME);
@@ -584,6 +617,9 @@
*/
private class JNDIConfigurationFactory extends DigesterConfigurationFactory
{
+ /**
+ * Creates a new instance of <code>JNDIConfigurationFactory</code>.
+ */
public JNDIConfigurationFactory()
{
super(JNDIConfiguration.class);
@@ -596,6 +632,9 @@
*/
private class SystemConfigurationFactory extends DigesterConfigurationFactory
{
+ /**
+ * Creates a new instance of <code>SystemConfigurationFactory</code>.
+ */
public SystemConfigurationFactory()
{
super(SystemConfiguration.class);
Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationKey.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationKey.java?rev=295090&r1=295089&r2=295090&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationKey.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationKey.java Wed Oct 5 12:36:15 2005
@@ -41,9 +41,9 @@
{
/** Constant for a property delimiter.*/
public static final char PROPERTY_DELIMITER = '.';
-
+
/** Constant for an escaped delimiter. */
- public static final String ESCAPED_DELIMITER =
+ public static final String ESCAPED_DELIMITER =
String.valueOf(PROPERTY_DELIMITER) + String.valueOf(PROPERTY_DELIMITER);
/** Constant for an attribute start marker.*/
@@ -127,10 +127,10 @@
keyBuffer.append(constructAttributeKey(attr));
return this;
}
-
+
/**
* Checks if this key is an attribute key.
- *
+ *
* @return a flag if this key is an attribute key
*/
public boolean isAttributeKey()
@@ -201,8 +201,10 @@
{
int count = 0;
for (int idx = keyBuffer.length() - 1; idx >= 0
- && keyBuffer.charAt(idx) == PROPERTY_DELIMITER; idx--, count++)
- ;
+ && keyBuffer.charAt(idx) == PROPERTY_DELIMITER; idx--)
+ {
+ count++;
+ }
return count % 2 == 1;
}
@@ -401,7 +403,7 @@
/**
* Helper method for determining the next indices.
- *
+ *
* @return the next key part
*/
private String findNextIndices()
@@ -430,12 +432,12 @@
/**
* Helper method for extracting the next key part. Takes escaping of
* delimiter characters into account.
- *
+ *
* @return the next key part
*/
private String nextKeyPart()
{
- StringBuffer key = new StringBuffer(32);
+ StringBuffer key = new StringBuffer(INITIAL_SIZE);
int idx = startIndex;
int endIdx = keyBuffer.toString().indexOf(ATTRIBUTE_START,
startIndex);
Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationUtils.java?rev=295090&r1=295089&r2=295090&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationUtils.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/ConfigurationUtils.java Wed Oct 5 12:36:15 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
@@ -16,7 +16,12 @@
package org.apache.commons.configuration;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
@@ -39,8 +44,12 @@
/** Constant for the file URL protocol.*/
static final String PROTOCOL_FILE = "file";
+ /** The logger.*/
private static Log log = LogFactory.getLog(ConfigurationUtils.class);
+ /**
+ * Private constructor. Prevents instances from being created.
+ */
private ConfigurationUtils()
{
// to prevent instanciation...
@@ -260,7 +269,7 @@
// undefined, always return null
return null;
}
-
+
URL url = null;
// attempt to create an URL directly
@@ -390,8 +399,8 @@
* Return the path without the file name, for example http://xyz.net/foo/bar.xml
* results in http://xyz.net/foo/
*
- * @param url
- * @return
+ * @param url the URL from which to extract the path
+ * @return the path component of the passed in URL
*/
static String getBasePath(URL url)
{
@@ -414,6 +423,9 @@
/**
* Extract the file name from the specified URL.
+ *
+ * @param url the URL from which to extract the file name
+ * @return the extracted file name
*/
static String getFileName(URL url)
{
@@ -439,7 +451,7 @@
* This method is called e.g. by the save() methods of file based
* configurations. The parameter strings can be relative files, absolute
* files and URLs as well.
- *
+ *
* @param basePath the base path
* @param fileName the file name
* @return the file object (<b>null</b> if no file can be obtained)
@@ -475,7 +487,7 @@
/**
* Tries to convert the specified URL to a file object. If this fails,
* <b>null</b> is returned.
- *
+ *
* @param url the URL
* @return the resulting file object
*/
Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java?rev=295090&r1=295089&r2=295090&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java Wed Oct 5 12:36:15 2005
@@ -39,7 +39,7 @@
* organization.</p><p>The internal used storage form allows for a more
* sophisticated access to single properties. As an example consider the
* following XML document:</p><p>
- *
+ *
* <pre>
* <database>
* <tables>
@@ -71,7 +71,7 @@
* </tables>
* </database>
* </pre>
- *
+ *
* </p><p>If this document is parsed and stored in a
* <code>HierarchicalConfiguration</code> object (which can be done by one of
* the sub classes), there are enhanced possibilities of accessing properties.
@@ -87,7 +87,7 @@
* <code>getMaxIndex()</code> method that returns the maximum allowed index
* that can be added to a given property key. This method can be used to iterate
* over all values defined for a certain property.</p>
- *
+ *
* @author <a href="mailto:oliver.heger@t-online.de">Oliver Heger </a>
* @version $Id: HierarchicalConfiguration.java,v 1.14 2004/12/02 22:05:52
* ebourg Exp $
@@ -102,7 +102,7 @@
/**
* Returns the root node of this hierarchical configuration.
- *
+ *
* @return the root node
*/
public Node getRoot()
@@ -112,7 +112,7 @@
/**
* Sets the root node of this hierarchical configuration.
- *
+ *
* @param node the root node
*/
public void setRoot(Node node)
@@ -127,7 +127,7 @@
/**
* Fetches the specified property. Performs a recursive lookup in the tree
* with the configuration properties.
- *
+ *
* @param key the key to be looked up
* @return the found value
*/
@@ -168,7 +168,7 @@
* passed in key is of importance, especially the indices it might contain.
* The following example should clearify this: Suppose the actual
* configuration contains the following elements:</p><p>
- *
+ *
* <pre>
* tables
* +-- table
@@ -184,18 +184,18 @@
* +-- fields
* ...
* </pre>
- *
+ *
* </p><p>In this example a database structure is defined, e.g. all fields
* of the first table could be accessed using the key
* <code>tables.table(0).fields.field.name</code>. If now properties are
* to be added, it must be exactly specified at which position in the
* hierarchy the new property is to be inserted. So to add a new field name
* to a table it is not enough to say just</p><p>
- *
+ *
* <pre>
* config.addProperty("tables.table.fields.field.name", "newField");
* </pre>
- *
+ *
* </p><p>The statement given above contains some ambiguity. For instance
* it is not clear, to which table the new field should be added. If this
* method finds such an ambiguity, it is resolved by following the last
@@ -214,23 +214,23 @@
* achieved by specifying an invalid index (like -1) after the element where
* a new branch should be created. Given this our example would run:</p>
* <p>
- *
+ *
* <pre>
* config.addProperty("tables.table(1).fields.field(-1).name", "newField");
* </pre>
- *
+ *
* </p><p>With this notation it is possible to add new branches
* everywhere. We could for instance create a new <code>table</code>
* element by specifying</p><p>
- *
+ *
* <pre>
* config.addProperty("tables.table(-1).fields.field.name", "newField2");
* </pre>
- *
+ *
* </p><p>(Note that because after the <code>table</code> element a new
* branch is created indices in following elements are not relevant; the
* branch is new so there cannot be any ambiguities.)</p>
- *
+ *
* @param key the key of the new property
* @param obj the value of the new property
*/
@@ -251,7 +251,7 @@
* and thus complete configuration sub trees. E.g. with this method it is
* possible to add parts of another <code>HierarchicalConfiguration</code>
* object to this object.
- *
+ *
* @param key the key where the nodes are to be added; can be <b>null </b>,
* then they are added to the root node
* @param nodes a collection with the <code>Node</code> objects to be
@@ -290,7 +290,7 @@
/**
* Checks if this configuration is empty. Empty means that there are no keys
* with any values, though there can be some (empty) nodes.
- *
+ *
* @return a flag if this configuration is empty
*/
public boolean isEmpty()
@@ -303,7 +303,7 @@
* that start with the specified prefix. This implementation will return a
* <code>HierarchicalConfiguration</code> object so that the structure of
* the keys will be saved.
- *
+ *
* @param prefix the prefix of the keys for the subset
* @return a new configuration object representing the selected subset
*/
@@ -342,7 +342,7 @@
* has an associated value. If there is a node for this key that has no
* value but children (either defined or undefined), this method will still
* return <b>false </b>.
- *
+ *
* @param key the key to be chekced
* @return a flag if this key is contained in this configuration
*/
@@ -352,7 +352,10 @@
}
/**
- * @inheritDoc
+ * Sets the value of the specified property.
+ *
+ * @param key the key of the property to set
+ * @param value the new value of this property
*/
public void setProperty(String key, Object value)
{
@@ -381,7 +384,7 @@
* start with this name. So if there is a property with the key
* "foo" and a property with the key "foo.bar", a call
* of <code>clearTree("foo")</code> would remove both properties.
- *
+ *
* @param key the key of the property to be removed
*/
public void clearTree(String key)
@@ -398,7 +401,7 @@
* Removes the property with the given key. Properties with names that start
* with the given key (i.e. properties below the specified key in the
* hierarchy) won't be affected.
- *
+ *
* @param key the key of the property to be removed
*/
public void clearProperty(String key)
@@ -415,7 +418,7 @@
* Returns an iterator with all keys defined in this configuration.
* Note that the keys returned by this method will not contain any
* indices. This means that some structure will be lost.</p>
- *
+ *
* @return an iterator with the defined keys in this configuration
*/
public Iterator getKeys()
@@ -430,7 +433,7 @@
* Returns an iterator with all keys defined in this configuration that
* start with the given prefix. The returned keys will not contain any
* indices.
- *
+ *
* @param prefix the prefix of the keys to start with
* @return an iterator with the found keys
*/
@@ -457,7 +460,7 @@
* there are multiple values for this key. They can then be addressed
* separately by specifying indices from 0 to the return value of this
* method.
- *
+ *
* @param key the key to be checked
* @return the maximum defined index for this key
*/
@@ -465,11 +468,11 @@
{
return fetchNodeList(key).size() - 1;
}
-
+
/**
* Creates a copy of this object. This new configuration object will contain
* copies of all nodes in the same structure.
- *
+ *
* @return the copy
* @since 1.2
*/
@@ -497,7 +500,7 @@
/**
* Helper method for fetching a list of all nodes that are addressed by the
* specified key.
- *
+ *
* @param key the key
* @return a list with all affected nodes (never <b>null </b>)
*/
@@ -512,7 +515,7 @@
* Recursive helper method for fetching a property. This method processes
* all facets of a configuration key, traverses the tree of properties and
* fetches the the nodes of all matching properties.
- *
+ *
* @param keyPart the configuration key iterator
* @param node the actual node
* @param nodes here the found nodes are stored
@@ -547,7 +550,7 @@
/**
* Checks if the specified node is defined.
- *
+ *
* @param node the node to be checked
* @return a flag if this node is defined
*/
@@ -562,7 +565,7 @@
* Removes the specified node from this configuration. This method ensures
* that parent nodes that become undefined by this operation are also
* removed.
- *
+ *
* @param node the node to be removed
*/
protected void removeNode(Node node)
@@ -581,7 +584,7 @@
/**
* Clears the value of the specified node. If the node becomes undefined by
* this operation, it is removed from the hierarchy.
- *
+ *
* @param node the node to be cleard
*/
protected void clearNode(Node node)
@@ -597,7 +600,7 @@
* Returns a reference to the parent node of an add operation. Nodes for new
* properties can be added as children of this node. If the path for the
* specified key does not exist so far, it is created now.
- *
+ *
* @param keyIt the iterator for the key of the new property
* @param startNode the node to start the search with
* @return the parent node for the add operation
@@ -616,7 +619,7 @@
* Finds the last existing node for an add operation. This method traverses
* the configuration tree along the specified key. The last existing node on
* this path is returned.
- *
+ *
* @param keyIt the key iterator
* @param node the actual node
* @return the last existing node on the given path
@@ -649,7 +652,7 @@
* Creates the missing nodes for adding a new property. This method ensures
* that there are corresponding nodes for all components of the specified
* configuration key.
- *
+ *
* @param keyIt the key iterator
* @param root the base node of the path to be created
* @return the last node of the path
@@ -674,7 +677,7 @@
* method can be overloaded in derived classes if a specific node type is
* needed. This base implementation always returns a new object of the
* <code>Node</code> class.
- *
+ *
* @param name the name of the new node
* @return the new node
*/
@@ -686,7 +689,7 @@
/**
* A data class for storing (hierarchical) property information. A property
* can have a value and an arbitrary number of child properties.
- *
+ *
*/
public static class Node implements Serializable, Cloneable
{
@@ -719,7 +722,7 @@
/**
* Creates a new instance of <code>Node</code> and sets the name.
- *
+ *
* @param name the node's name
*/
public Node(String name)
@@ -741,7 +744,7 @@
/**
* Returns the name of this node.
- *
+ *
* @return the node name
*/
public String getName()
@@ -751,7 +754,7 @@
/**
* Returns the value of this node.
- *
+ *
* @return the node value (may be <b>null </b>)
*/
public Object getValue()
@@ -761,7 +764,7 @@
/**
* Returns the parent of this node.
- *
+ *
* @return this node's parent (can be <b>null </b>)
*/
public Node getParent()
@@ -771,7 +774,7 @@
/**
* Sets the name of this node.
- *
+ *
* @param string the node name
*/
public void setName(String string)
@@ -781,7 +784,7 @@
/**
* Sets the value of this node.
- *
+ *
* @param object the node value
*/
public void setValue(Object object)
@@ -791,7 +794,7 @@
/**
* Sets the parent of this node.
- *
+ *
* @param node the parent node
*/
public void setParent(Node node)
@@ -801,7 +804,7 @@
/**
* Returns the reference object for this node.
- *
+ *
* @return the reference object
*/
public Object getReference()
@@ -816,7 +819,7 @@
* configuration e.g. this reference could be an element in a
* corresponding XML document. The reference is used by the
* <code>BuilderVisitor</code> class when the configuration is stored.
- *
+ *
* @param ref the reference object
*/
public void setReference(Object ref)
@@ -827,7 +830,7 @@
/**
* Adds the specified child object to this node. Note that there can be
* multiple children with the same name.
- *
+ *
* @param child the child to be added
*/
public void addChild(Node child)
@@ -850,7 +853,7 @@
/**
* Returns a list with the child nodes of this node.
- *
+ *
* @return a list with the children (can be empty, but never <b>null
* </b>)
*/
@@ -871,7 +874,7 @@
/**
* Returns a list with this node's children with the given name.
- *
+ *
* @param name the name of the children
* @return a list with all chidren with this name; may be empty, but
* never <b>null </b>
@@ -892,10 +895,10 @@
return list;
}
-
+
/**
* Returns a flag whether this node has child elements.
- *
+ *
* @return <b>true</b> if there a child node, <b>false</b> otherwise
*/
public boolean hasChildren()
@@ -917,7 +920,7 @@
/**
* Removes the specified child from this node.
- *
+ *
* @param child the child node to be removed
* @return a flag if the child could be found
*/
@@ -954,7 +957,7 @@
/**
* Removes all children with the given name.
- *
+ *
* @param name the name of the children to be removed
* @return a flag if children with this name existed
*/
@@ -997,7 +1000,7 @@
* A generic method for traversing this node and all of its children.
* This method sends the passed in visitor to this node and all of its
* children.
- *
+ *
* @param visitor the visitor
* @param key here a configuration key with the name of the root node of
* the iteration can be passed; if this key is not <b>null </b>, the
@@ -1042,7 +1045,7 @@
/**
* Creates a copy of this object. This is not a deep copy, the children
* are not cloned.
- *
+ *
* @return a copy of this object
*/
public Object clone()
@@ -1074,7 +1077,7 @@
* Helper method for calling <code>removeReference()</code> on a list
* of removed nodes. Used by methods that can remove multiple child
* nodes in one step.
- *
+ *
* @param nodes collection with the nodes to be removed
*/
private void nodesRemoved(Collection nodes)
@@ -1094,14 +1097,14 @@
* iteration algorithm based on the <em>Visitor</em> pattern. By providing
* different implementations of visitors it is possible to collect different
* data during the iteration process.</p>
- *
+ *
*/
public static class NodeVisitor
{
/**
* Visits the specified node. This method is called during iteration for
* each node before its children have been visited.
- *
+ *
* @param node the actual node
* @param key the key of this node (may be <b>null </b>)
*/
@@ -1113,7 +1116,7 @@
* Visits the specified node after its children have been processed.
* This gives a visitor the opportunity of collecting additional data
* after the child nodes have been visited.
- *
+ *
* @param node the node to be visited
* @param key the key of this node (may be <b>null </b>)
*/
@@ -1127,7 +1130,7 @@
* visitors that search a specific node. If this node is found, the
* whole process can be stopped. This base implementation always returns
* <b>false </b>.
- *
+ *
* @return a flag if iteration should be stopped
*/
public boolean terminate()
@@ -1140,7 +1143,7 @@
* A specialized visitor that checks if a node is defined.
* "Defined" in this terms means that the node or at least one of
* its sub nodes is associated with a value.
- *
+ *
*/
static class DefinedVisitor extends NodeVisitor
{
@@ -1150,7 +1153,7 @@
/**
* Checks if iteration should be stopped. This can be done if the first
* defined node is found.
- *
+ *
* @return a flag if iteration should be stopped
*/
public boolean terminate()
@@ -1160,7 +1163,7 @@
/**
* Visits the node. Checks if a value is defined.
- *
+ *
* @param node the actual node
* @param key the key of this node
*/
@@ -1171,7 +1174,7 @@
/**
* Returns the defined flag.
- *
+ *
* @return the defined flag
*/
public boolean isDefined()
@@ -1183,7 +1186,7 @@
/**
* A specialized visitor that fills a list with keys that are defined in a
* node hierarchy.
- *
+ *
*/
static class DefinedKeysVisitor extends NodeVisitor
{
@@ -1204,7 +1207,7 @@
/**
* Creates a new <code>DefinedKeysVisitor</code> instance and sets the
* prefix for the keys to fetch.
- *
+ *
* @param prefix the prefix
*/
public DefinedKeysVisitor(String prefix)
@@ -1215,7 +1218,7 @@
/**
* Returns the list with all defined keys.
- *
+ *
* @return the list with the defined keys
*/
public Set getKeyList()
@@ -1226,7 +1229,7 @@
/**
* Visits the specified node. If this node has a value, its key is added
* to the internal list.
- *
+ *
* @param node the node to be visited
* @param key the key of this node
*/
@@ -1240,7 +1243,7 @@
/**
* Adds the specified key to the internal list.
- *
+ *
* @param key the key to add
*/
protected void addKey(ConfigurationKey key)
@@ -1265,7 +1268,7 @@
/**
* A specialized visitor that is able to create a deep copy of a node
* hierarchy.
- *
+ *
*/
static class CloneVisitor extends NodeVisitor
{
@@ -1285,7 +1288,7 @@
/**
* Visits the specified node after its children have been processed.
- *
+ *
* @param node the node
* @param key the key of this node
*/
@@ -1300,7 +1303,7 @@
/**
* Visits and copies the specified node.
- *
+ *
* @param node the node
* @param key the key of this node
*/
@@ -1319,7 +1322,7 @@
/**
* Returns the result of the clone process. This is the root node of the
* cloned node hierarchy.
- *
+ *
* @return the cloned root node
*/
public Node getClone()
@@ -1341,12 +1344,15 @@
* method is called, which must be defined in concrete sub classes. This
* method can perform all steps to integrate the new node into the original
* structure.
- *
+ *
*/
protected abstract static class BuilderVisitor extends NodeVisitor
{
/**
- * @inheritDoc
+ * Visits the specified node before its children have been traversed.
+ *
+ * @param node the node to visit
+ * @param key the current key
*/
public void visitBeforeChildren(Node node, ConfigurationKey key)
{
@@ -1410,7 +1416,7 @@
* value is interpreted as the new reference of the affected
* <code>Node</code> object; if it is not <b>null </b>, it is passed
* to the node's <code>setReference()</code> method.
- *
+ *
* @param newNode the node to be inserted
* @param parent the parent node
* @param sibling1 the sibling after which the node is to be inserted;
@@ -1423,4 +1429,4 @@
*/
protected abstract Object insert(Node newNode, Node parent, Node sibling1, Node sibling2);
}
-}
\ No newline at end of file
+}
Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalXMLConfiguration.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalXMLConfiguration.java?rev=295090&r1=295089&r2=295090&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalXMLConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalXMLConfiguration.java Wed Oct 5 12:36:15 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2004 The Apache Software Foundation.
+ * Copyright 2004-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
@@ -19,13 +19,13 @@
/**
* A specialized hierarchical configuration class that is able to parse XML
* documents.
- *
+ *
* <p>The parsed document will be stored keeping its structure. The contained
* properties can be accessed using all methods supported by the base class
* <code>HierarchicalConfiguration</code>.
- *
+ *
* @since commons-configuration 1.0
- *
+ *
* @author Jörg Schaible
* @author Oliver Heger
* @version $Revision$, $Date$
Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/JNDIConfiguration.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/JNDIConfiguration.java?rev=295090&r1=295089&r2=295090&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/JNDIConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/JNDIConfiguration.java Wed Oct 5 12:36:15 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
@@ -74,7 +74,7 @@
* Creates a JNDIConfiguration using the default initial context, shifted
* with the specified prefix, as the root of the properties.
*
- * @param prefix
+ * @param prefix the prefix
*
* @throws NamingException thrown if an error occurs when initializing the default context
*/
@@ -99,7 +99,7 @@
* by the specified prefix as the root of the properties.
*
* @param context the initial context
- * @param prefix
+ * @param prefix the prefix
*/
public JNDIConfiguration(Context context, String prefix)
{
@@ -165,7 +165,9 @@
}
/**
- * {@inheritDoc}
+ * Returns an iterator with all property keys stored in this configuration.
+ *
+ * @return an iterator with all keys
*/
public Iterator getKeys()
{
@@ -173,7 +175,11 @@
}
/**
- * {@inheritDoc}
+ * Returns an iterator with all property keys starting with the given
+ * prefix.
+ *
+ * @param prefix the prefix
+ * @return an iterator with the selected keys
*/
public Iterator getKeys(String prefix)
{
@@ -266,7 +272,9 @@
}
/**
- * {@inheritDoc}
+ * Returns a flag whether this configuration is empty.
+ *
+ * @return the empty flag
*/
public boolean isEmpty()
{
@@ -299,6 +307,8 @@
* <p><strong>This operation is not supported and will throw an
* UnsupportedOperationException.</strong></p>
*
+ * @param key the key
+ * @param value the value
* @throws UnsupportedOperationException
*/
public void setProperty(String key, Object value)
@@ -307,7 +317,9 @@
}
/**
- * {@inheritDoc}
+ * Removes the specified property.
+ *
+ * @param key the key of the property to remove
*/
public void clearProperty(String key)
{
@@ -315,7 +327,10 @@
}
/**
- * {@inheritDoc}
+ * Checks whether the specified key is contained in this configuration.
+ *
+ * @param key the key to check
+ * @return a flag whether this key is stored in this configuration
*/
public boolean containsKey(String key)
{
@@ -343,7 +358,8 @@
}
/**
- * @return String
+ * Returns the prefix.
+ * @return the prefix
*/
public String getPrefix()
{
@@ -364,7 +380,10 @@
}
/**
- * {@inheritDoc}
+ * Returns the value of the specified property.
+ *
+ * @param key the key of the property
+ * @return the value of this property
*/
public Object getProperty(String key)
{
@@ -394,6 +413,8 @@
* <p><strong>This operation is not supported and will throw an
* UnsupportedOperationException.</strong></p>
*
+ * @param key the key
+ * @param obj the value
* @throws UnsupportedOperationException
*/
protected void addPropertyDirect(String key, Object obj)
@@ -403,6 +424,9 @@
/**
* Return the base context with the prefix applied.
+ *
+ * @return the base context
+ * @throws NamingException if an error occurs
*/
public Context getBaseContext() throws NamingException
{
@@ -417,6 +441,8 @@
/**
* Return the initial context used by this configuration. This context is
* independent of the prefix specified.
+ *
+ * @return the initial context
*/
public Context getContext()
{
@@ -425,6 +451,8 @@
/**
* Set the initial context of the configuration.
+ *
+ * @param context the context
*/
public void setContext(Context context)
{
Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/SubsetConfiguration.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/SubsetConfiguration.java?rev=295090&r1=295089&r2=295090&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/SubsetConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/SubsetConfiguration.java Wed Oct 5 12:36:15 2005
@@ -74,6 +74,7 @@
* key in this subset.
*
* @param key The key in the subset.
+ * @return the key as to be used by the parent
*/
protected String getParentKey(String key)
{
@@ -92,6 +93,7 @@
* key in the parent configuration.
*
* @param key The key in the parent configuration.
+ * @return the key in the context of this subset configuration
*/
protected String getChildKey(String key)
{
@@ -118,6 +120,8 @@
/**
* Return the parent configuation for this subset.
+ *
+ * @return the parent configuration
*/
public Configuration getParent()
{
@@ -126,6 +130,8 @@
/**
* Return the prefix used to select the properties in the parent configuration.
+ *
+ * @return the prefix used by this subset
*/
public String getPrefix()
{
@@ -134,6 +140,8 @@
/**
* Set the prefix used to select the properties in the parent configuration.
+ *
+ * @param prefix the prefix
*/
public void setPrefix(String prefix)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org