directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r329608 - /directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/BERDigester.java
Date Sun, 30 Oct 2005 19:51:59 GMT
Author: elecharny
Date: Sun Oct 30 11:51:55 2005
New Revision: 329608

URL: http://svn.apache.org/viewcvs?rev=329608&view=rev
Log:
Transmitting the binary HashSet to the constructor.

Modified:
    directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/BERDigester.java

Modified: directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/BERDigester.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/BERDigester.java?rev=329608&r1=329607&r2=329608&view=diff
==============================================================================
--- directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/BERDigester.java
(original)
+++ directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/BERDigester.java
Sun Oct 30 11:51:55 2005
@@ -23,6 +23,7 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.asn1.ber.BERDecoder;
 import org.apache.asn1.ber.BERDecoderCallback;
@@ -31,6 +32,7 @@
 import org.apache.asn1.codec.DecoderException;
 import org.apache.asn1.codec.stateful.AbstractStatefulDecoder;
 import org.apache.asn1.codec.stateful.StatefulDecoder;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.commons.collections.ArrayStack;
 import org.apache.commons.collections.primitives.BooleanStack;
 import org.apache.commons.collections.primitives.ByteStack;
@@ -107,12 +109,22 @@
     /** The monitor used by this digester */
     private BERDigesterMonitor monitor = null ;
 
+    private Set binaries;
+    
 
     /**
      * Creates a BER TLV event rulesBase.
      */
     public BERDigester()
     {
+        this( new HashSet() );
+    }
+
+    /**
+     * Creates a BER TLV event rulesBase.
+     */
+    public BERDigester( Set binaries )
+    {
         this.rules = new RulesBase() ;
         this.rules.setDigester( this ) ;
         this.tagStack = new IntStack() ;
@@ -128,6 +140,7 @@
         this.decoder = new BERDecoder() ;
         this.decoder.setCallback( new DigesterCallback() ) ;
         this.monitor = new BERDigesterLoggingMonitor() ;
+        this.binaries = binaries;
     }
     
     
@@ -1149,5 +1162,13 @@
                 }
             }
         }
+    }
+
+    /**
+     * @return Returns the binaries.
+     */
+    public boolean isBinary( String id )
+    {
+        return binaries.contains( StringUtils.lowerCase( StringUtils.trim( id ) ) );
     }
 }



Mime
View raw message