gpt4 book ai didi

net.sf.saxon.expr.XPathContextMajor.setStackFrame()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 19:17:40 25 4
gpt4 key购买 nike

本文整理了Java中net.sf.saxon.expr.XPathContextMajor.setStackFrame()方法的一些代码示例,展示了XPathContextMajor.setStackFrame()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XPathContextMajor.setStackFrame()方法的具体详情如下:
包路径:net.sf.saxon.expr.XPathContextMajor
类名称:XPathContextMajor
方法名:setStackFrame

XPathContextMajor.setStackFrame介绍

[英]Set the local stack frame. This method is used when creating a Closure to support delayed evaluation of expressions. The "stack frame" is actually on the Java heap, which means it can survive function returns and the like.
[中]设置本地堆栈帧。创建闭包以支持表达式的延迟求值时使用此方法。“堆栈框架”实际上位于Java堆上,这意味着它可以在函数返回等情况下存活。

代码示例

代码示例来源:origin: net.sf.saxon/Saxon-B

public MappingIterator.StatefulMappingFunction getAnother() {
    // Create a copy of the stack frame, so that changes made to local variables by the cloned
    // iterator are not seen by the original iterator
    XPathContextMajor c2 = context.newContext();
    StackFrame oldstack = context.getStackFrame();
    ValueRepresentation[] vars = oldstack.getStackFrameValues();
    ValueRepresentation[] newvars = new ValueRepresentation[vars.length];
    System.arraycopy(vars, 0, newvars, 0, vars.length);
    c2.setStackFrame(oldstack.getStackFrameMap(), newvars);
    return new MappingAction(c2, slotNumber, pslot, action);
  }
}

代码示例来源:origin: org.opengis.cite.saxon/saxon9

/**
 * Call this function in "push" mode, writing the results to the current output destination.
 * @param actualArgs the arguments supplied to the function. These must have the correct
 * types required by the function signature (it is the caller's responsibility to check this).
 * It is acceptable to supply a {@link net.sf.saxon.value.Closure} to represent a value whose
 * evaluation will be delayed until it is needed. The array must be the correct size to match
 * the number of arguments: again, it is the caller's responsibility to check this.
 * @param context This provides the run-time context for evaluating the function. It is the caller's
 * responsibility to allocate a "clean" context for the function to use; the context that is provided
 * will be overwritten by the function.
 */
 public void process(ValueRepresentation[] actualArgs, XPathContextMajor context)
     throws XPathException {
   context.setStackFrame(getStackFrameMap(), actualArgs);
   getBody().process(context);
 }

代码示例来源:origin: net.sourceforge.saxon/saxon

/**
 * Call this function in "pull" mode, returning the results as a sequence of PullEvents.
 * @param actualArgs the arguments supplied to the function. These must have the correct
 * types required by the function signature (it is the caller's responsibility to check this).
 * It is acceptable to supply a {@link net.sf.saxon.value.Closure} to represent a value whose
 * evaluation will be delayed until it is needed. The array must be the correct size to match
 * the number of arguments: again, it is the caller's responsibility to check this.
 * @param context This provides the run-time context for evaluating the function. It is the caller's
 * responsibility to allocate a "clean" context for the function to use; the context that is provided
 * will be overwritten by the function.
 * @return an iterator over the results of the function call
 */
 public EventIterator iterateEvents(ValueRepresentation[] actualArgs, XPathContextMajor context)
     throws XPathException {
   context.setStackFrame(getStackFrameMap(), actualArgs);
   return getBody().iterateEvents(context);
 }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

public StatefulMappingFunction getAnother() {
    // Create a copy of the stack frame, so that changes made to local variables by the cloned
    // iterator are not seen by the original iterator
    XPathContextMajor c2 = context.newContext();
    StackFrame oldstack = context.getStackFrame();
    Sequence[] vars = oldstack.getStackFrameValues();
    Sequence[] newvars = Arrays.copyOf(vars, vars.length);
    c2.setStackFrame(oldstack.getStackFrameMap(), newvars);
    return new MappingAction(c2, slotNumber, action);
  }
}

