1 package net.sf.saxon.instruct; 2 import net.sf.saxon.expr.*; 3 import net.sf.saxon.om.ValueRepresentation; 4 import net.sf.saxon.style.StandardNames; 5 import net.sf.saxon.trans.XPathException; 6 import net.sf.saxon.type.ItemType; 7 8 import java.util.List ; 9 10 13 14 public class WithParam extends GeneralVariable { 15 16 public WithParam() {} 17 18 public int getInstructionNameCode() { 19 return StandardNames.XSL_WITH_PARAM; 20 } 21 22 public TailCall processLeavingTail(XPathContext context) throws XPathException { 23 return null; 25 } 26 27 public static void simplify(WithParam[] params, StaticContext env) throws XPathException { 28 for (int i=0; i<params.length; i++) { 29 Expression select = params[i].getSelectExpression(); 30 if (select != null) { 31 params[i].setSelectExpression(select.simplify(env)); 32 } 33 } 34 } 35 36 45 public static void typeCheck(WithParam[] params, StaticContext env, ItemType contextItemType) throws XPathException { 46 for (int i=0; i<params.length; i++) { 47 Expression select = params[i].getSelectExpression(); 48 if (select != null) { 49 params[i].setSelectExpression(select.typeCheck(env, contextItemType)); 50 } 51 } 52 } 53 54 public static void optimize(Optimizer opt, WithParam[] params, StaticContext env, ItemType contextItemType) throws XPathException { 55 for (int i=0; i<params.length; i++) { 56 Expression select = params[i].getSelectExpression(); 57 if (select != null) { 58 params[i].setSelectExpression(select.optimize(opt, env, contextItemType)); 59 } 60 } 61 } 62 63 67 68 public static void promoteParams(WithParam[] params, PromotionOffer offer) throws XPathException { 69 for (int i=0; i<params.length; i++) { 70 Expression select = params[i].getSelectExpression(); 71 if (select != null) { 72 params[i].setSelectExpression(select.promote(offer)); 73 } 74 } 75 } 76 77 80 81 public static void getXPathExpressions(WithParam[] params, List list) { 82 for (int i=0; i<params.length; i++) { 83 Expression exp = params[i].getSelectExpression(); 84 if (exp != null) { 85 list.add(exp); 86 } 87 } 88 } 89 90 93 94 public ValueRepresentation evaluateVariable(XPathContext context) throws XPathException { 95 throw new UnsupportedOperationException (); 96 } 97 } 98 99 | Popular Tags |