com.sun.org.apache.xpath.internal.VariableStack Java Examples

The following examples show how to use com.sun.org.apache.xpath.internal.VariableStack. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WalkingIterator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *  Returns the next node in the set and advances the position of the
 * iterator in the set. After a NodeIterator is created, the first call
 * to nextNode() returns the first node in the set.
 * @return  The next <code>Node</code> in the set being iterated over, or
 *   <code>null</code> if there are no more members in that set.
 */
public int nextNode()
{
      if(m_foundLast)
              return DTM.NULL;

  // If the variable stack position is not -1, we'll have to
  // set our position in the variable stack, so our variable access
  // will be correct.  Iterators that are at the top level of the
  // expression need to reset the variable stack, while iterators
  // in predicates do not need to, and should not, since their execution
  // may be much later than top-level iterators.
  // m_varStackPos is set in setRoot, which is called
  // from the execute method.
  if (-1 == m_stackFrame)
  {
    return returnNextNode(m_firstWalker.nextNode());
  }
  else
  {
    VariableStack vars = m_execContext.getVarStack();

    // These three statements need to be combined into one operation.
    int savedStart = vars.getStackFrame();

    vars.setStackFrame(m_stackFrame);

    int n = returnNextNode(m_firstWalker.nextNode());

    // These two statements need to be combined into one operation.
    vars.setStackFrame(savedStart);

    return n;
  }
}
 
Example #2
Source File: WalkingIterator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *  Returns the next node in the set and advances the position of the
 * iterator in the set. After a NodeIterator is created, the first call
 * to nextNode() returns the first node in the set.
 * @return  The next <code>Node</code> in the set being iterated over, or
 *   <code>null</code> if there are no more members in that set.
 */
public int nextNode()
{
      if(m_foundLast)
              return DTM.NULL;

  // If the variable stack position is not -1, we'll have to
  // set our position in the variable stack, so our variable access
  // will be correct.  Iterators that are at the top level of the
  // expression need to reset the variable stack, while iterators
  // in predicates do not need to, and should not, since their execution
  // may be much later than top-level iterators.
  // m_varStackPos is set in setRoot, which is called
  // from the execute method.
  if (-1 == m_stackFrame)
  {
    return returnNextNode(m_firstWalker.nextNode());
  }
  else
  {
    VariableStack vars = m_execContext.getVarStack();

    // These three statements need to be combined into one operation.
    int savedStart = vars.getStackFrame();

    vars.setStackFrame(m_stackFrame);

    int n = returnNextNode(m_firstWalker.nextNode());

    // These two statements need to be combined into one operation.
    vars.setStackFrame(savedStart);

    return n;
  }
}
 
Example #3
Source File: WalkingIterator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *  Returns the next node in the set and advances the position of the
 * iterator in the set. After a NodeIterator is created, the first call
 * to nextNode() returns the first node in the set.
 * @return  The next <code>Node</code> in the set being iterated over, or
 *   <code>null</code> if there are no more members in that set.
 */
public int nextNode()
{
      if(m_foundLast)
              return DTM.NULL;

  // If the variable stack position is not -1, we'll have to
  // set our position in the variable stack, so our variable access
  // will be correct.  Iterators that are at the top level of the
  // expression need to reset the variable stack, while iterators
  // in predicates do not need to, and should not, since their execution
  // may be much later than top-level iterators.
  // m_varStackPos is set in setRoot, which is called
  // from the execute method.
  if (-1 == m_stackFrame)
  {
    return returnNextNode(m_firstWalker.nextNode());
  }
  else
  {
    VariableStack vars = m_execContext.getVarStack();

    // These three statements need to be combined into one operation.
    int savedStart = vars.getStackFrame();

    vars.setStackFrame(m_stackFrame);

    int n = returnNextNode(m_firstWalker.nextNode());

    // These two statements need to be combined into one operation.
    vars.setStackFrame(savedStart);

    return n;
  }
}
 
Example #4
Source File: WalkingIterator.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 *  Returns the next node in the set and advances the position of the
 * iterator in the set. After a NodeIterator is created, the first call
 * to nextNode() returns the first node in the set.
 * @return  The next <code>Node</code> in the set being iterated over, or
 *   <code>null</code> if there are no more members in that set.
 */