代码示例来源:origin: net.sourceforge.saxon/saxon

/**
 * Call this function in "push" mode, writing the results to the current output destination.
 * @param actualArgs the arguments supplied to the function. These must have the correct
 * types required by the function signature (it is the caller's responsibility to check this).
 * It is acceptable to supply a {@link net.sf.saxon.value.Closure} to represent a value whose
 * evaluation will be delayed until it is needed. The array must be the correct size to match
 * the number of arguments: again, it is the caller's responsibility to check this.
 * @param context This provides the run-time context for evaluating the function. It is the caller's
 * responsibility to allocate a "clean" context for the function to use; the context that is provided
 * will be overwritten by the function.
 */
 public void process(ValueRepresentation[] actualArgs, XPathContextMajor context)
     throws XPathException {
   context.setStackFrame(getStackFrameMap(), actualArgs);
   getBody().process(context);
 }

代码示例来源:origin: net.sf.saxon/Saxon-HE

/**
 * Call this function in "push" mode, writing the results to the current output destination.
 *
 * @param actualArgs the arguments supplied to the function. These must have the correct
 *                   types required by the function signature (it is the caller's responsibility to check this).
 *                   It is acceptable to supply a {@link net.sf.saxon.value.Closure} to represent a value whose
 *                   evaluation will be delayed until it is needed. The array must be the correct size to match
 *                   the number of arguments: again, it is the caller's responsibility to check this.
 * @param context    This provides the run-time context for evaluating the function. It is the caller's
 *                   responsibility to allocate a "clean" context for the function to use; the context that is provided
 *                   will be overwritten by the function.
 * @throws net.sf.saxon.trans.XPathException if a dynamic error occurs while evaluating the function
 */
public void process(Sequence[] actualArgs, XPathContextMajor context)
    throws XPathException {
  context.setStackFrame(getStackFrameMap(), actualArgs);
  getBody().process(context);
}

代码示例来源:origin: net.sourceforge.saxon/saxon

public StatefulMappingFunction getAnother() {
    // Create a copy of the stack frame, so that changes made to local variables by the cloned
    // iterator are not seen by the original iterator
    XPathContextMajor c2 = context.newContext();
    StackFrame oldstack = context.getStackFrame();
    ValueRepresentation[] vars = oldstack.getStackFrameValues();
    ValueRepresentation[] newvars = new ValueRepresentation[vars.length];
    System.arraycopy(vars, 0, newvars, 0, vars.length);
    c2.setStackFrame(oldstack.getStackFrameMap(), newvars);
    return new MappingAction(c2, slotNumber, pslot, action);
  }
}

代码示例来源:origin: org.opengis.cite.saxon/saxon9

public MappingIterator.StatefulMappingFunction getAnother() {
    // Create a copy of the stack frame, so that changes made to local variables by the cloned
    // iterator are not seen by the original iterator
    XPathContextMajor c2 = context.newContext();
    StackFrame oldstack = context.getStackFrame();
    ValueRepresentation[] vars = oldstack.getStackFrameValues();
    ValueRepresentation[] newvars = new ValueRepresentation[vars.length];
    System.arraycopy(vars, 0, newvars, 0, vars.length);
    c2.setStackFrame(oldstack.getStackFrameMap(), newvars);
    return new MappingAction(c2, slotNumber, pslot, action);
  }
}

代码示例来源:origin: org.opengis.cite.saxon/saxon9

/**
 * Call this function in "pull" mode, returning the results as a sequence of PullEvents.
 * @param actualArgs the arguments supplied to the function. These must have the correct
 * types required by the function signature (it is the caller's responsibility to check this).
 * It is acceptable to supply a {@link net.sf.saxon.value.Closure} to represent a value whose
 * evaluation will be delayed until it is needed. The array must be the correct size to match
 * the number of arguments: again, it is the caller's responsibility to check this.
 * @param context This provides the run-time context for evaluating the function. It is the caller's
 * responsibility to allocate a "clean" context for the function to use; the context that is provided
 * will be overwritten by the function.
 * @return an iterator over the results of the function call
 */
 public EventIterator iterateEvents(ValueRepresentation[] actualArgs, XPathContextMajor context)
     throws XPathException {
   context.setStackFrame(getStackFrameMap(), actualArgs);
   return getBody().iterateEvents(context);
 }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

