directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r224595 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/ExtensibleMatchFilter.java
Date Sun, 24 Jul 2005 09:55:28 GMT
Author: elecharny
Date: Sun Jul 24 02:55:24 2005
New Revision: 224595

URL: http://svn.apache.org/viewcvs?rev=224595&view=rev
Log:
- added a ToString method
- set some members transient

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/ExtensibleMatchFilter.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/ExtensibleMatchFilter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/ExtensibleMatchFilter.java?rev=224595&r1=224594&r2=224595&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/ExtensibleMatchFilter.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/ExtensibleMatchFilter.java
Sun Jul 24 02:55:24 2005
@@ -31,7 +31,7 @@
     //~ Instance fields ----------------------------------------------------------------------------
 
     /** The expected lenth of the Matching Rule Assertion */
-    private int expectedMatchingRuleLength;
+    private transient int expectedMatchingRuleLength;
 
     /** Matching rule  */
     private LdapString matchingRule;
@@ -156,5 +156,43 @@
     public void setExpectedMatchingRuleLength( int expectedMatchingRuleLength )
     {
         this.expectedMatchingRuleLength = expectedMatchingRuleLength;
+    }
+
+    /**
+     * Return a String representing an extended filter as of RFC 2254
+     *
+     * @return An Extened Filter String
+     */
+    public String toString()
+    {
+
+        StringBuffer sb = new StringBuffer();
+
+        if ( type != null )
+        {
+            sb.append( type.toString() );
+        }
+
+        if ( dnAttributes == true )
+        {
+            sb.append( ":dn" );
+        }
+
+        if ( matchingRule == null )
+        {
+
+            if ( type == null )
+            {
+                return "Extended Filter wrong syntax";
+            }
+        }
+        else
+        {
+            sb.append( ':' ).append( matchingRule.toString() );
+        }
+
+        sb.append( ":=" ).append( matchValue.toString() );
+
+        return sb.toString();
     }
 }



Mime
View raw message