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

Examples of org.apache.directory.shared.ldap.model.entry.StringValue


    {
        try
        {
            String normalized = PrepareString.normalize( value.getString(), PrepareString.StringType.DIRECTORY_STRING );

            return new StringValue( normalized );
        }
        catch ( IOException ioe )
        {
            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_04224, value ) );
        }
View Full Code Here


           
            if ( sharpPos > 0 )
            {
                Dn dn = new Dn( nameAndUid.substring( 0, sharpPos ), schemaManager );
               
                return new StringValue( dn.getNormName() + '#' + uid );
            }
            else
            {
                throw new IllegalStateException( I18n.err( I18n.ERR_04226, value.getClass() ) );
            }
        }
        else
        {
            // No UID, the strValue is a Dn
            // Return the normalized Dn
            return new StringValue( new Dn( nameAndUid ).getNormName() );
        }
    }
View Full Code Here

       
        String dnStr = value.getString();
       
        dn = new Dn( dnStr, schemaManager );
       
        return new StringValue( dn.getNormName() );
    }
View Full Code Here

       try
       {
           String normalized = PrepareString.normalize( value.getString(),
               PrepareString.StringType.NUMERIC_STRING );
          
           return new StringValue( normalized );
       }
       catch ( IOException ioe )
       {
           throw new LdapInvalidDnException( I18n.err( I18n.ERR_04224, value ) );
       }
View Full Code Here

       try
       {
           String normalized = PrepareString.normalize( value.getString(),
               PrepareString.StringType.TELEPHONE_NUMBER );
          
           return new StringValue( normalized );
       }
       catch ( IOException ioe )
       {
           throw new LdapInvalidDnException( I18n.err( I18n.ERR_04224, value ) );
       }
View Full Code Here

        String str = value.getString().trim();

        if ( str.length() == 0 )
        {
            return new StringValue( "" );
        }
        else if ( Character.isDigit( str.charAt( 0 ) ) )
        {
            // We do this test to avoid a lowerCasing which cost time
            return new StringValue( str );
        }
        else
        {
            return new StringValue( str.toLowerCase() );
        }
    }
View Full Code Here

    {
        try
        {
            String normalized = PrepareString.normalize( value.getString(), PrepareString.StringType.DIRECTORY_STRING );

            return new StringValue( normalized );
        }
        catch ( IOException ioe )
        {
            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_04224, value ) );
        }
View Full Code Here

                    sb.append( digit.toUpperCase() );
                }
            }

            return new StringValue( sb.toString() );
        }

        val = ( (StringValue) value ).getString();
       
        for ( int i = 0; i < val.length(); i++ )
        {
            char ch = val.charAt( i );
            String replace = null;

            switch ( ch )
            {
                case '*':
                    replace = "\\2A";
                    break;
                   
                case '(':
                    replace = "\\28";
                    break;
                   
                case ')':
                    replace = "\\29";
                    break;
                   
                case '\\':
                    replace = "\\5C";
                    break;
                   
                case '\0':
                    replace = "\\00";
                    break;
            }
           
            if ( replace != null )
            {
                if ( sb == null )
                {
                    sb = new StringBuilder( val.length() * 2 );
                    sb.append( val.substring( 0, i ) );
                }
                sb.append( replace );
            }
            else if ( sb != null )
            {
                sb.append( ch );
            }
        }

        return ( sb == null ? value : new StringValue( sb.toString() ) );
    }
View Full Code Here

     */
    public Rdn(String upType, String normType, String upValue, String normValue, SchemaManager schemaManager) throws LdapInvalidDnException
    {
        this.schemaManager = schemaManager;

        addAVA( upType, normType, new StringValue( upValue ), new StringValue( normValue ) );

        upName = upType + '=' + upValue;
        start = 0;
        length = upName.length();

View Full Code Here

     * @param schemaManager the schema manager
     * @throws LdapInvalidDnException if the Rdn is invalid
     */
    public Rdn(String upType, String upValue, SchemaManager schemaManager) throws LdapInvalidDnException
    {
        addAVA( upType, upType, new StringValue( upValue ), new StringValue( upValue ) );

        upName = upType + '=' + upValue;
        start = 0;
        length = upName.length();

View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.entry.StringValue

Copyright © 2018 www.massapicom. 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.