Package com.netflix.infix

Examples of com.netflix.infix.InfixCompiler


public class InfixFilterLanguageSupport implements FilterLanguageSupport<String> {

    @Override
    public EventFilter convert(String filter) throws InvalidFilterException {
        try {
            final Predicate<Object> predicate = new InfixCompiler().compile(filter);
            return new InfixEventFilter(predicate, filter);
        } catch (Exception e) {
            throw new InvalidFilterException("Error compiling filter : " + StringUtils.abbreviate(filter, 100), e, null);
        }
    }
View Full Code Here


  }
 
  @Test
  public void testPredicate() throws Exception {
    try{
      Predicate<Object> filter = new InfixCompiler().compile(predicateString);
      assertNotNull(filter);
      if(predicate != falseValue){
        testPositiveMatch(filter);
      }
     
View Full Code Here

  private Predicate<Object> filter;
  private Object[][] eventResultPairs;
  public CompositeEventFilterParsingTest(String filterString, Object[][]eventResultPairs)
            throws Exception {
    this.filterString = filterString;
        this.filter = new InfixCompiler().compile(this.filterString);
    this.eventResultPairs = eventResultPairs;
  }
View Full Code Here

    );
   
    System.out.println("Generated filter string: "+input);
        Predicate<Object> ef = null;
        try {
            ef = new InfixCompiler().compile(input);
        } catch (Exception e) {
            throw new AssertionError("Invalid filter string generated. Error: " + e.getMessage());
        }
  }
View Full Code Here

TOP

Related Classes of com.netflix.infix.InfixCompiler

Copyright © 2018 www.massapicom. 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.