cmlenz 2002/08/01 08:57:58
Modified: src/taglib/common/org/apache/slide/taglib/bean
RevisionBean.java NodeBean.java NamespaceBean.java
DomainBean.java
Log:
- Replaced Vectors with Lists
- Cleaned up imports
Revision Changes Path
1.9 +11 -10
jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/RevisionBean.java
Index: RevisionBean.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/RevisionBean.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- RevisionBean.java 1 Aug 2002 11:47:04 -0000 1.8
+++ RevisionBean.java 1 Aug 2002 15:57:57 -0000 1.9
@@ -59,16 +59,17 @@
*
* [Additional notices, if required by prior licensing conditions]
*
- */
+ */
package org.apache.slide.taglib.bean;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
+import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
-import java.util.Vector;
+import java.util.List;
import org.apache.slide.common.NamespaceAccessToken;
import org.apache.slide.common.SlideException;
@@ -252,16 +253,16 @@
/**
* Returns the list of properties of the revision.
*
- * @return a Vector of PropertyBean objects, or an empty Vector if the
+ * @return a List of PropertyBean objects, or an empty List if the
* revision doesn't have any properties
*/
- public Vector getProperties() {
+ public List getProperties() {
- Vector properties = new Vector();
+ List properties = new ArrayList();
Enumeration enum = revision.enumerateProperties();
while (enum.hasMoreElements()) {
NodeProperty np = (NodeProperty)enum.nextElement();
- properties.addElement(new PropertyBean(nat, st, np));
+ properties.add(new PropertyBean(nat, st, np));
}
return properties;
1.8 +36 -35
jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/NodeBean.java
Index: NodeBean.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/NodeBean.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- NodeBean.java 1 Aug 2002 11:50:27 -0000 1.7
+++ NodeBean.java 1 Aug 2002 15:57:57 -0000 1.8
@@ -63,8 +63,9 @@
package org.apache.slide.taglib.bean;
+import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.Vector;
+import java.util.List;
import org.apache.slide.common.NamespaceAccessToken;
import org.apache.slide.common.NamespaceConfig;
@@ -146,34 +147,34 @@
/**
* Returns the names of the branches that exist for the node.
*
- * @return a Vector of Strings, or an empty Vector if no branches exist for
+ * @return a List of Strings, or an empty List if no branches exist for
* the node
*/
- public Vector getBranches() {
+ public List getBranches() {
- Vector v = new Vector();
+ List branches = new ArrayList();
if (revisionDescriptors != null) {
Enumeration enum = revisionDescriptors.enumerateBranchNames();
while (enum.hasMoreElements()) {
- v.addElement((String)enum.nextElement());
+ branches.add((String)enum.nextElement());
}
}
- return v;
+ return branches;
}
/**
* Returns the children of the node.
*
- * @return a Vector of NodeBean objects, or an empty Vector if the node
+ * @return a List of NodeBean objects, or an empty List if the node
* doesn't have any children
*
* @see #getHasChildren
*/
- public Vector getChildren() {
+ public List getChildren() {
- Vector v = new Vector();
+ List children = new ArrayList();
Enumeration enum = node.enumerateChildren();
while (enum.hasMoreElements()) {
try {
@@ -181,13 +182,13 @@
ObjectNode node =
structure.retrieve(st, (String)enum.nextElement(),
false);
- v.addElement(new NodeBean(nat, st, node));
+ children.add(new NodeBean(nat, st, node));
} catch (SlideException e) {
// ignore for now
}
}
- return v;
+ return children;
}
@@ -230,28 +231,28 @@
/**
* Returns the list of active locks on the node.
*
- * @return a Vector of LockBean objects, or an empty Vector if the node
+ * @return a List of LockBean objects, or an empty List if the node
* is not locked
*
* @see #getIsLocked
*/
- public Vector getLocks() {
+ public List getLocks() {
- Vector v = new Vector();
+ List locks = new ArrayList();
try {
Lock lock = nat.getLockHelper();
Enumeration enum = lock.enumerateLocks(st, node.getUri(), false);
while (enum.hasMoreElements()) {
NodeLock nl = (NodeLock)enum.nextElement();
if (nl != null) {
- v.addElement(new LockBean(nat, st, nl));
+ locks.add(new LockBean(nat, st, nl));
}
}
} catch (SlideException e) {
// ignore for now
}
- return v;
+ return locks;
}
@@ -299,26 +300,26 @@
/**
* Returns the permissions on the node.
*
- * @return a Vector of PermissionBean objects, or an empty Vector if
+ * @return a List of PermissionBean objects, or an empty List if
* no permissions exist for the node
*/
- public Vector getPermissions() {
+ public List getPermissions() {
- Vector v = new Vector();
+ List perms = new ArrayList();
try {
Security security = nat.getSecurityHelper();
Enumeration enum = security.enumeratePermissions(st, node);
while (enum.hasMoreElements()) {
NodePermission np = (NodePermission)enum.nextElement();
if (np != null) {
- v.addElement(new PermissionBean(nat, st, np));
+ perms.add(new PermissionBean(nat, st, np));
}
}
} catch (SlideException e) {
// ignore for now
}
- return v;
+ return perms;
}
@@ -423,12 +424,12 @@
/**
* Returns the revisions of the node.
*
- * @return a Vector of RevisionBean objects, or an empty Vector if the
+ * @return a List of RevisionBean objects, or an empty List if the
* node doesn't have revisions
*/
- public Vector getRevisions() {
+ public List getRevisions() {
- Vector v= new Vector();
+ List revisions = new ArrayList();
if (revisionDescriptors != null) {
Enumeration enum =
revisionDescriptors.enumerateRevisionNumbers();
@@ -437,12 +438,12 @@
(NodeRevisionNumber)enum.nextElement();
RevisionBean rw = getRevision(nrn);
if (rw != null) {
- v.addElement(rw);
+ revisions.add(rw);
}
}
}
- return v;
+ return revisions;
}
@@ -450,14 +451,14 @@
* Returns the roles of the node. This excludes the generic
* "nobody" role.
*
- * @return a Vector of roles as String objects
+ * @return a List of roles as String objects
*/
- public Vector getRoles() {
+ public List getRoles() {
NamespaceConfig nc = nat.getNamespaceConfig();
String nobody = nc.NOBODY;
- Vector v = new Vector();
+ List roles = new ArrayList();
Security security = nat.getSecurityHelper();
Enumeration enum = security.getRoles(node);
while (enum.hasMoreElements()) {
@@ -465,11 +466,11 @@
// exclude the nobody role from the list, as we only want "real"
// roles to show up in the list
if (!role.equals(nobody)) {
- v.addElement(role);
+ roles.add(role);
}
}
- return v;
+ return roles;
}
/**
1.5 +4 -7
jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/NamespaceBean.java
Index: NamespaceBean.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/NamespaceBean.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- NamespaceBean.java 28 Mar 2002 06:12:04 -0000 1.4
+++ NamespaceBean.java 1 Aug 2002 15:57:57 -0000 1.5
@@ -63,9 +63,6 @@
package org.apache.slide.taglib.bean;
-import java.util.Iterator;
-import java.util.Vector;
-
import org.apache.slide.common.NamespaceAccessToken;
import org.apache.slide.common.NamespaceConfig;
import org.apache.slide.common.SlideException;
1.6 +15 -15
jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/DomainBean.java
Index: DomainBean.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/DomainBean.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DomainBean.java 25 Apr 2002 21:12:25 -0000 1.5
+++ DomainBean.java 1 Aug 2002 15:57:58 -0000 1.6
@@ -63,14 +63,14 @@
package org.apache.slide.taglib.bean;
+import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.Vector;
+import java.util.List;
import org.apache.slide.authenticate.SecurityToken;
import org.apache.slide.common.Domain;
import org.apache.slide.common.NamespaceAccessToken;
import org.apache.slide.common.SlideToken;
-import org.apache.slide.taglib.bean.NamespaceBean;
/**
* Wraps around the Slide domain and provides a Java Bean style interface for
@@ -147,19 +147,19 @@
* Returns a Vector of NamespaceBeans representing all the namespaces
* in the Slide domain.
*
- * @return a Vector of NamespaceBean objects in no particular order
+ * @return a list of NamespaceBean objects
*
* @see #getNamespaceNames
*/
- public Vector getNamespaces() {
+ public List getNamespaces() {
- Vector namespaces = new Vector();
+ List namespaces = new ArrayList();
Enumeration enum = Domain.enumerateNamespaces();
while (enum.hasMoreElements()) {
String name = (String)enum.nextElement();
NamespaceBean bean = getNamespace(name);
if (bean != null) {
- namespaces.addElement(bean);
+ namespaces.add(bean);
}
}
@@ -170,17 +170,17 @@
/**
* Returns the names of all namespaces defined in the Slide domain.
*
- * @return a Vector of String objects in no particular order, each
- * containing the name of a namespace
+ * @return a List of String objects, each of which containing the name of a
+ * namespace
*
* @see #getNamespaces
*/
- public Vector getNamespaceNames() {
+ public List getNamespaceNames() {
- Vector names = new Vector();
+ List names = new ArrayList();
Enumeration enum = Domain.enumerateNamespaces();
while (enum.hasMoreElements()) {
- names.addElement((String)enum.nextElement());
+ names.add((String)enum.nextElement());
}
return names;
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>