Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 77994 invoked from network); 24 Jul 2005 09:55:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Jul 2005 09:55:32 -0000 Received: (qmail 19417 invoked by uid 500); 24 Jul 2005 09:55:31 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 19364 invoked by uid 500); 24 Jul 2005 09:55:31 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 19351 invoked by uid 99); 24 Jul 2005 09:55:30 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Jul 2005 02:55:30 -0700 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 24 Jul 2005 02:55:24 -0700 Received: (qmail 77943 invoked by uid 65534); 24 Jul 2005 09:55:29 -0000 Message-ID: <20050724095529.77942.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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(); } }