@Test public void and() { String fiql = new ConnObjectTOFiqlSearchConditionBuilder(). is("fullname").equalTo("ro*").and("fullname").equalTo("*i").query(); assertEquals("fullname==ro*;fullname==*i", fiql); Filter filter1 = FilterBuilder.startsWith(AttributeBuilder.build("fullname", "ro")); Filter filter2 = FilterBuilder.endsWith(AttributeBuilder.build("fullname", "i")); Filter filter = FilterBuilder.and(filter1, filter2); assertTrue(filter instanceof AndFilter); Filter converted = FilterConverter.convert(fiql); assertTrue(converted instanceof AndFilter); assertTrue(equals( (List<Filter>) ((AndFilter) filter).getFilters(), (List<Filter>) ((AndFilter) converted).getFilters())); }
public static Filter convert(final String fiql) { SyncopeFiqlParser<SearchBean> parser = new SyncopeFiqlParser<>( SearchBean.class, AbstractFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); try { FilterVisitor visitor = new FilterVisitor(); SearchCondition<SearchBean> sc = parser.parse(URLDecoder.decode(fiql, StandardCharsets.UTF_8)); sc.accept(visitor); return visitor.getQuery(); } catch (Exception e) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSearchExpression); sce.getElements().add(fiql); sce.getElements().add(ExceptionUtils.getRootCauseMessage(e)); throw sce; } }
FilterConverter { public static Filter convert(final String fiql) { SyncopeFiqlParser<SearchBean> parser = new SyncopeFiqlParser<>( SearchBean.class, AbstractFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); try { FilterVisitor visitor = new FilterVisitor(); SearchCondition<SearchBean> sc = parser.parse(URLDecoder.decode(fiql, StandardCharsets.UTF_8)); sc.accept(visitor); return visitor.getQuery(); } catch (Exception e) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSearchExpression); sce.getElements().add(fiql); sce.getElements().add(ExceptionUtils.getRootCauseMessage(e)); throw sce; } } }
FilterConverter { public static Filter convert(final String fiql) { SyncopeFiqlParser<SearchBean> parser = new SyncopeFiqlParser<>( SearchBean.class, AbstractFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); try { FilterVisitor visitor = new FilterVisitor(); SearchCondition<SearchBean> sc = parser.parse(URLDecoder.decode(fiql, StandardCharsets.UTF_8)); sc.accept(visitor); return visitor.getQuery(); } catch (Exception e) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSearchExpression); sce.getElements().add(fiql); sce.getElements().add(ExceptionUtils.getRootCauseMessage(e)); throw sce; } } private  FilterConverter(); }
FilterConverter { public static Filter convert(final String fiql) { SyncopeFiqlParser<SearchBean> parser = new SyncopeFiqlParser<>( SearchBean.class, AbstractFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); try { FilterVisitor visitor = new FilterVisitor(); SearchCondition<SearchBean> sc = parser.parse(URLDecoder.decode(fiql, StandardCharsets.UTF_8)); sc.accept(visitor); return visitor.getQuery(); } catch (Exception e) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSearchExpression); sce.getElements().add(fiql); sce.getElements().add(ExceptionUtils.getRootCauseMessage(e)); throw sce; } } private  FilterConverter(); static Filter convert(final String fiql); }
FilterConverter { public static Filter convert(final String fiql) { SyncopeFiqlParser<SearchBean> parser = new SyncopeFiqlParser<>( SearchBean.class, AbstractFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); try { FilterVisitor visitor = new FilterVisitor(); SearchCondition<SearchBean> sc = parser.parse(URLDecoder.decode(fiql, StandardCharsets.UTF_8)); sc.accept(visitor); return visitor.getQuery(); } catch (Exception e) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSearchExpression); sce.getElements().add(fiql); sce.getElements().add(ExceptionUtils.getRootCauseMessage(e)); throw sce; } } private  FilterConverter(); static Filter convert(final String fiql);  }