/**
 * Call this function in "push" mode, writing the results to the current output destination.
 *
 * @param actualArgs the arguments supplied to the function. These must have the correct
 *                   types required by the function signature (it is the caller's responsibility to check this).
 *                   It is acceptable to supply a {@link net.sf.saxon.value.Closure} to represent a value whose
 *                   evaluation will be delayed until it is needed. The array must be the correct size to match
 *                   the number of arguments: again, it is the caller's responsibility to check this.
 * @param context    This provides the run-time context for evaluating the function. It is the caller's
 *                   responsibility to allocate a "clean" context for the function to use; the context that is provided
 *                   will be overwritten by the function.
 * @throws net.sf.saxon.trans.XPathException if a dynamic error occurs while evaluating the function
 */
public void process(Sequence[] actualArgs, XPathContextMajor context)
    throws XPathException {
  context.setStackFrame(getStackFrameMap(), actualArgs);
  getBody().process(context);
}

代码示例来源:origin: net.sourceforge.saxon/saxon

/**
 * Call an updating function.
 * @param actualArgs the arguments supplied to the function. These must have the correct
 * types required by the function signature (it is the caller's responsibility to check this).
 * It is acceptable to supply a {@link net.sf.saxon.value.Closure} to represent a value whose
 * evaluation will be delayed until it is needed. The array must be the correct size to match
 * the number of arguments: again, it is the caller's responsibility to check this.
 * @param context the dynamic evaluation context
 * @param pul the pending updates list, to which the function's update actions are to be added.
 */
public void callUpdating(ValueRepresentation[] actualArgs, XPathContextMajor context, PendingUpdateList pul)
throws XPathException {
  context.setStackFrame(getStackFrameMap(), actualArgs);
  try {
    getBody().evaluatePendingUpdates(context, pul);
  } catch (XPathException err) {
    err.maybeSetLocation(this);
    throw err;
  }
}

代码示例来源:origin: net.sf.saxon/Saxon-HE

/**
 * Call an updating function.
 *
 * @param actualArgs the arguments supplied to the function. These must have the correct
 *                   types required by the function signature (it is the caller's responsibility to check this).
 *                   It is acceptable to supply a {@link net.sf.saxon.value.Closure} to represent a value whose
 *                   evaluation will be delayed until it is needed. The array must be the correct size to match
 *                   the number of arguments: again, it is the caller's responsibility to check this.
 * @param context    the dynamic evaluation context
 * @param pul        the pending updates list, to which the function's update actions are to be added.
 * @throws net.sf.saxon.trans.XPathException if a dynamic error occurs while evaluating the function.
 */
