/** * Parse an LDAP filter expression. * * @param filter an LDAP filter as defined by <a href="http://www.ietf.org/rfc/rfc2254.txt">RFC2254</a> * @return the parsed filter * @throws ParseException if the filter is syntactically incorrect */ public static FilterExpression parse(String filter) throws ParseException { return buildExpression(FilterParser.parse(filter)); } }
/** * Parse an LDAP filter expression. * * @param filter an LDAP filter as defined by <a href="http://www.ietf.org/rfc/rfc2254.txt">RFC2254</a> * @return the parsed filter * @throws ParseException if the filter is syntactically incorrect */ public static FilterExpression parse(String filter) throws ParseException { return buildExpression(FilterParser.parse(filter)); } }
/** * Parse an LDAP filter expression. * * @param filter an LDAP filter as defined by <a href="http://www.ietf.org/rfc/rfc2254.txt">RFC2254</a> * @return the parsed filter * @throws ParseException if the filter is syntactically incorrect */ public static FilterExpression parse(String filter) throws ParseException { return buildExpression(FilterParser.parse(filter)); } }
/** * Normalizes a filter expression to a canonical representation while * retaining logical meaning of the expression. * * @param filter * the filter to normalize * @return the normalized version of the filter * @throws java.text.ParseException * if the filter is malformed */ public static String getNormalizedFilter( String filter ) throws ParseException { ExprNode originalNode = FilterParser.parse( filter ); return getNormalizedFilter( originalNode ); }
FilterParser.parse( filter );
/** * Check whether a raw string filter expression matches on the given LDAP entry. * * @param attributes the ldap entry to match * @param filter a raw string filter expression (eg. <tt>(!(&(attr1=*)(attr2=value2)(attr3=val*)))</tt> ) * @return true if the ldap entry matches the filter */ public boolean match(Attributes attributes, String filter) { if (filter == null || "".equals(filter)) { return true; } try { ExprNode parsedFilter = parser.parse(filter); return recursiveMatch(attributes, parsedFilter); } catch (DirectoryException | IOException | ParseException e) { throw new DirectoryException("could not parse LDAP filter: " + filter, e); } }
public final void filter() throws RecognitionException, TokenStreamException { Token filterToken = null; log.debug( "entered filter()" ); try { // for error handling { filterToken = LT(1); match(FILTER); FilterParser.parse( filterToken.getText() ); } } catch (Exception e) { throw new RecognitionException( "filterParser failed. " + e.getMessage() ); } }
public final ExprNode filter() throws RecognitionException, TokenStreamException { ExprNode filterExpr = null ; Token filterToken = null; log.debug( "entered filter()" ); try { // for error handling { filterToken = LT(1); match(FILTER); filterExpr=FilterParser.parse( filterToken.getText() ); } } catch (Exception e) { throw new RecognitionException( "filterParser failed. " + e.getMessage() ); } return filterExpr; }
public final void rangeOfValues() throws RecognitionException, TokenStreamException { Token token = null; log.debug( "entered rangeOfValues()" ); try { // for error handling token = LT(1); match(RANGE_OF_VALUES_CANDIDATE); protectedItemsMap.put( "rangeOfValues", new ProtectedItem.RangeOfValues( FilterParser.parse( token.getText() ) ) ); log.debug( "filterParser parsed " + token.getText() ); } catch (Exception e) { throw new RecognitionException( "filterParser failed. " + e.getMessage() ); } }
root = parser.parse( filter );
root = FilterParser.parse( filter );
public boolean doAnnotate( String filter ) throws Exception { ExprNode root; try { root = FilterParser.parse( filter ); } catch ( Exception e ) { JTextArea text = new JTextArea(); String msg = e.getLocalizedMessage(); if ( msg.length() > 1024 ) { msg = msg.substring( 0, 1024 ) + "\n. . . truncated . . ."; } text.setText( msg ); text.setEnabled( false ); JOptionPane.showMessageDialog( null, text, "Syntax Error", JOptionPane.ERROR_MESSAGE ); return false; } AnnotatedFilterTreeDialog treeDialog = new AnnotatedFilterTreeDialog( PartitionFrame.this, false ); treeDialog.setFilter( filter ); partition.getSearchEngine().getOptimizer().annotate( root ); TreeNode astRoot = new ASTNode( null, root ); TreeModel model = new DefaultTreeModel( astRoot, true ); treeDialog.setModel( model ); treeDialog.setVisible( true ); return true; }
public boolean doAnnotate( String filter ) throws Exception { FilterParser parser = new FilterParserImpl(); ExprNode root = null; try { root = parser.parse( filter ); } catch ( Exception e ) { JTextArea text = new JTextArea(); String msg = e.getMessage(); if ( msg.length() > 1024 ) { msg = msg.substring( 0, 1024 ) + "\n. . . truncated . . ."; } text.setText( msg ); text.setEnabled( false ); JOptionPane.showMessageDialog( null, text, "Syntax Error", JOptionPane.ERROR_MESSAGE ); return false; } AnnotatedFilterTreeDialog treeDialog = new AnnotatedFilterTreeDialog( PartitionFrame.this, false ); treeDialog.setFilter( filter ); eng.getOptimizer().annotate( root ); TreeNode astRoot = new ASTNode( null, root ); TreeModel model = new DefaultTreeModel( astRoot, true ); treeDialog.setModel( model ); treeDialog.setVisible( true ); return true; }
/** * {@inheritDoc} */ public EntryFilteringCursor search( DN dn, String filter, boolean ignoreReferrals ) throws Exception { OperationManager operationManager = directoryService.getOperationManager(); ExprNode filterNode = FilterParser.parse( filter ); SearchOperationContext searchOperationContext = new SearchOperationContext( this, dn, SearchScope.OBJECT, filterNode, null ); searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS ); setReferralHandling( searchOperationContext, ignoreReferrals ); return operationManager.search( searchOperationContext ); }
filter = FilterParser.parse( "(&(" + ENTRY_CSN_OID + "<=" + purgeCSN.toOctetString() + ")(" + ENTRY_DELETED_OID + "=TRUE))" );
ExprNode filterNode = FilterParser.parse( searchRequest.getFilter() );