1 package net.sf.saxon.instruct; 2 3 import net.sf.saxon.expr.Binding; 4 import net.sf.saxon.expr.XPathContext; 5 import net.sf.saxon.om.ValueRepresentation; 6 import net.sf.saxon.trans.XPathException; 7 import net.sf.saxon.value.SequenceType; 8 9 import java.io.Serializable ; 10 11 14 public class UserFunctionParameter implements Binding, Serializable { 15 16 private SequenceType requiredType; 17 private int slotNumber; 18 private int referenceCount = 999; 19 22 26 27 public final boolean isGlobal() { 28 return false; 29 } 30 31 36 37 public final boolean isAssignable() { 38 return false; 39 } 40 41 45 46 public int getLocalSlotNumber() { 47 return slotNumber; 48 } 49 50 public void setRequiredType(SequenceType type) { 51 requiredType = type; 52 } 53 54 public SequenceType getRequiredType() { 55 return requiredType; 56 } 57 58 public void setReferenceCount(int count) { 59 referenceCount = count; 60 } 61 62 public int getReferenceCount() { 63 return referenceCount; 64 } 65 66 public void setSlotNumber(int slot) { 67 slotNumber = slot; 68 } 69 70 public ValueRepresentation evaluateVariable(XPathContext context) throws XPathException { 71 return context.evaluateLocalVariable(slotNumber); 72 } 73 74 } 75 76 | Popular Tags |