geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1090151 - in /geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder: ./ filter/
Date Fri, 08 Apr 2011 07:43:52 GMT
Author: dblevins
Date: Fri Apr  8 07:43:52 2011
New Revision: 1090151

URL: http://svn.apache.org/viewvc?rev=1090151&view=rev
Log:
Proper toString() methods.  UrlSet now implements Iterable

Modified:
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/UrlSet.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ClassFilter.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ContainsFilter.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ExcludeIncludeFilter.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/FilterList.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/IncludeExcludeFilter.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PackageFilter.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PatternFilter.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PrefixFilter.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/SuffixFilter.java

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/UrlSet.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/UrlSet.java?rev=1090151&r1=1090150&r2=1090151&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/UrlSet.java (original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/UrlSet.java Fri
Apr  8 07:43:52 2011
@@ -21,6 +21,7 @@ import org.apache.xbean.finder.filter.Fi
 import java.net.URL;
 import java.net.MalformedURLException;
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -36,7 +37,7 @@ import static org.apache.xbean.finder.fi
 /**
  * @version $Rev$ $Date$
  */
-public class UrlSet {
+public class UrlSet implements Iterable<URL> {
 
     private final Map<String,URL> urls;
 
@@ -191,6 +192,15 @@ public class UrlSet {
         return new ArrayList<URL>(urls.values());
     }
 
+    public int size() {
+        return urls.size();
+    }
+
+    @Override
+    public Iterator<URL> iterator() {
+        return getUrls().iterator();
+    }
+
     private static List<URL> getUrls(ClassLoader classLoader) throws IOException {
         List<URL> list = new ArrayList<URL>();
         ArrayList<URL> urls = Collections.list(classLoader.getResources("META-INF"));
@@ -204,4 +214,9 @@ public class UrlSet {
         list.addAll(Collections.list(classLoader.getResources("")));
         return list;
     }
+
+    @Override
+    public String toString() {
+        return super.toString() + "[" + urls.size() + "]";
+    }
 }

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ClassFilter.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ClassFilter.java?rev=1090151&r1=1090150&r2=1090151&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ClassFilter.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ClassFilter.java
Fri Apr  8 07:43:52 2011
@@ -51,4 +51,11 @@ public class ClassFilter implements Filt
     public int hashCode() {
         return name.hashCode();
     }
+
+    @Override
+    public String toString() {
+        return "ClassFilter{" +
+                "name='" + name + '\'' +
+                '}';
+    }
 }
\ No newline at end of file

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ContainsFilter.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ContainsFilter.java?rev=1090151&r1=1090150&r2=1090151&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ContainsFilter.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ContainsFilter.java
Fri Apr  8 07:43:52 2011
@@ -51,4 +51,11 @@ public class ContainsFilter implements F
     public int hashCode() {
         return token.hashCode();
     }
+
+    @Override
+    public String toString() {
+        return "ContainsFilter{" +
+                "token='" + token + '\'' +
+                '}';
+    }
 }
\ No newline at end of file

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ExcludeIncludeFilter.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ExcludeIncludeFilter.java?rev=1090151&r1=1090150&r2=1090151&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ExcludeIncludeFilter.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/ExcludeIncludeFilter.java
Fri Apr  8 07:43:52 2011
@@ -35,4 +35,10 @@ public class ExcludeIncludeFilter implem
         if (exclude.accept(name)) return include.accept(name);
         return true;
     }
+
+    @Override
+    public String toString() {
+        return "Exclude." + exclude +
+                " Include." + include;
+    }
 }
\ No newline at end of file

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/FilterList.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/FilterList.java?rev=1090151&r1=1090150&r2=1090151&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/FilterList.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/FilterList.java
Fri Apr  8 07:43:52 2011
@@ -49,4 +49,11 @@ public class FilterList implements Filte
     public List<Filter> getFilters() {
         return filters;
     }
+
+    @Override
+    public String toString() {
+        return "FilterList{" +
+                "filters=" + filters +
+                '}';
+    }
 }

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/IncludeExcludeFilter.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/IncludeExcludeFilter.java?rev=1090151&r1=1090150&r2=1090151&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/IncludeExcludeFilter.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/IncludeExcludeFilter.java
Fri Apr  8 07:43:52 2011
@@ -36,4 +36,10 @@ public class IncludeExcludeFilter implem
         if (include.accept(name)) return !exclude.accept(name);
         return false;
     }
+
+    @Override
+    public String toString() {
+        return "Include." + include +
+                " Exclude." + exclude;
+    }
 }

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PackageFilter.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PackageFilter.java?rev=1090151&r1=1090150&r2=1090151&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PackageFilter.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PackageFilter.java
Fri Apr  8 07:43:52 2011
@@ -52,4 +52,11 @@ public class PackageFilter implements Fi
     public int hashCode() {
         return packageName.hashCode();
     }
+
+    @Override
+    public String toString() {
+        return "PackageFilter{" +
+                "package='" + packageName + '\'' +
+                '}';
+    }
 }
\ No newline at end of file

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PatternFilter.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PatternFilter.java?rev=1090151&r1=1090150&r2=1090151&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PatternFilter.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PatternFilter.java
Fri Apr  8 07:43:52 2011
@@ -57,4 +57,11 @@ public class PatternFilter implements Fi
     public int hashCode() {
         return pattern.hashCode();
     }
+
+    @Override
+    public String toString() {
+        return "PatternFilter{" +
+                "pattern=" + pattern +
+                '}';
+    }
 }

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PrefixFilter.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PrefixFilter.java?rev=1090151&r1=1090150&r2=1090151&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PrefixFilter.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/PrefixFilter.java
Fri Apr  8 07:43:52 2011
@@ -51,4 +51,11 @@ public class PrefixFilter implements Fil
     public int hashCode() {
         return prefix.hashCode();
     }
+
+    @Override
+    public String toString() {
+        return "PrefixFilter{" +
+                "prefix='" + prefix + '\'' +
+                '}';
+    }
 }
\ No newline at end of file

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/SuffixFilter.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/SuffixFilter.java?rev=1090151&r1=1090150&r2=1090151&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/SuffixFilter.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/filter/SuffixFilter.java
Fri Apr  8 07:43:52 2011
@@ -51,4 +51,11 @@ public class SuffixFilter implements Fil
     public int hashCode() {
         return suffix.hashCode();
     }
+
+    @Override
+    public String toString() {
+        return "SuffixFilter{" +
+                "suffix='" + suffix + '\'' +
+                '}';
+    }
 }
\ No newline at end of file



Mime
View raw message