Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/FunctionResolver.java @ 4594:2970046fcdca
Doc.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 29 Nov 2012 11:48:20 +0100 |
parents | de0c2bbb27f9 |
children | e1566938d04c |
comparison
equal
deleted
inserted
replaced
4593:047c965ea542 | 4594:2970046fcdca |
---|---|
11 | 11 |
12 import javax.xml.namespace.QName; | 12 import javax.xml.namespace.QName; |
13 | 13 |
14 import org.apache.log4j.Logger; | 14 import org.apache.log4j.Logger; |
15 | 15 |
16 | |
17 /** Resolves functions (e.g. dc:contains) in Datacage/Meta-Data system. */ | |
16 public class FunctionResolver | 18 public class FunctionResolver |
17 implements XPathFunctionResolver | 19 implements XPathFunctionResolver |
18 { | 20 { |
21 /** Home logger. */ | |
19 private static Logger log = Logger.getLogger(FunctionResolver.class); | 22 private static Logger log = Logger.getLogger(FunctionResolver.class); |
20 | 23 |
21 public static final String FUNCTION_NAMESPACE_URI = "dc"; | 24 public static final String FUNCTION_NAMESPACE_URI = "dc"; |
22 | 25 |
23 public static final class Entry { | 26 public static final class Entry { |
77 } | 80 } |
78 } | 81 } |
79 }); | 82 }); |
80 } | 83 } |
81 | 84 |
85 /** List of functions. */ | |
82 protected List<Entry> functions; | 86 protected List<Entry> functions; |
83 | 87 |
84 public FunctionResolver() { | 88 public FunctionResolver() { |
85 functions = new ArrayList<Entry>(); | 89 functions = new ArrayList<Entry>(); |
86 } | 90 } |
87 | 91 |
92 /** | |
93 * Create a new function. | |
94 * @param name Name of the function. | |
95 * @param arity Number of arguments for function. | |
96 * @param function the function itself. | |
97 */ | |
88 public void addFunction(String name, int arity, XPathFunction function) { | 98 public void addFunction(String name, int arity, XPathFunction function) { |
89 functions.add(new Entry(name, function, arity)); | 99 functions.add(new Entry(name, function, arity)); |
90 } | 100 } |
91 | 101 |
92 @Override | 102 @Override |