public int nextNode()
{
      if(m_foundLast)
              return DTM.NULL;

  // If the variable stack position is not -1, we'll have to
  // set our position in the variable stack, so our variable access
  // will be correct.  Iterators that are at the top level of the
  // expression need to reset the variable stack, while iterators
  // in predicates do not need to, and should not, since their execution
  // may be much later than top-level iterators.
  // m_varStackPos is set in setRoot, which is called
  // from the execute method.
  if (-1 == m_stackFrame)
  {
    return returnNextNode(m_firstWalker.nextNode());
  }
  else
  {
    VariableStack vars = m_execContext.getVarStack();

    // These three statements need to be combined into one operation.
    int savedStart = vars.getStackFrame();

    vars.setStackFrame(m_stackFrame);

    int n = returnNextNode(m_firstWalker.nextNode());

    // These two statements need to be combined into one operation.
    vars.setStackFrame(savedStart);

    return n;
  }
}
 
Example #5
Source File: WalkingIterator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 *  Returns the next node in the set and advances the position of the
 * iterator in the set. After a NodeIterator is created, the first call
 * to nextNode() returns the first node in the set.
 * @return  The next <code>Node</code> in the set being iterated over, or
 *   <code>null</code> if there are no more members in that set.
 */
public int nextNode()
{
      if(m_foundLast)
              return DTM.NULL;

  // If the variable stack position is not -1, we'll have to
  // set our position in the variable stack, so our variable access
  // will be correct.  Iterators that are at the top level of the
  // expression need to reset the variable stack, while iterators
  // in predicates do not need to, and should not, since their execution
  // may be much later than top-level iterators.
  // m_varStackPos is set in setRoot, which is called
  // from the execute method.
  if (-1 == m_stackFrame)
  {
    return returnNextNode(m_firstWalker.nextNode());
  }
  else
  {
    VariableStack vars = m_execContext.getVarStack();

    // These three statements need to be combined into one operation.
    int savedStart = vars.getStackFrame();

    vars.setStackFrame(m_stackFrame);

    int n = returnNextNode(m_firstWalker.nextNode());

    // These two statements need to be combined into one operation.
    vars.setStackFrame(savedStart);

    return n;
  }
}
 
Example #6
Source File: WalkingIterator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 *  Returns the next node in the set and advances the position of the
 * iterator in the set. After a NodeIterator is created, the first call
 * to nextNode() returns the first node in the set.
 * @return  The next <code>Node</code> in the set being iterated over, or
 *   <code>null</code> if there are no more members in that set.
 */
public int nextNode()
{
      if(m_foundLast)
              return DTM.NULL;

  // If the variable stack position is not -1, we'll have to
  // set our position in the variable stack, so our variable access
  // will be correct.  Iterators that are at the top level of the
  // expression need to reset the variable stack, while iterators
  // in predicates do not need to, and should not, since their execution
  // may be much later than top-level iterators.
  // m_varStackPos is set in setRoot, which is called
  // from the execute method.
  if (-1 == m_stackFrame)
  {
    return returnNextNode(m_firstWalker.nextNode());
  }
  else
  {
    VariableStack vars = m_execContext.getVarStack();

    // These three statements need to be combined into one operation.
    int savedStart = vars.getStackFrame();

    vars.setStackFrame(m_stackFrame);

    int n = returnNextNode(m_firstWalker.nextNode());

    // These two statements need to be combined into one operation.
    vars.setStackFrame(savedStart);

    return n;
  }
}
 
Example #7
Source File: WalkingIterator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 *  Returns the next node in the set and advances the position of the
 * iterator in the set. After a NodeIterator is created, the first call
 * to nextNode() returns the first node in the set.
 * @return  The next <code>Node</code> in the set being iterated over, or
 *   <code>null</code> if there are no more members in that set.
 */
