You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2005/06/16 08:00:51 UTC

svn commit: r190875 - in /directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter: AssertionNode.java BranchNode.java ExprNode.java ExtensibleNode.java PresenceNode.java ScopeNode.java SimpleNode.java SubstringNode.java

Author: akarasulu
Date: Wed Jun 15 23:00:50 2005
New Revision: 190875

URL: http://svn.apache.org/viewcvs?rev=190875&view=rev
Log:
applying new feature from Jacob on DIRLDAP-42

Modified:
    directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/AssertionNode.java
    directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/BranchNode.java
    directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ExprNode.java
    directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ExtensibleNode.java
    directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/PresenceNode.java
    directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ScopeNode.java
    directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/SimpleNode.java
    directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/SubstringNode.java

Modified: directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/AssertionNode.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/AssertionNode.java?rev=190875&r1=190874&r2=190875&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/AssertionNode.java (original)
+++ directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/AssertionNode.java Wed Jun 15 23:00:50 2005
@@ -1,19 +1,19 @@
-/*
- *   Copyright 2004 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.
- *   You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
- */
+/*
+ *   Copyright 2004 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.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
 
 /*
  * $Id: AssertionNode.java,v 1.4 2003/10/15 01:59:57 akarasulu Exp $
@@ -122,9 +122,9 @@
     /**
      * @see org.apache.ldap.common.filter.ExprNode#printToBuffer(java.lang.StringBuffer)
      */
-    public void printToBuffer( StringBuffer a_buf )
+    public StringBuffer printToBuffer( StringBuffer a_buf )
     {
-        a_buf.append( m_desc ).append( MAX_STR ) ;
+        return a_buf.append( m_desc ).append( MAX_STR ) ;
     }
 
 

Modified: directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/BranchNode.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/BranchNode.java?rev=190875&r1=190874&r2=190875&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/BranchNode.java (original)
+++ directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/BranchNode.java Wed Jun 15 23:00:50 2005
@@ -223,7 +223,7 @@
      *
      * @see org.apache.ldap.common.filter.ExprNode#printToBuffer(java.lang.StringBuffer)
      */
-    public void printToBuffer( StringBuffer a_buf )
+    public StringBuffer printToBuffer( StringBuffer a_buf )
     {
         a_buf.append( '(' ) ;
 
@@ -260,6 +260,8 @@
         {
             a_buf.append( ' ' ) ;
         }
+        
+        return a_buf;
     }
 
 

Modified: directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ExprNode.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ExprNode.java?rev=190875&r1=190874&r2=190875&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ExprNode.java (original)
+++ directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ExprNode.java Wed Jun 15 23:00:50 2005
@@ -1,19 +1,19 @@
-/*
- *   Copyright 2004 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.
- *   You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
- */
+/*
+ *   Copyright 2004 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.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
 
 /*
  * $Id: ExprNode.java,v 1.5 2003/10/14 02:22:56 akarasulu Exp $
@@ -66,7 +66,7 @@
      *
      * @param a_buf the buffer to append to.
      */
