Examples of SubstringNode


Examples of org.apache.directory.shared.ldap.model.filter.SubstringNode

        ExprNode filter = searchRequest.getFilter();

        assertTrue( filter instanceof SubstringNode );

        SubstringNode substringFilter = ( SubstringNode ) filter;

        assertEquals( "DSMLv2.0 rocks!!", substringFilter.getFinal().toString() );
    }
View Full Code Here

Examples of org.apache.ldap.common.filter.SubstringNode

    public NamingEnumeration enumerate( final ExprNode node )
        throws NamingException
    {
        RE regex = null;
        Index idx = null;
        final SubstringNode snode = ( SubstringNode ) node;
        AttributeType type = attributeTypeRegistry.lookup( snode.getAttribute() );
        Normalizer normalizer = type.getSubstr().getNormalizer();

        if ( db.hasUserIndexOn( snode.getAttribute() ) )
        {
            /*
             * Build out regex in this block so we do not do it twice in the
             * evaluator if there is no index on the attribute of the substr ava
             */
            try
            {
                regex = snode.getRegex( normalizer );
            }
            catch ( RESyntaxException e )
            {
                NamingException ne = new NamingException( "SubstringNode '"
                    + node + "' had incorrect syntax" );
                ne.setRootCause( e );
                throw ne;
            }

            /*
             * Get the user index and return an index enumeration using the the
             * compiled regular expression.  Try to constrain even further if
             * an initial term is available in the substring expression.
             */
            idx = db.getUserIndex( snode.getAttribute() );
            if ( null == snode.getInitial() )
            {
                return idx.listIndices( regex );
            }
            else
            {
                return idx.listIndices( regex, snode.getInitial() );
            }
        }
       
        /*
         * From this point on we are dealing with an enumeration over entries
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.