public int nextNode()
{
      if(m_foundLast)
              return DTM.NULL;

  // If the variable stack position is not -1, we'll have to
  // set our position in the variable stack, so our variable access
  // will be correct.  Iterators that are at the top level of the
  // expression need to reset the variable stack, while iterators
  // in predicates do not need to, and should not, since their execution
  // may be much later than top-level iterators.
  // m_varStackPos is set in setRoot, which is called
  // from the execute method.
  if (-1 == m_stackFrame)
  {
    return returnNextNode(m_firstWalker.nextNode());
  }
  else
  {
    VariableStack vars = m_execContext.getVarStack();

    // These three statements need to be combined into one operation.
    int savedStart = vars.getStackFrame();

    vars.setStackFrame(m_stackFrame);

    int n = returnNextNode(m_firstWalker.nextNode());

    // These two statements need to be combined into one operation.
    vars.setStackFrame(savedStart);

    return n;
  }
}
 
Example #8
Source File: WalkingIterator.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 *  Returns the next node in the set and advances the position of the
 * iterator in the set. After a NodeIterator is created, the first call
 * to nextNode() returns the first node in the set.
 * @return  The next <code>Node</code> in the set being iterated over, or
 *   <code>null</code> if there are no more members in that set.
 */
public int nextNode()
{
      if(m_foundLast)
              return DTM.NULL;

  // If the variable stack position is not -1, we'll have to
  // set our position in the variable stack, so our variable access
  // will be correct.  Iterators that are at the top level of the
  // expression need to reset the variable stack, while iterators
  // in predicates do not need to, and should not, since their execution
  // may be much later than top-level iterators.
  // m_varStackPos is set in setRoot, which is called
  // from the execute method.
  if (-1 == m_stackFrame)
  {
    return returnNextNode(m_firstWalker.nextNode());
  }
  else
  {
    VariableStack vars = m_execContext.getVarStack();

    // These three statements need to be combined into one operation.
    int savedStart = vars.getStackFrame();

    vars.setStackFrame(m_stackFrame);

    int n = returnNextNode(m_firstWalker.nextNode());

    // These two statements need to be combined into one operation.
    vars.setStackFrame(savedStart);

    return n;
  }
}
 
Example #9
Source File: WalkingIterator.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 *  Returns the next node in the set and advances the position of the
 * iterator in the set. After a NodeIterator is created, the first call
 * to nextNode() returns the first node in the set.
 * @return  The next <code>Node</code> in the set being iterated over, or
 *   <code>null</code> if there are no more members in that set.
 */
public int nextNode()
{
      if(m_foundLast)
              return DTM.NULL;

  // If the variable stack position is not -1, we'll have to
  // set our position in the variable stack, so our variable access
  // will be correct.  Iterators that are at the top level of the
  // expression need to reset the variable stack, while iterators
  // in predicates do not need to, and should not, since their execution
  // may be much later than top-level iterators.
  // m_varStackPos is set in setRoot, which is called
  // from the execute method.
  if (-1 == m_stackFrame)
  {
    return returnNextNode(m_firstWalker.nextNode());
  }
  else
  {
    VariableStack vars = m_execContext.getVarStack();

    // These three statements need to be combined into one operation.
    int savedStart = vars.getStackFrame();

    vars.setStackFrame(m_stackFrame);

    int n = returnNextNode(m_firstWalker.nextNode());

    // These two statements need to be combined into one operation.
    vars.setStackFrame(savedStart);

    return n;
  }
}
 
Example #10
Source File: WalkingIterator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 *  Returns the next node in the set and advances the position of the
 * iterator in the set. After a NodeIterator is created, the first call
 * to nextNode() returns the first node in the set.
 * @return  The next <code>Node</code> in the set being iterated over, or
 *   <code>null</code> if there are no more members in that set.
 */
public int nextNode()
{
      if(m_foundLast)
              return DTM.NULL;

  // If the variable stack position is not -1, we'll have to
  // set our position in the variable stack, so our variable access
  // will be correct.  Iterators that are at the top level of the
  // expression need to reset the variable stack, while iterators
  // in predicates do not need to, and should not, since their execution
  // may be much later than top-level iterators.
  // m_varStackPos is set in setRoot, which is called
  // from the execute method.
  if (-1 == m_stackFrame)
  {
    return returnNextNode(m_firstWalker.nextNode());
  }
  else
  {
    VariableStack vars = m_execContext.getVarStack();

    // These three statements need to be combined into one operation.
    int savedStart = vars.getStackFrame();

    vars.setStackFrame(m_stackFrame);

    int n = returnNextNode(m_firstWalker.nextNode());

    // These two statements need to be combined into one operation.
    vars.setStackFrame(savedStart);

    return n;
  }
}
 
