-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #631 from killme2008/feat/get-function-names
feat: adds Expression#getFunctionNames
- Loading branch information
Showing
14 changed files
with
249 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/java/com/googlecode/aviator/ExpressionAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Copyright (C) 2010 dennis zhuang ([email protected]) | ||
* | ||
* This library is free software; you can redistribute it and/or modify it under the terms of the | ||
* GNU Lesser General Public License as published by the Free Software Foundation; either version | ||
* 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License along with this program; | ||
* if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
* | ||
**/ | ||
package com.googlecode.aviator; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import com.googlecode.aviator.runtime.FunctionArgument; | ||
import com.googlecode.aviator.runtime.LambdaFunctionBootstrap; | ||
import com.googlecode.aviator.utils.Env; | ||
|
||
/** | ||
* Base expression default methods accessor | ||
* | ||
* @author dennis | ||
* | ||
*/ | ||
public class ExpressionAccessor { | ||
|
||
public static void setSourceFile(final BaseExpression exp, String sourceFile) { | ||
exp.setSourceFile(sourceFile); | ||
} | ||
|
||
public static void setInstance(final BaseExpression exp, AviatorEvaluatorInstance instance) { | ||
exp.setInstance(instance); | ||
} | ||
|
||
public static void setCompileEnv(final BaseExpression exp, final Env compileEnv) { | ||
exp.setCompileEnv(compileEnv); | ||
} | ||
|
||
public static void setExpression(final BaseExpression exp, final String expression) { | ||
exp.setExpression(expression); | ||
} | ||
|
||
public static void setFuncsArgs(final BaseExpression exp, | ||
final Map<Integer, List<FunctionArgument>> funcsArgs) { | ||
exp.setFuncsArgs(funcsArgs); | ||
} | ||
|
||
public static void setLambdaBootstraps(final BaseExpression exp, | ||
final Map<String, LambdaFunctionBootstrap> lambdaBootstraps) { | ||
exp.setLambdaBootstraps(lambdaBootstraps); | ||
} | ||
|
||
public static void setFunctionNames(final BaseExpression exp, List<String> functionNames) { | ||
exp.setFunctionNames(functionNames); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.