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

Examples of org.apache.directory.shared.ldap.schema.parsers.LdapSyntaxDescription


        // set flag
        isObsoleteText.setEnabled( mrd != null && mrd.isObsolete() );

        // set syntax content
        String lsdOid = null;
        LdapSyntaxDescription lsd = null;
        if ( mrd != null )
        {
            Schema schema = getSchema();
            lsdOid = mrd.getSyntax();
            if ( lsdOid != null && schema.hasLdapSyntaxDescription( lsdOid ) )
            {
                lsd = schema.getLdapSyntaxDescription( lsdOid );
            }
        }
        syntaxLink.setText( getNonNullString( lsd != null ? lsd.getNumericOid() : lsdOid ) );
        syntaxLink.setHref( lsd );
        syntaxLink.setUnderlined( lsd != null );
        syntaxLink.setEnabled( lsd != null );
        syntaxDescText.setText( getNonNullString( lsd != null ? lsd.getDescription() : null ) );
        syntaxSection.layout();

        // create contents of dynamic sections
        createUsedFromContents( mrd );
        createRawContents( mrd );
View Full Code Here


        int pos = 0;
       
        for ( Value<?> value:attr )
        {
            LdapSyntaxDescription desc = null;
           
            try
            {
                desc = syntaxParser.parseLdapSyntaxDescription( value.getString() );
            }
            catch ( ParseException e )
            {
                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException(
                    "The following does not conform to the ldapSyntaxDescription syntax: " + value.getString(),
                    ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                iave.setRootCause( e );
                throw iave;
            }
           
            if ( ! dao.hasSyntaxChecker( desc.getNumericOid() ) )
            {
                throw new LdapOperationNotSupportedException(
                    "Cannot permit the addition of a syntax without the prior creation of a " +
                    "\nsyntaxChecker with the same object identifier of the syntax!",
                    ResultCodeEnum.UNWILLING_TO_PERFORM );
            }

            SyntaxImpl syntax = new SyntaxImpl( desc.getNumericOid(), globalRegistries.getSyntaxCheckerRegistry() );
            setSchemaObjectProperties( desc, syntax );
            syntax.setHumanReadable( isHumanReadable( desc ) );
            syntaxes[pos++] = syntax;
        }
       
View Full Code Here

        // check first to see if it is present in the subschemaSubentry
        // -------------------------------------------------------------------
       
        Attributes attrs = getSubschemaSubentryAttributes();
        Attribute attrTypes = attrs.get( "ldapSyntaxes" );
        LdapSyntaxDescription syntaxDescription = null;
        for ( int ii = 0; ii < attrTypes.size(); ii++ )
        {
            String desc = ( String ) attrTypes.get( ii );
            if ( desc.indexOf( oid ) != -1 )
            {
                syntaxDescription = ldapSyntaxDescriptionSchemaParser.parseLdapSyntaxDescription( desc );
                break;
            }
        }
    
        if ( isPresent )
        {
            assertNotNull( syntaxDescription );
            assertEquals( oid, syntaxDescription.getNumericOid() );
        }
        else
        {
            assertNull( syntaxDescription );
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.schema.parsers.LdapSyntaxDescription

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.