You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by js...@apache.org on 2006/04/14 15:22:03 UTC
svn commit: r394090 -
/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java
Author: jsisson
Date: Fri Apr 14 06:22:00 2006
New Revision: 394090
URL: http://svn.apache.org/viewcvs?rev=394090&view=rev
Log:
Fix exception messages in the AbstractName URI constructor and add a bit of JavaDoc
Modified:
geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java
Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java?rev=394090&r1=394089&r2=394090&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java Fri Apr 14 06:22:00 2006
@@ -68,6 +68,23 @@
this.uri = createURI(artifact, name);
}
+ /**
+ * Contructs an AbstractName object from the given URI.
+ *
+ * The artifactId for the AbstractName is constructed from the URI path
+ * (everything up to the ? character) and is composed of four parts delimited by
+ * slashes. The artifactId is the only mandatory part, all slashes are mandatory.
+ *
+ * The name map for the AbstractName is constructed from key=value pairs.
+ * Each key=value pair is delimited by a ',' character and the key is separated
+ * from the value by the '=' character. Each key must be unique.
+ * At least one key=value pair must be specified in the query string.
+ *
+ * The URI has the following format:
+ * [vendorId]/artifactId/[version]/[type]?key=value[,key=value][,...]
+ *
+ * @param uri The URI to be used to generate an AbstractName.
+ */
public AbstractName(URI uri) {
if (uri == null) throw new NullPointerException("uri is null");
@@ -79,7 +96,7 @@
List artifactParts = split(artifactString, '/');
if (artifactParts.size() != 4) {
- throw new IllegalArgumentException("uri path must be in the form [?key=value[,key=value]*] : " + artifactString);
+ throw new IllegalArgumentException("uri path must be in the form [vendorId]/artifactId/[version]/[type] : " + artifactString);
}
String groupId = (String) artifactParts.get(0);
@@ -107,7 +124,7 @@
String namePart = (String) iterator.next();
List keyValue = split(namePart, '=');
if (keyValue.size() != 2) {
- throw new IllegalArgumentException("uri query string must be in the form [vendorId]/artifactId/[version]/[type] : " + nameString);
+ throw new IllegalArgumentException("uri query string must be in the form ?key=value[,key=value]*] : " + nameString);
}
String key = (String) keyValue.get(0);
String value = (String) keyValue.get(1);