-    void printToBuffer( StringBuffer a_buf ) ;
+    StringBuffer printToBuffer( StringBuffer a_buf ) ;
 
     /**
      * Element/node accept method for visitor pattern.

Modified: directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ExtensibleNode.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ExtensibleNode.java?rev=190875&r1=190874&r2=190875&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ExtensibleNode.java (original)
+++ directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ExtensibleNode.java Wed Jun 15 23:00:50 2005
@@ -1,151 +1,153 @@
-/*
- *   Copyright 2004 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.
- *   You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
- */
-
-/*
- * $Id: ExtensibleNode.java,v 1.4 2003/10/14 04:59:23 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-package org.apache.ldap.common.filter;
-
-
-/**
- * Filter expression tree node for extensible assertions.
- *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $author$
- * @version $Revision$
- */
-public class ExtensibleNode extends LeafNode
-{
-    /** The value of the attribute to match for */
-    private final String value;
-    /** The matching rules id */
-    private final String m_matchingRuleId ;
-
-    /** The name of the dn attributes */
-    private boolean m_dnAttributes = false ;
-
- 
-    /**
-     * Creates a new ExtensibleNode object.
-     *
-     * @param a_attribute the attribute used for the extensible assertion
-     * @param a_value the value to match for
-     * @param a_matchingRuleId the OID of the matching rule
-     * @param a_dnAttributes the dn attributes
-     */
-    public ExtensibleNode( String a_attribute, String a_value,
-        String a_matchingRuleId, boolean a_dnAttributes )
-    {
-        super( a_attribute, EXTENSIBLE ) ;
-
-        this.value = a_value ;
-        m_matchingRuleId = a_matchingRuleId ;
-        this.m_dnAttributes = a_dnAttributes ;
-    }
-
-
-    /**
-     * Gets the Dn attributes.
-     *
-     * @return the dn attributes
-     */
-    public boolean dnAttributes(  )
-    {
-        return m_dnAttributes ;
-    }
-
-
-    /**
-     * Gets the matching rule id as an OID string.
-     *
-     * @return the OID 
-     */
-    public String getMatchingRuleId(  )
-    {
-        return m_matchingRuleId ;
-    }
-
-
-    /**
-     * Gets the value.
-     *
-     * @return the value
-     */
-    public final String getValue()
-    {
-        return value ;
-    }
-
-
-    /**
-     * @see org.apache.ldap.common.filter.ExprNode#printToBuffer(
-     * java.lang.StringBuffer)
-     */
-    public void printToBuffer( StringBuffer a_buf )
-    {
-        a_buf.append( '(' ).append( getAttribute() );
-        a_buf.append( "-" );
-        a_buf.append( this.m_dnAttributes );
-        a_buf.append( "-EXTENSIBLE-" );
-        a_buf.append( this.m_matchingRuleId );
-        a_buf.append( "-" );
-        a_buf.append( this.value );
-        a_buf.append( ')' );
-
-        if ( ( null != getAnnotations() )
-                && getAnnotations().containsKey( "count" ) )
-        {
-            a_buf.append( '[' );
-            a_buf.append( getAnnotations().get( "count" ).toString() );
-            a_buf.append( "] " );
-        }
-        else
-        {
-            a_buf.append( ' ' );
-        }
-    }
-
-
-    /**
-     * @see java.lang.Object#toString()
-     */
-    public String toString()
-    {
-        StringBuffer l_buf = new StringBuffer() ;
-        printToBuffer( l_buf ) ;
-
-        return ( l_buf.toString() ) ;
-    }
-
-
-    /**
-     * @see org.apache.ldap.common.filter.ExprNode#accept(
-     * org.apache.ldap.common.filter.FilterVisitor)
-     */
-    public void accept( FilterVisitor a_visitor )
-    {
-        if ( a_visitor.canVisit( this ) )
-        {
-            a_visitor.visit( this ) ;
-        }
-    }
-}
+/*
+ *   Copyright 2004 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.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+
+/*
+ * $Id: ExtensibleNode.java,v 1.4 2003/10/14 04:59:23 akarasulu Exp $
+ *
+ * -- (c) LDAPd Group                                                    --
+ * -- Please refer to the LICENSE.txt file in the root directory of      --
+ * -- any LDAPd project for copyright and distribution information.      --
+ *
+ */
+package org.apache.ldap.common.filter;
+
+
+/**
+ * Filter expression tree node for extensible assertions.
+ *
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $author$
+ * @version $Revision$
+ */
+public class ExtensibleNode extends LeafNode
+{
+    /** The value of the attribute to match for */
+    private final String value;
+    /** The matching rules id */
+    private final String m_matchingRuleId ;
+
+    /** The name of the dn attributes */
+    private boolean m_dnAttributes = false ;
+
+ 
+    /**
+     * Creates a new ExtensibleNode object.
+     *
+     * @param a_attribute the attribute used for the extensible assertion
+     * @param a_value the value to match for
+     * @param a_matchingRuleId the OID of the matching rule
+     * @param a_dnAttributes the dn attributes
+     */
+    public ExtensibleNode( String a_attribute, String a_value,
+        String a_matchingRuleId, boolean a_dnAttributes )
+    {
+        super( a_attribute, EXTENSIBLE ) ;
+
+        this.value = a_value ;
+        m_matchingRuleId = a_matchingRuleId ;
+        this.m_dnAttributes = a_dnAttributes ;
+    }
+
+
+    /**
+     * Gets the Dn attributes.
+     *
+     * @return the dn attributes
+     */
+    public boolean dnAttributes(  )
+    {
+        return m_dnAttributes ;
+    }
+
+
+    /**
+     * Gets the matching rule id as an OID string.
+     *
+     * @return the OID 
+     */
+    public String getMatchingRuleId(  )
+    {
+        return m_matchingRuleId ;
+    }
+
+
+    /**
+     * Gets the value.
+     *
+     * @return the value
+     */
+    public final String getValue()
+    {
+        return value ;
+    }
+
+
+    /**
+     * @see org.apache.ldap.common.filter.ExprNode#printToBuffer(
+     * java.lang.StringBuffer)
+     */
+    public StringBuffer printToBuffer( StringBuffer a_buf )
+    {
+        a_buf.append( '(' ).append( getAttribute() );
+        a_buf.append( "-" );
+        a_buf.append( this.m_dnAttributes );
+        a_buf.append( "-EXTENSIBLE-" );
+        a_buf.append( this.m_matchingRuleId );
+        a_buf.append( "-" );
+        a_buf.append( this.value );
+        a_buf.append( ')' );
+
+        if ( ( null != getAnnotations() )
+                && getAnnotations().containsKey( "count" ) )
+        {
+            a_buf.append( '[' );
+            a_buf.append( getAnnotations().get( "count" ).toString() );
+            a_buf.append( "] " );
+        }
+        else
+        {
+            a_buf.append( ' ' );
+        }
+        
+        return a_buf;
+    }
+
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        StringBuffer l_buf = new StringBuffer() ;
+        printToBuffer( l_buf ) ;
+
+        return ( l_buf.toString() ) ;
+    }
+
+
+    /**
+     * @see org.apache.ldap.common.filter.ExprNode#accept(
+     * org.apache.ldap.common.filter.FilterVisitor)
+     */
+    public void accept( FilterVisitor a_visitor )
+    {
+        if ( a_visitor.canVisit( this ) )
+        {
+            a_visitor.visit( this ) ;
+        }
+    }
+}

