Skip to content

jiuwo/fastel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastEL

项目介绍

  • FastEL 快速的表达式解析器

使用说明

  • 引用JAR包

        <dependency>
            <groupId>org.jiuwo</groupId>
            <artifactId>fastel</artifactId>
            <version>1.0.6</version>
        </dependency>
  • 具体使用

        Expression expression = new ExpressionImpl("2*(3+5)");
        result = expression.evaluate();
        Assert.assertEquals(16L, result);
        
        result = expression
                 .parseExpression("parseInt('2')")
                 .evaluate();
        Assert.assertEquals(2, result);
        
        result = expression
                .parseExpression("Math.abs(-123)")
                .evaluate();
        Assert.assertEquals(123.0, result);
        
  • 更多用法参考项目中单元测试