Example #11
Source File: WalkingIterator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *  Returns the next node in the set and advances the position of the
 * iterator in the set. After a NodeIterator is created, the first call
 * to nextNode() returns the first node in the set.
 * @return  The next <code>Node</code> in the set being iterated over, or
 *   <code>null</code> if there are no more members in that set.
 */
public int nextNode()
{
      if(m_foundLast)
              return DTM.NULL;

  // If the variable stack position is not -1, we'll have to
  // set our position in the variable stack, so our variable access
  // will be correct.  Iterators that are at the top level of the
  // expression need to reset the variable stack, while iterators
  // in predicates do not need to, and should not, since their execution
  // may be much later than top-level iterators.
  // m_varStackPos is set in setRoot, which is called
  // from the execute method.
  if (-1 == m_stackFrame)
  {
    return returnNextNode(m_firstWalker.nextNode());
  }
  else
  {
    VariableStack vars = m_execContext.getVarStack();

    // These three statements need to be combined into one operation.
    int savedStart = vars.getStackFrame();

    vars.setStackFrame(m_stackFrame);

    int n = returnNextNode(m_firstWalker.nextNode());

    // These two statements need to be combined into one operation.
    vars.setStackFrame(savedStart);

    return n;
  }
}
 
Example #12
Source File: FilterExprIteratorSimple.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Execute the expression.  Meant for reuse by other FilterExpr iterators
 * that are not derived from this object.
 */
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
                                                                                              PrefixResolver prefixResolver,
                                                                                              boolean isTopLevel,
                                                                                              int stackFrame,
                                                                                              Expression expr )
  throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
{
  PrefixResolver savedResolver = xctxt.getNamespaceContext();
  XNodeSet result = null;

  try
  {
    xctxt.pushCurrentNode(context);
    xctxt.setNamespaceContext(prefixResolver);

    // The setRoot operation can take place with a reset operation,
    // and so we may not be in the context of LocPathIterator#nextNode,
    // so we have to set up the variable context, execute the expression,
    // and then restore the variable context.

    if (isTopLevel)
    {
      // System.out.println("calling m_expr.execute(getXPathContext())");
      VariableStack vars = xctxt.getVarStack();

      // These three statements need to be combined into one operation.
      int savedStart = vars.getStackFrame();
      vars.setStackFrame(stackFrame);

      result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
      result.setShouldCacheNodes(true);

      // These two statements need to be combined into one operation.
      vars.setStackFrame(savedStart);
    }
    else
        result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);

  }
  catch (javax.xml.transform.TransformerException se)
  {

    // TODO: Fix...
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
    xctxt.setNamespaceContext(savedResolver);
  }
  return result;
}
 
Example #13
Source File: FilterExprIteratorSimple.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Execute the expression.  Meant for reuse by other FilterExpr iterators
 * that are not derived from this object.
 */
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
                                                                                              PrefixResolver prefixResolver,
                                                                                              boolean isTopLevel,
                                                                                              int stackFrame,
                                                                                              Expression expr )
  throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
{
  PrefixResolver savedResolver = xctxt.getNamespaceContext();
  XNodeSet result = null;

  try
  {
    xctxt.pushCurrentNode(context);
    xctxt.setNamespaceContext(prefixResolver);

    // The setRoot operation can take place with a reset operation,
    // and so we may not be in the context of LocPathIterator#nextNode,
    // so we have to set up the variable context, execute the expression,
    // and then restore the variable context.

    if (isTopLevel)
    {
      // System.out.println("calling m_expr.execute(getXPathContext())");
      VariableStack vars = xctxt.getVarStack();

      // These three statements need to be combined into one operation.
      int savedStart = vars.getStackFrame();
      vars.setStackFrame(stackFrame);

      result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
      result.setShouldCacheNodes(true);

      // These two statements need to be combined into one operation.
      vars.setStackFrame(savedStart);
    }
    else
        result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);

  }
  catch (javax.xml.transform.TransformerException se)
  {

    // TODO: Fix...
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
    xctxt.setNamespaceContext(savedResolver);
  }
  return result;
}
 