Modified: directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/PresenceNode.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/PresenceNode.java?rev=190875&r1=190874&r2=190875&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/PresenceNode.java (original)
+++ directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/PresenceNode.java Wed Jun 15 23:00:50 2005
@@ -1,19 +1,19 @@
-/*
- *   Copyright 2004 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.
- *   You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
- */
+/*
+ *   Copyright 2004 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.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
 
 /*
  * $Id: PresenceNode.java,v 1.7 2003/10/14 04:59:23 akarasulu Exp $
@@ -51,7 +51,7 @@
     /**
      * @see org.apache.ldap.common.filter.ExprNode#printToBuffer(java.lang.StringBuffer)
      */
-    public void printToBuffer( StringBuffer a_buf )
+    public StringBuffer printToBuffer( StringBuffer a_buf )
     {
         a_buf.append( '(' ).append( getAttribute() ).append( "=*" ) ;
 
@@ -68,6 +68,8 @@
         {
             a_buf.append( ' ' ) ;
         }
+        
+        return a_buf;
     }
 
 

Modified: directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ScopeNode.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ScopeNode.java?rev=190875&r1=190874&r2=190875&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ScopeNode.java (original)
+++ directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/ScopeNode.java Wed Jun 15 23:00:50 2005
@@ -126,7 +126,7 @@
     /**
      * @see ExprNode#printToBuffer(StringBuffer)
      */
-    public void printToBuffer( StringBuffer buf )
+    public StringBuffer printToBuffer( StringBuffer buf )
     {
         switch ( this.scope )
         {
@@ -156,6 +156,8 @@
             buf.append( getAnnotations().get( "count" ).toString() );
             buf.append( ']' );
         }
+        
+        return buf;
     }
 
 

Modified: directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/SimpleNode.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/SimpleNode.java?rev=190875&r1=190874&r2=190875&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/SimpleNode.java (original)
+++ directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/SimpleNode.java Wed Jun 15 23:00:50 2005
@@ -98,7 +98,7 @@
      * @see org.apache.ldap.common.filter.ExprNode#printToBuffer(
      * java.lang.StringBuffer)
      */
-    public void printToBuffer( StringBuffer a_buf )
+    public StringBuffer printToBuffer( StringBuffer a_buf )
     {
         a_buf.append( '(' ).append( getAttribute() ) ;
 
@@ -143,6 +143,8 @@
         {
             a_buf.append( ' ' ) ;
         }
+        
+        return a_buf;
     }
 
 

Modified: directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/SubstringNode.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/SubstringNode.java?rev=190875&r1=190874&r2=190875&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/SubstringNode.java (original)
+++ directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/filter/SubstringNode.java Wed Jun 15 23:00:50 2005
@@ -202,7 +202,7 @@
     /**
      * @see org.apache.ldap.common.filter.ExprNode#printToBuffer(java.lang.StringBuffer)
      */
-    public void printToBuffer( StringBuffer a_buf )
+    public StringBuffer printToBuffer( StringBuffer a_buf )
     {
         a_buf.append( '(' ).append( getAttribute() ).append( '=' ) ;
 
@@ -242,6 +242,8 @@
         {
             a_buf.append( ' ' ) ;
         }
+        
+        return a_buf;
     }