ValidationAPI implements Serializable { public DiagnosticCollector<JavaFileObject> filterCompiler(Map<String, Class<?>> schemaFields) { String fields = ""; CustomExpressionVisitor customExpressionVisitor = new CustomExpressionVisitor(); customExpressionVisitor.visit(generateAntlrTree()); for (String field : customExpressionVisitor.getFieldList()) { if (schemaFields.get(field) != null) { fields += ClassToDataTypeConversion.valueOf(schemaFields.get(field).getSimpleName()).getValue(field); } } return CompileUtils.javaCompile(fields, expr, packageNames, "boolean"); } ValidationAPI(String expression, String propertiesFilePath); boolean isExpressionValid(); String getValidExpression(); DiagnosticCollector<JavaFileObject> transformCompiler(Map<String, Class<?>> schemaFields); DiagnosticCollector<JavaFileObject> filterCompiler(Map<String, Class<?>> schemaFields); List<String> getFieldNameList(Map<String, Class<?>> schemaFields); Object execute(); Object execute(String[] fieldNames, Object[] data); Object execute(String[] fieldNames, Object[] data, String validExpression); void init(String[] fieldNames,String[] fieldTypes); ValidationAPI init(String validExpression,Map<String,String> fieldMap); void init(String expression); Object exec(Object[] data); Object execute(String validExpression); static DiagnosticCollector<JavaFileObject> filterCompiler(String expression, String propertiesFilePath,
			Map<String, Class<?>> schemaFields, String externalJarPath); static DiagnosticCollector<JavaFileObject> transformCompiler(String expression, String propertiesFilePath,
			Map<String, Class<?>> schemaFields, String externalJarPath); static List<String> getFieldNameList(Map<String, Class<?>> schemaFields,String expression,String propertiesFilePath); static Object execute(String expression, String propertiesFilePath, String[] fieldNames, Object[] data); String getExpr(); void setExpr(String expr);  }
@Test public void itShouldCompileFilterExpressionWithOutSemiColon() { ValidationAPI validationAPI = new ValidationAPI( "StringFunctions.stringMatch(\"HELLO WORLD\",DateFunctions.getStringDateFromDateObject(f1, \"\"))?true:false", ""); Map<String, Class<?>> schemaFields = new HashMap<String, Class<?>>(); schemaFields.put("f1", Date.class); DiagnosticCollector<JavaFileObject> dig = validationAPI.filterCompiler(schemaFields); Assert.assertTrue(dig.getDiagnostics().size() <= 0); }