Example #14
Source File: FilterExprIteratorSimple.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Execute the expression.  Meant for reuse by other FilterExpr iterators
 * that are not derived from this object.
 */
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
                                                                                              PrefixResolver prefixResolver,
                                                                                              boolean isTopLevel,
                                                                                              int stackFrame,
                                                                                              Expression expr )
  throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
{
  PrefixResolver savedResolver = xctxt.getNamespaceContext();
  XNodeSet result = null;

  try
  {
    xctxt.pushCurrentNode(context);
    xctxt.setNamespaceContext(prefixResolver);

    // The setRoot operation can take place with a reset operation,
    // and so we may not be in the context of LocPathIterator#nextNode,
    // so we have to set up the variable context, execute the expression,
    // and then restore the variable context.

    if (isTopLevel)
    {
      // System.out.println("calling m_expr.execute(getXPathContext())");
      VariableStack vars = xctxt.getVarStack();

      // These three statements need to be combined into one operation.
      int savedStart = vars.getStackFrame();
      vars.setStackFrame(stackFrame);

      result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
      result.setShouldCacheNodes(true);

      // These two statements need to be combined into one operation.
      vars.setStackFrame(savedStart);
    }
    else
        result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);

  }
  catch (javax.xml.transform.TransformerException se)
  {

    // TODO: Fix...
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
    xctxt.setNamespaceContext(savedResolver);
  }
  return result;
}
 
Example #15
Source File: FilterExprIteratorSimple.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Execute the expression.  Meant for reuse by other FilterExpr iterators
 * that are not derived from this object.
 */
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
                                                                                              PrefixResolver prefixResolver,
                                                                                              boolean isTopLevel,
                                                                                              int stackFrame,
                                                                                              Expression expr )
  throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
{
  PrefixResolver savedResolver = xctxt.getNamespaceContext();
  XNodeSet result = null;

  try
  {
    xctxt.pushCurrentNode(context);
    xctxt.setNamespaceContext(prefixResolver);

    // The setRoot operation can take place with a reset operation,
    // and so we may not be in the context of LocPathIterator#nextNode,
    // so we have to set up the variable context, execute the expression,
    // and then restore the variable context.

    if (isTopLevel)
    {
      // System.out.println("calling m_expr.execute(getXPathContext())");
      VariableStack vars = xctxt.getVarStack();

      // These three statements need to be combined into one operation.
      int savedStart = vars.getStackFrame();
      vars.setStackFrame(stackFrame);

      result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
      result.setShouldCacheNodes(true);

      // These two statements need to be combined into one operation.
      vars.setStackFrame(savedStart);
    }
    else
        result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);

  }
  catch (javax.xml.transform.TransformerException se)
  {

    // TODO: Fix...
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
    xctxt.setNamespaceContext(savedResolver);
  }
  return result;
}
 
Example #16
Source File: FilterExprIteratorSimple.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Execute the expression.  Meant for reuse by other FilterExpr iterators
 * that are not derived from this object.
 */
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
                                                                                              PrefixResolver prefixResolver,
                                                                                              boolean isTopLevel,
                                                                                              int stackFrame,
                                                                                              Expression expr )
  throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
{
  PrefixResolver savedResolver = xctxt.getNamespaceContext();
  XNodeSet result = null;

  try
  {
    xctxt.pushCurrentNode(context);
    xctxt.setNamespaceContext(prefixResolver);

    // The setRoot operation can take place with a reset operation,
    // and so we may not be in the context of LocPathIterator#nextNode,
    // so we have to set up the variable context, execute the expression,
    // and then restore the variable context.

    if (isTopLevel)
    {
      // System.out.println("calling m_expr.execute(getXPathContext())");
      VariableStack vars = xctxt.getVarStack();

      // These three statements need to be combined into one operation.
      int savedStart = vars.getStackFrame();
      vars.setStackFrame(stackFrame);

      result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
      result.setShouldCacheNodes(true);

      // These two statements need to be combined into one operation.
      vars.setStackFrame(savedStart);
    }
    else
        result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);

  }
  catch (javax.xml.transform.TransformerException se)
  {

    // TODO: Fix...
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
    xctxt.setNamespaceContext(savedResolver);
  }
  return result;
}
 
