Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java @ 7967:6d5cbd69511a
Added dc:lowercase() dc:uppercase()
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 26 Jun 2014 12:44:40 +0200 |
parents | 02841af5feff |
children | 09c9920e6f24 |
comparison
equal
deleted
inserted
replaced
7966:d1cfd23e35cd | 7967:6d5cbd69511a |
---|---|
84 public FunctionResolver(Builder.BuildHelper buildHelper) { | 84 public FunctionResolver(Builder.BuildHelper buildHelper) { |
85 this.buildHelper = buildHelper; | 85 this.buildHelper = buildHelper; |
86 | 86 |
87 functions = new HashMap<String, Entry>(); | 87 functions = new HashMap<String, Entry>(); |
88 | 88 |
89 addFunction("lowercase", 1, new XPathFunction() { | |
90 @Override | |
91 public Object evaluate(List args) throws XPathFunctionException { | |
92 return args.get(0).toString().toLowerCase(); | |
93 } | |
94 }); | |
95 | |
96 addFunction("uppercase", 1, new XPathFunction() { | |
97 @Override | |
98 public Object evaluate(List args) throws XPathFunctionException { | |
99 return args.get(0).toString().toUpperCase(); | |
100 } | |
101 }); | |
102 | |
89 addFunction("contains", 2, new XPathFunction() { | 103 addFunction("contains", 2, new XPathFunction() { |
90 @Override | 104 @Override |
91 public Object evaluate(List args) throws XPathFunctionException { | 105 public Object evaluate(List args) throws XPathFunctionException { |
92 return contains(args); | 106 return contains(args); |
93 } | 107 } |