public void callUpdating(Sequence[] actualArgs, XPathContextMajor context, PendingUpdateList pul)
    throws XPathException {
  context.setStackFrame(getStackFrameMap(), actualArgs);
  try {
    getBody().evaluatePendingUpdates(context, pul);
  } catch (XPathException err) {
    err.maybeSetLocation(getLocation());
    throw err;
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

/**
 * Call an updating function.
 *
 * @param actualArgs the arguments supplied to the function. These must have the correct
 *                   types required by the function signature (it is the caller's responsibility to check this).
 *                   It is acceptable to supply a {@link net.sf.saxon.value.Closure} to represent a value whose
 *                   evaluation will be delayed until it is needed. The array must be the correct size to match
 *                   the number of arguments: again, it is the caller's responsibility to check this.
 * @param context    the dynamic evaluation context
 * @param pul        the pending updates list, to which the function's update actions are to be added.
 * @throws net.sf.saxon.trans.XPathException if a dynamic error occurs while evaluating the function.
 */
public void callUpdating(Sequence[] actualArgs, XPathContextMajor context, PendingUpdateList pul)
    throws XPathException {
  context.setStackFrame(getStackFrameMap(), actualArgs);
  try {
    getBody().evaluatePendingUpdates(context, pul);
  } catch (XPathException err) {
    err.maybeSetLocation(getLocation());
    throw err;
  }
}

代码示例来源:origin: net.sf.saxon/Saxon-HE

/**
 * Build a data structure containing the values of the accumulator for each node in a document.
 * The data structure holds the value for all nodes where the value changes; the value for other
 * nodes is obtained by interpolation
 *
 * @param doc     the root of the tree for which the accumulator is to be evaluated
 * @param context the dynamic evaluation context
 * @throws XPathException if a dynamic error occurs while evaluating the accumulator
 */
public void buildIndex(NodeInfo doc, XPathContext context) throws XPathException {
  //System.err.println("Building accData " + this);
  if (building) {
    throw new XPathException("Accumulator " + accumulator.getAccumulatorName().getDisplayName() +
      " requires access to its own value", "XTDE3400");
  }
  building = true;
  Expression initialValue = accumulator.getInitialValueExpression();
  XPathContextMajor c2 = context.newContext();
  SlotManager sf = accumulator.getSlotManagerForInitialValueExpression();
  Sequence[] slots = new Sequence[sf.getNumberOfVariables()];
  c2.setStackFrame(sf, slots);
  c2.setCurrentIterator(new ManualIterator<>(doc));
  Sequence<?> val = initialValue.iterate(c2).materialize();
  values.add(new DataPoint(new Visit(doc, false), val));
  val = visit(doc, val, c2);
  values.add(new DataPoint(new Visit(doc, true), val));
  ((ArrayList) values).trimToSize();
  building = false;
  //diagnosticPrint();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

/**
 * Build a data structure containing the values of the accumulator for each node in a document.
 * The data structure holds the value for all nodes where the value changes; the value for other
 * nodes is obtained by interpolation
 *
 * @param doc     the root of the tree for which the accumulator is to be evaluated
 * @param context the dynamic evaluation context
 * @throws XPathException if a dynamic error occurs while evaluating the accumulator
 */
public void buildIndex(NodeInfo doc, XPathContext context) throws XPathException {
  //System.err.println("Building accData " + this);
  if (building) {
    throw new XPathException("Accumulator " + accumulator.getAccumulatorName().getDisplayName() +
      " requires access to its own value", "XTDE3400");
  }
  building = true;
  Expression initialValue = accumulator.getInitialValueExpression();
  XPathContextMajor c2 = context.newContext();
  SlotManager sf = accumulator.getSlotManagerForInitialValueExpression();
  Sequence[] slots = new Sequence[sf.getNumberOfVariables()];
  c2.setStackFrame(sf, slots);
  c2.setCurrentIterator(new ManualIterator<>(doc));
  Sequence<?> val = initialValue.iterate(c2).materialize();
  values.add(new DataPoint(new Visit(doc, false), val));
  val = visit(doc, val, c2);
  values.add(new DataPoint(new Visit(doc, true), val));
  ((ArrayList) values).trimToSize();
  building = false;
  //diagnosticPrint();
}

代码示例来源:origin: net.sourceforge.saxon/saxon

context.setStackFrame(getStackFrameMap(), actualArgs);
ValueRepresentation result;
try {

代码示例来源:origin: net.sf.saxon/Saxon-HE

c2.setStackFrame(getStackFrameMap(), actualArgs);
Sequence<?> result;
try {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

c2.setStackFrame(getStackFrameMap(), actualArgs);
Sequence<?> result;
try {

代码示例来源:origin: net.sourceforge.saxon/saxon

ValueRepresentation[] savedStackFrame = new ValueRepresentation[local.length];
System.arraycopy(local, 0, savedStackFrame, 0, local.length);
savedXPathContext.setStackFrame(localStackFrame.getStackFrameMap(), savedStackFrame);

代码示例来源:origin: net.sf.saxon/Saxon-HE

savedXPathContext.setStackFrame(stackFrameMap, savedStackFrame);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com