Example #17
Source File: FilterExprIteratorSimple.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
/**
 * Execute the expression.  Meant for reuse by other FilterExpr iterators
 * that are not derived from this object.
 */
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
                                                                                              PrefixResolver prefixResolver,
                                                                                              boolean isTopLevel,
                                                                                              int stackFrame,
                                                                                              Expression expr )
  throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
{
  PrefixResolver savedResolver = xctxt.getNamespaceContext();
  XNodeSet result = null;

  try
  {
    xctxt.pushCurrentNode(context);
    xctxt.setNamespaceContext(prefixResolver);

    // The setRoot operation can take place with a reset operation,
    // and so we may not be in the context of LocPathIterator#nextNode,
    // so we have to set up the variable context, execute the expression,
    // and then restore the variable context.

    if (isTopLevel)
    {
      // System.out.println("calling m_expr.execute(getXPathContext())");
      VariableStack vars = xctxt.getVarStack();

      // These three statements need to be combined into one operation.
      int savedStart = vars.getStackFrame();
      vars.setStackFrame(stackFrame);

      result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
      result.setShouldCacheNodes(true);

      // These two statements need to be combined into one operation.
      vars.setStackFrame(savedStart);
    }
    else
        result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);

  }
  catch (javax.xml.transform.TransformerException se)
  {

    // TODO: Fix...
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
    xctxt.setNamespaceContext(savedResolver);
  }
  return result;
}
 
Example #18
Source File: FilterExprIteratorSimple.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Execute the expression.  Meant for reuse by other FilterExpr iterators
 * that are not derived from this object.
 */
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
                                                                                              PrefixResolver prefixResolver,
                                                                                              boolean isTopLevel,
                                                                                              int stackFrame,
                                                                                              Expression expr )
  throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
{
  PrefixResolver savedResolver = xctxt.getNamespaceContext();
  XNodeSet result = null;

  try
  {
    xctxt.pushCurrentNode(context);
    xctxt.setNamespaceContext(prefixResolver);

    // The setRoot operation can take place with a reset operation,
    // and so we may not be in the context of LocPathIterator#nextNode,
    // so we have to set up the variable context, execute the expression,
    // and then restore the variable context.

    if (isTopLevel)
    {
      // System.out.println("calling m_expr.execute(getXPathContext())");
      VariableStack vars = xctxt.getVarStack();

      // These three statements need to be combined into one operation.
      int savedStart = vars.getStackFrame();
      vars.setStackFrame(stackFrame);

      result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
      result.setShouldCacheNodes(true);

      // These two statements need to be combined into one operation.
      vars.setStackFrame(savedStart);
    }
    else
        result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);

  }
  catch (javax.xml.transform.TransformerException se)
  {

    // TODO: Fix...
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
    xctxt.setNamespaceContext(savedResolver);
  }
  return result;
}
 
Example #19
Source File: FilterExprIteratorSimple.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
/**
 * Execute the expression.  Meant for reuse by other FilterExpr iterators
 * that are not derived from this object.
 */
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
                                                                                              PrefixResolver prefixResolver,
                                                                                              boolean isTopLevel,
                                                                                              int stackFrame,
                                                                                              Expression expr )
  throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
{
  PrefixResolver savedResolver = xctxt.getNamespaceContext();
  XNodeSet result = null;

  try
  {
    xctxt.pushCurrentNode(context);
    xctxt.setNamespaceContext(prefixResolver);

    // The setRoot operation can take place with a reset operation,
    // and so we may not be in the context of LocPathIterator#nextNode,
    // so we have to set up the variable context, execute the expression,
    // and then restore the variable context.

    if (isTopLevel)
    {
      // System.out.println("calling m_expr.execute(getXPathContext())");
      VariableStack vars = xctxt.getVarStack();

      // These three statements need to be combined into one operation.
      int savedStart = vars.getStackFrame();
      vars.setStackFrame(stackFrame);

      result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
      result.setShouldCacheNodes(true);

      // These two statements need to be combined into one operation.
      vars.setStackFrame(savedStart);
    }
    else
        result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);

  }
  catch (javax.xml.transform.TransformerException se)
  {

    // TODO: Fix...
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
    xctxt.setNamespaceContext(savedResolver);
  }
  return result;
}
 
