directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r580988 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap: name/LdapDN.java schema/Normalizer.java schema/OidNormalizer.java
Date Mon, 01 Oct 2007 15:16:35 GMT
Author: elecharny
Date: Mon Oct  1 08:16:35 2007
New Revision: 580988

URL: http://svn.apache.org/viewvc?rev=580988&view=rev
Log:
Using generics for Normalizer

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/OidNormalizer.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java?rev=580988&r1=580987&r2=580988&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
Mon Oct  1 08:16:35 2007
@@ -34,6 +34,7 @@
 import javax.naming.NamingException;
 
 import org.apache.directory.shared.ldap.name.DefaultStringNormalizer;
+import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -1422,7 +1423,7 @@
                 {
                     return new AttributeTypeAndValue( atav.getUpType(), oidNormalizer.getAttributeTypeOid(),

                     		atav.getUpValue(),
-                    		oidNormalizer.getNormalizer().normalize( atav.getValue() ) );
+                    		((Normalizer<Object>)oidNormalizer.getNormalizer()).normalize(
atav.getValue() ) );
 
                 }
                 else
@@ -1457,7 +1458,7 @@
         Object normValue = DefaultStringNormalizer.normalizeString( ( String ) upValue );
 
         rdn.addAttributeTypeAndValue( upType, oidNormalizer.getAttributeTypeOid(), upValue,

-                oidNormalizer.getNormalizer().normalize( normValue ) );
+            ((Normalizer<Object>)oidNormalizer.getNormalizer()).normalize( normValue
) );
 
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java?rev=580988&r1=580987&r2=580988&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
Mon Oct  1 08:16:35 2007
@@ -31,16 +31,15 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface Normalizer extends Serializable
+public interface Normalizer<T> extends Serializable
 {
     /**
      * Gets the normalized value.
      * 
-     * @param value
-     *            the value to normalize. It must *not* be null !
+     * @param value the value to normalize. It must *not* be null !
      * @return the normalized form for a value
      * @throws NamingException
      *             if an error results during normalization
      */
-    Object normalize( Object value ) throws NamingException;
+    T normalize( T value ) throws NamingException;
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/OidNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/OidNormalizer.java?rev=580988&r1=580987&r2=580988&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/OidNormalizer.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/OidNormalizer.java
Mon Oct  1 08:16:35 2007
@@ -33,7 +33,7 @@
     private String attributeTypeOid;
 
     /** The normalizer to be used with this OID */
-    private Normalizer normalizer;
+    private Normalizer<?> normalizer;
 
 
     /**
@@ -42,7 +42,7 @@
      * @param attributeTypeOid the oid of the attributeType mapped to the normalizer
      * @param normalizer the associated equality match based normalizer
      */
-    public OidNormalizer( String attributeTypeOid, Normalizer normalizer )
+    public OidNormalizer( String attributeTypeOid, Normalizer<?> normalizer )
     {
         this.attributeTypeOid = attributeTypeOid;
         this.normalizer = normalizer;
@@ -66,7 +66,7 @@
      * 
      * @return The normalizer associated to the current OID
      */
-    public Normalizer getNormalizer()
+    public Normalizer<?> getNormalizer()
     {
         return normalizer;
     }



Mime
View raw message