directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r345788 - /directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/primitives/DNParser.java
Date Sun, 20 Nov 2005 22:36:37 GMT
Author: elecharny
Date: Sun Nov 20 14:36:33 2005
New Revision: 345788

URL: http://svn.apache.org/viewcvs?rev=345788&view=rev
Log:
The DNParser class implements NameParser

Modified:
    directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/primitives/DNParser.java

Modified: directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/primitives/DNParser.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/primitives/DNParser.java?rev=345788&r1=345787&r2=345788&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/primitives/DNParser.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/primitives/DNParser.java
Sun Nov 20 14:36:33 2005
@@ -19,9 +19,11 @@
 import java.util.List;
 
 import javax.naming.InvalidNameException;
+import javax.naming.Name;
 
 import org.apache.asn1new.ldap.codec.utils.DNUtils;
 import org.apache.asn1.codec.util.StringUtils;
+import javax.naming.NameParser ;
 
 /**
  * This class parses a DN. 
@@ -53,7 +55,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DNParser
+public class DNParser implements NameParser
 {
     public static void parse( String dn, List rdns ) throws InvalidNameException
     {
@@ -97,6 +99,11 @@
             throw new InvalidNameException( "Bad DN : " + new String( chars ) );
         }
     }
+    
+    private static Name internalParse( String dn ) throws InvalidNameException
+    {
+        return new LdapDN( dn );
+    }
 
     /**
      * Parse a String and return a LdapDN if the String is a valid DN
@@ -104,8 +111,8 @@
      * @return A LdapDN
      * @throws InvalidNameException If the String is not a valid DN
      */
-    public static LdapDN parse( String dn ) throws InvalidNameException
+    public Name parse( String dn ) throws InvalidNameException
     {
-        return new LdapDN( dn );
+        return DNParser.internalParse( dn );
     }
 }



Mime
View raw message