@Test public void testFilterOrder() throws ParseException { String filterStr1 = "(&(&(jagplayUserGroup=Active)(!(jagplayUserGroup=Banned))(jagplayUserNickname=admin)))"; String filterStr2 = "(&(jagplayUserNickname=admin)(&(jagplayUserGroup=Active)(!(jagplayUserGroup=Banned)))) "; BranchNode node1 = ( BranchNode ) FilterParser.parse( filterStr1 ); BranchNode node2 = ( BranchNode ) FilterParser.parse( filterStr2 ); assertEquals( 1, node1.getChildren().size() ); assertTrue( node1 instanceof AndNode ); ExprNode andNode1 = node1.getChildren().get( 0 ); assertTrue( andNode1 instanceof AndNode ); List<ExprNode> children1 = ( ( AndNode ) andNode1 ).getChildren(); assertEquals( 3, children1.size() ); ExprNode child1 = children1.get( 0 ); assertTrue( child1 instanceof EqualityNode ); assertEquals( "jagplayUserGroup", ( ( EqualityNode<?> ) child1 ).getAttribute() ); assertEquals( "Active", ( ( EqualityNode<?> ) child1 ).getValue().getString() ); ExprNode child2 = children1.get( 1 ); assertTrue( child2 instanceof NotNode ); NotNode notNode1 = ( NotNode ) child2; ExprNode notNodeChild1 = notNode1.getFirstChild(); assertTrue( notNodeChild1 instanceof EqualityNode ); assertEquals( "jagplayUserGroup", ( ( EqualityNode<?> ) notNodeChild1 ).getAttribute() ); assertEquals( "Banned", ( ( EqualityNode<?> ) notNodeChild1 ).getValue().getString() ); ExprNode child3 = children1.get( 2 ); assertTrue( child3 instanceof EqualityNode ); assertEquals( "jagplayUserNickname", ( ( EqualityNode<?> ) child3 ).getAttribute() ); assertEquals( "admin", ( ( EqualityNode<?> ) child3 ).getValue().getString() ); assertEquals( 2, node2.getChildren().size() ); assertTrue( node2 instanceof AndNode ); child1 = node2.getChildren().get( 0 ); assertTrue( child1 instanceof EqualityNode ); assertEquals( "jagplayUserNickname", ( ( EqualityNode<?> ) child1 ).getAttribute() ); assertEquals( "admin", ( ( EqualityNode<?> ) child1 ).getValue().getString() ); child2 = node2.getChildren().get( 1 ); assertTrue( child2 instanceof AndNode ); AndNode andNode2 = ( ( AndNode ) child2 ); assertEquals( 2, andNode2.getChildren().size() ); child1 = andNode2.getChildren().get( 0 ); assertTrue( child1 instanceof EqualityNode ); assertEquals( "jagplayUserGroup", ( ( EqualityNode<?> ) child1 ).getAttribute() ); assertEquals( "Active", ( ( EqualityNode<?> ) child1 ).getValue().getString() ); child2 = andNode2.getChildren().get( 1 ); assertTrue( child2 instanceof NotNode ); notNode1 = ( NotNode ) child2; notNodeChild1 = notNode1.getFirstChild(); assertTrue( notNodeChild1 instanceof EqualityNode ); assertEquals( "jagplayUserGroup", ( ( EqualityNode<?> ) notNodeChild1 ).getAttribute() ); assertEquals( "Banned", ( ( EqualityNode<?> ) notNodeChild1 ).getValue().getString() ); }
public static ExprNode parse( String filter ) throws ParseException { return parse( null, filter, false ); }
FilterParser { public static ExprNode parse( String filter ) throws ParseException { return parse( null, filter, false ); } }
FilterParser { public static ExprNode parse( String filter ) throws ParseException { return parse( null, filter, false ); } private  FilterParser(); }
FilterParser { public static ExprNode parse( String filter ) throws ParseException { return parse( null, filter, false ); } private  FilterParser(); static ExprNode parse( String filter ); static ExprNode parse( String filter, boolean relaxed ); static ExprNode parse( SchemaManager schemaManager, String filter ); static ExprNode parse( SchemaManager schemaManager, String filter, boolean relaxed ); }
FilterParser { public static ExprNode parse( String filter ) throws ParseException { return parse( null, filter, false ); } private  FilterParser(); static ExprNode parse( String filter ); static ExprNode parse( String filter, boolean relaxed ); static ExprNode parse( SchemaManager schemaManager, String filter ); static ExprNode parse( SchemaManager schemaManager, String filter, boolean relaxed );  }