Examples of SyntaxChecker


Examples of org.apache.directory.shared.ldap.model.schema.SyntaxChecker

        // get the byteCode
        Attribute byteCode = getByteCode( syntaxCheckerDescription, SchemaConstants.SYNTAX_CHECKER );

        // Class load the SyntaxChecker
        SyntaxChecker syntaxChecker = classLoadSyntaxChecker( schemaManager, oid, fqcn, byteCode );

        // Update the common fields
        setSchemaObjectProperties( syntaxChecker, syntaxCheckerDescription, schema );

        return syntaxChecker;
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.SyntaxChecker

     *
     * @throws Exception on errors
     */
    @Test public void testConstrainedString()
    {
        s.setSyntaxChecker( new SyntaxChecker( "1.1.1.1" ) {
            private static final long serialVersionUID = 0L;

            public boolean isValidSyntax( Object value )
            {
                if ( value instanceof String )
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.SyntaxChecker

     * @param value the binary value to wrap which may be null, or a zero length byte array
     */
    public BinaryValue( AttributeType attributeType, byte[] value )
    {
        this( attributeType );
        SyntaxChecker syntaxChecker = attributeType.getSyntax().getSyntaxChecker();

        if ( syntaxChecker != null )
        {
            if ( syntaxChecker.isValidSyntax( value ) )
            {
                this.wrappedValue = value;
            }
            else
            {
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.SyntaxChecker

    /* no protection*/ static AttributeType getCaseIgnoringAttributeNoNumbersType()
    {
        AttributeType attributeType = new AttributeType( "1.1.3.1" );
        LdapSyntax syntax = new LdapSyntax( "1.1.1.1", "", true );

        syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2.1" )
        {
            private static final long serialVersionUID = 0L;

            public boolean isValidSyntax( Object value )
            {
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.SyntaxChecker

    {
        AttributeType attributeType = new AttributeType( "1.1" );
        attributeType.addName( "1.1" );
        LdapSyntax syntax = new LdapSyntax( "1.1.1", "", true );

        syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2" )
        {
            private static final long serialVersionUID = 0L;

            public boolean isValidSyntax( Object value )
            {
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.SyntaxChecker

    /* No protection */ static AttributeType getBytesAttributeType()
    {
        AttributeType attributeType = new AttributeType( "1.2" );
        LdapSyntax syntax = new LdapSyntax( "1.2.1", "", true );

        syntax.setSyntaxChecker( new SyntaxChecker( "1.2.1" )
        {
            private static final long serialVersionUID = 0L;

            public boolean isValidSyntax( Object value )
            {
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.SyntaxChecker

            return valid;
        }

        if ( attributeType != null )
        {
            SyntaxChecker syntaxChecker = attributeType.getSyntax().getSyntaxChecker();
            T value = getNormalizedValue();
            valid = syntaxChecker.isValidSyntax( value );
        }
        else
        {
            valid = false;
        }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.SyntaxChecker

    private SyntaxChecker classLoadSyntaxChecker( SchemaManager schemaManager, String oid, String className, EntryAttribute byteCode )
        throws Exception
    {
        // Try to class load the syntaxChecker
        Class<?> clazz = null;
        SyntaxChecker syntaxChecker = null;
        String byteCodeStr = StringConstants.EMPTY;

        if ( byteCode == null )
        {
            clazz = Class.forName( className );
        }
        else
        {
            classLoader.setAttribute( byteCode );
            clazz = classLoader.loadClass( className );
            byteCodeStr = new String( Base64.encode(byteCode.getBytes()) );
        }

        // Create the syntaxChecker instance
        syntaxChecker = ( SyntaxChecker ) clazz.newInstance();

        // Update the common fields
        syntaxChecker.setBytecode( byteCodeStr );
        syntaxChecker.setFqcn( className );

        // Inject the new OID, as the loaded syntaxChecker might have its own
        syntaxChecker.setOid( oid );

        // Inject the SchemaManager for the comparator who needs it
        syntaxChecker.setSchemaManager( schemaManager );
       
        return syntaxChecker;
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.SyntaxChecker

        EntryAttribute byteCode = entry.get( MetaSchemaConstants.M_BYTECODE_AT );

        try
        {
            // Class load the syntaxChecker
            SyntaxChecker syntaxChecker = classLoadSyntaxChecker( schemaManager, oid, className, byteCode );
   
            // Update the common fields
            setSchemaObjectProperties( syntaxChecker, entry, schema );
   
            // return the resulting syntaxChecker
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.SyntaxChecker

        // get the byteCode
        EntryAttribute byteCode = getByteCode( syntaxCheckerDescription, SchemaConstants.SYNTAX_CHECKER );

        // Class load the SyntaxChecker
        SyntaxChecker syntaxChecker = classLoadSyntaxChecker( schemaManager, oid, fqcn, byteCode );

        // Update the common fields
        setSchemaObjectProperties( syntaxChecker, syntaxCheckerDescription, schema );

        return syntaxChecker;
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.