2006-05-31から1日間の記事一覧

Proxyでmethod_missing

いろいろ手を考えてみる。 こんなクラスを定義して public class Foo { public static Scriptable getJsObj() { return (Scriptable) Proxy.newProxyInstance(Foo.class.getClassLoader(), new Class { Scriptable.class }, new InvocationHandler() { publi…

ってゆーか、Proxyを使わなくても

こんな感じで public class MethodMissing extends ScriptableObject { private Function handler = null; public MethodMissing(Function handler) { this.handler = handler; } public Object get(final String name, Scriptable o) { return new BaseFunc…

Velocityでログ出力を止める方法

http://d.hatena.ne.jp/hoso-kawa/20060526#1148650000 へ〜、メモメモっと。