Example #20
Source File: FilterExprIteratorSimple.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Execute the expression.  Meant for reuse by other FilterExpr iterators
 * that are not derived from this object.
 */
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
                                                                                              PrefixResolver prefixResolver,
                                                                                              boolean isTopLevel,
                                                                                              int stackFrame,
                                                                                              Expression expr )
  throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
{
  PrefixResolver savedResolver = xctxt.getNamespaceContext();
  XNodeSet result = null;

  try
  {
    xctxt.pushCurrentNode(context);
    xctxt.setNamespaceContext(prefixResolver);

    // The setRoot operation can take place with a reset operation,
    // and so we may not be in the context of LocPathIterator#nextNode,
    // so we have to set up the variable context, execute the expression,
    // and then restore the variable context.

    if (isTopLevel)
    {
      // System.out.println("calling m_expr.execute(getXPathContext())");
      VariableStack vars = xctxt.getVarStack();

      // These three statements need to be combined into one operation.
      int savedStart = vars.getStackFrame();
      vars.setStackFrame(stackFrame);

      result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
      result.setShouldCacheNodes(true);

      // These two statements need to be combined into one operation.
      vars.setStackFrame(savedStart);
    }
    else
        result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);

  }
  catch (javax.xml.transform.TransformerException se)
  {

    // TODO: Fix...
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
    xctxt.setNamespaceContext(savedResolver);
  }
  return result;
}
 
Example #21
Source File: FilterExprIteratorSimple.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Execute the expression.  Meant for reuse by other FilterExpr iterators
 * that are not derived from this object.
 */
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
                                                                                              PrefixResolver prefixResolver,
                                                                                              boolean isTopLevel,
                                                                                              int stackFrame,
                                                                                              Expression expr )
  throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
{
  PrefixResolver savedResolver = xctxt.getNamespaceContext();
  XNodeSet result = null;

  try
  {
    xctxt.pushCurrentNode(context);
    xctxt.setNamespaceContext(prefixResolver);

    // The setRoot operation can take place with a reset operation,
    // and so we may not be in the context of LocPathIterator#nextNode,
    // so we have to set up the variable context, execute the expression,
    // and then restore the variable context.

    if (isTopLevel)
    {
      // System.out.println("calling m_expr.execute(getXPathContext())");
      VariableStack vars = xctxt.getVarStack();

      // These three statements need to be combined into one operation.
      int savedStart = vars.getStackFrame();
      vars.setStackFrame(stackFrame);

      result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
      result.setShouldCacheNodes(true);

      // These two statements need to be combined into one operation.
      vars.setStackFrame(savedStart);
    }
    else
        result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);

  }
  catch (javax.xml.transform.TransformerException se)
  {

    // TODO: Fix...
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
    xctxt.setNamespaceContext(savedResolver);
  }
  return result;
}
 
Example #22
Source File: FilterExprIteratorSimple.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/**
 * Execute the expression.  Meant for reuse by other FilterExpr iterators
 * that are not derived from this object.
 */
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
                                                                                              PrefixResolver prefixResolver,
                                                                                              boolean isTopLevel,
                                                                                              int stackFrame,
                                                                                              Expression expr )
  throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
{
  PrefixResolver savedResolver = xctxt.getNamespaceContext();
  XNodeSet result = null;

  try
  {
    xctxt.pushCurrentNode(context);
    xctxt.setNamespaceContext(prefixResolver);

    // The setRoot operation can take place with a reset operation,
    // and so we may not be in the context of LocPathIterator#nextNode,
    // so we have to set up the variable context, execute the expression,
    // and then restore the variable context.

    if (isTopLevel)
    {
      // System.out.println("calling m_expr.execute(getXPathContext())");
      VariableStack vars = xctxt.getVarStack();

      // These three statements need to be combined into one operation.
      int savedStart = vars.getStackFrame();
      vars.setStackFrame(stackFrame);

      result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
      result.setShouldCacheNodes(true);

      // These two statements need to be combined into one operation.
      vars.setStackFrame(savedStart);
    }
    else
        result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);

  }
  catch (javax.xml.transform.TransformerException se)
  {

    // TODO: Fix...
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
    xctxt.setNamespaceContext(savedResolver);
  }
  return result;
}