Skip to content

Instantly share code, notes, and snippets.

@xzer
Last active August 16, 2016 03:52
Show Gist options
  • Save xzer/09df1e8ef129267545da390a33064656 to your computer and use it in GitHub Desktop.
Save xzer/09df1e8ef129267545da390a33064656 to your computer and use it in GitHub Desktop.
some idea of how to add filter mechanism to asta4d
render.add(".x-num", Filter.formatedNum(121));
interface Filter<S, T> {
public T convert(S s);
}
class NumFilter implements Filter<Integer, String>{
}
render.add(".x-num", 213);
render.add(".x-num", NumFilter.convert(123));
>> render.add(".x-num", 123, NumFilter.class).add(".x-fff", "xxx");
>> render.add(".x-num", 123, numFilter).add(".x-fff", "xxx");
render.add(".x-num", 123).filter(NumFilter.class).add("xxx", "fff");
render.add(".x-num", 123).addFilter(".x-num", NumFilter.class);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment