Package org.apache.directory.shared.ldap.model.schema

Examples of org.apache.directory.shared.ldap.model.schema.Normalizer.normalize()


                        return comparator.compare( getNormValue(), other.getNormValue() ) == 0;
                    }
                    else
                    {
                        Normalizer normalizer = attributeType.getEquality().getNormalizer();
                        return comparator.compare( normalizer.normalize( getValue() ), normalizer.normalize( other.getValue() ) ) == 0;
                    }
                }
            }
            catch ( LdapException ne )
            {
View Full Code Here


                        return comparator.compare( getNormValue(), other.getNormValue() ) == 0;
                    }
                    else
                    {
                        Normalizer normalizer = attributeType.getEquality().getNormalizer();
                        return comparator.compare( normalizer.normalize( getValue() ), normalizer.normalize( other.getValue() ) ) == 0;
                    }
                }
            }
            catch ( LdapException ne )
            {
View Full Code Here

                       
                    try
                    {
                        if ( isHumanReadable() )
                        {    
                            normalizedValue = (T)normalizer.normalize( (String)wrappedValue );
                        }
                        else
                        {
                            normalizedValue = (T)normalizer.normalize( new BinaryValue( (byte[])wrappedValue ) ).getNormReference();
                        }
View Full Code Here

                        {    
                            normalizedValue = (T)normalizer.normalize( (String)wrappedValue );
                        }
                        else
                        {
                            normalizedValue = (T)normalizer.normalize( new BinaryValue( (byte[])wrappedValue ) ).getNormReference();
                        }
                    }
                    catch ( LdapException ne )
                    {
                        String message = I18n.err( I18n.ERR_04447_CANNOT_NORMALIZE_VALUE, ne.getLocalizedMessage() );
View Full Code Here

{
    @Test
    public void testTelephoneNumberNormalizerNull() throws LdapException
    {
        Normalizer normalizer = new TelephoneNumberNormalizer();
        assertEquals( "", normalizer.normalize( ( String ) null ) );
    }


    @Test
    public void testTelephoneNumberNormalizerEmpty() throws LdapException
View Full Code Here

    @Test
    public void testTelephoneNumberNormalizerEmpty() throws LdapException
    {
        Normalizer normalizer = new TelephoneNumberNormalizer();
        assertEquals( "", normalizer.normalize( "" ) );
    }


    @Test
    public void testTelephoneNumberNormalizerOneSpace() throws LdapException
View Full Code Here

    @Test
    public void testTelephoneNumberNormalizerOneSpace() throws LdapException
    {
        Normalizer normalizer = new TelephoneNumberNormalizer();
        assertEquals( "", normalizer.normalize( " " ) );
    }


    @Test
    public void testTelephoneNumberNormalizerTwoSpaces() throws LdapException
View Full Code Here

    @Test
    public void testTelephoneNumberNormalizerTwoSpaces() throws LdapException
    {
        Normalizer normalizer = new TelephoneNumberNormalizer();
        assertEquals( "", normalizer.normalize( "  " ) );
    }


    @Test
    public void testTelephoneNumberNormalizerNSpaces() throws LdapException
View Full Code Here

    @Test
    public void testTelephoneNumberNormalizerNSpaces() throws LdapException
    {
        Normalizer normalizer = new TelephoneNumberNormalizer();
        assertEquals( "", normalizer.normalize( "      " ) );
    }


    @Test
    public void testTelephoneNumberNormalizerOneHyphen() throws LdapException
View Full Code Here

         * We need to iterate through all values and for each value we normalize
         * and use the comparator to determine if a match exists.
         */
        Normalizer normalizer = getNormalizer( attributeType );
        Comparator comparator = getComparator( attributeType );
        Object filterValue = normalizer.normalize( node.getValue() );

        /*
         * Cheaper to not check isGreater in one loop - better to separate
         * out into two loops which you choose to execute based on isGreater
         */
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.