| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package net.sf.saxon.type; |
| 9 |
|
| 10 |
import net.sf.saxon.om.Sequence; |
| 11 |
import net.sf.saxon.om.StructuredQName; |
| 12 |
import net.sf.saxon.sxpath.XPathDynamicContext; |
| 13 |
import net.sf.saxon.sxpath.XPathVariable; |
| 14 |
import net.sf.saxon.trans.XPathException; |
| 15 |
|
| 16 |
import java.util.HashMap; |
| 17 |
import java.util.Map; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
public class ValidationParams extends HashMap<StructuredQName, Sequence<?>> { |
| 26 |
|
| 27 |
public ValidationParams() { |
| 28 |
super(20); |
| 29 |
} |
| 30 |
|
| 31 |
public static void setValidationParams(Map<StructuredQName, XPathVariable> declaredParams, ValidationParams actualParams, XPathDynamicContext context) throws XPathException { |
| 32 |
for (StructuredQName p : declaredParams.keySet()) { |
| 33 |
XPathVariable var = declaredParams.get(p); |
| 34 |
Sequence<?> paramValue = actualParams.get(p); |
| 35 |
if (paramValue != null) { |
| 36 |
context.setVariable(var, paramValue); |
| 37 |
} else { |
| 38 |
context.setVariable(var, var.getDefaultValue()); |
| 39 |
} |
| 40 |
} |
| 41 |
} |
| 42 |
} |
| 43 |
|