jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r209747 - /incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/util/ChildrenCollectorFilter.java
Date Fri, 08 Jul 2005 12:36:35 GMT
Author: stefan
Date: Fri Jul  8 05:36:34 2005
New Revision: 209747

URL: http://svn.apache.org/viewcvs?rev=209747&view=rev
Log:
ChildrenCollectorFilter: making matches() public and extend javadoc 

Modified:
    incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/util/ChildrenCollectorFilter.java

Modified: incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/util/ChildrenCollectorFilter.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/util/ChildrenCollectorFilter.java?rev=209747&r1=209746&r2=209747&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/util/ChildrenCollectorFilter.java
(original)
+++ incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/util/ChildrenCollectorFilter.java
Fri Jul  8 05:36:34 2005
@@ -84,7 +84,7 @@
     }
 
     /**
-     * Applies the name pattern against the specified name.
+     * Matches the name pattern against the specified name.
      * <p/>
      * The pattern may be a full name or a partial name with one or more
      * wildcard characters ("*"), or a disjunction (using the "|" character
@@ -95,12 +95,28 @@
      * would match
      * <p/>
      * <code>"foo:bar"</code>, but also <code>"jcr:whatever"</code>.
+     * <p/>
+     * <pre>
+     * The EBNF for pattern is:
+     *
+     * namePattern ::= disjunct {'|' disjunct}
+     * disjunct ::= name [':' name]
+     * name ::= '*' |
+     *          ['*'] fragment {'*' fragment}['*']
+     * fragment ::= char {char}
+     * char ::= nonspace | ' '
+     * nonspace ::= (* Any Unicode character except:
+     *               '/', ':', '[', ']', '*',
+     *               ''', '"', '|' or any whitespace
+     *               character *)
+     * </pre>
      *
      * @param name the name to test the pattern with
+     * @param pattern the pattern to be matched against the name
      * @return true if the specified name matches the pattern
+     * @see javax.jcr.Node#getNodes(String)
      */
-    static boolean matches(String name, String pattern) {
-        // @todo check if pattern matching conforms with spec
+    public static boolean matches(String name, String pattern) {
         // split pattern
         StringTokenizer st = new StringTokenizer(pattern, OR, false);
         while (st.hasMoreTokens()) {
@@ -122,7 +138,8 @@
      * @param pOff    offset within <code>pattern</code>.
      * @return true if <code>s</code> matched pattern, else false.
      */
-    private static boolean internalMatches(String s, String pattern, int sOff, int pOff)
{
+    private static boolean internalMatches(String s, String pattern,
+                                           int sOff, int pOff) {
         int pLen = pattern.length();
         int sLen = s.length();
 



Mime
View raw message