Comments (4)
[deleted comment]
from ik-expression.
很高兴,有大牛能给IK-E提出建议。我的E文水平只够看,不够
写哈,所以就用中文给你回复吧,
呵呵!
实际上在IK-E中有两种方法解决您提到的问题:
一种是用org.wltea.expression.function.FunctionLoader这个类中的方法
public static void addFunction(String functionName, Object instance, Method
method)
在运行时传入对象的实例、java方法实例以及映射的函数名称�
��添加自定义函数(ps:很不好意
思,文档做的不够细,漏了这个API的说明呵呵)
第二种方法,通过ThreadLocal的线程本地变量,可以将您自己声
明的类实例(包括任意的外部参
数)传入到自定义的Function中(在执行表达式前声明一个Thread
Local,将参数传入,并在表达
式中的自定义方法执行时,从ThreadLocal中取出即可)。我自己
目前在做的一个项目中就采用了
这种方式,可以很容易的使用Map对象传入想要的参数。
最后,很感谢你的使用!:)
Original comment by [email protected]
on 11 May 2009 at 3:40
from ik-expression.
Original comment by [email protected]
on 24 Jul 2009 at 6:26
- Changed state: Accepted
from ik-expression.
Original comment by [email protected]
on 4 Dec 2009 at 2:00
- Changed state: Done
from ik-expression.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ik-expression.