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

The following examples show how to use com.sun.org.apache.xpath.internal.ExpressionOwner. 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: StepPattern.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Call the visitors on the subtree.  Factored out from callVisitors
 * so it may be called by derived classes.
 */
protected void callSubtreeVisitors(XPathVisitor visitor)
{
  if (null != m_predicates)
  {
    int n = m_predicates.length;
    for (int i = 0; i < n; i++)
    {
      ExpressionOwner predOwner = new PredOwner(i);
      if (visitor.visitPredicate(predOwner, m_predicates[i]))
      {
        m_predicates[i].callVisitors(predOwner, visitor);
      }
    }
  }
  if (null != m_relativePathPattern)
  {
    m_relativePathPattern.callVisitors(this, visitor);
  }
}
 
Example #2
Source File: StepPattern.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Call the visitors on the subtree.  Factored out from callVisitors
 * so it may be called by derived classes.
 */
protected void callSubtreeVisitors(XPathVisitor visitor)
{
  if (null != m_predicates)
  {
    int n = m_predicates.length;
    for (int i = 0; i < n; i++)
    {
      ExpressionOwner predOwner = new PredOwner(i);
      if (visitor.visitPredicate(predOwner, m_predicates[i]))
      {
        m_predicates[i].callVisitors(predOwner, visitor);
      }
    }
  }
  if (null != m_relativePathPattern)
  {
    m_relativePathPattern.callVisitors(this, visitor);
  }
}
 
Example #3
Source File: PredicatedNodeTest.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This will traverse the heararchy, calling the visitor for
 * each member.  If the called visitor method returns
 * false, the subtree should not be called.
 *
 * @param visitor The visitor whose appropriate method will be called.
 */
public void callPredicateVisitors(XPathVisitor visitor)
{
  if (null != m_predicates)
    {
    int n = m_predicates.length;
    for (int i = 0; i < n; i++)
      {
      ExpressionOwner predOwner = new PredOwner(i);
      if (visitor.visitPredicate(predOwner, m_predicates[i]))
        {
        m_predicates[i].callVisitors(predOwner, visitor);
      }

    }
  }
}
 
Example #4
Source File: PredicatedNodeTest.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This will traverse the heararchy, calling the visitor for
 * each member.  If the called visitor method returns
 * false, the subtree should not be called.
 *
 * @param visitor The visitor whose appropriate method will be called.
 */
public void callPredicateVisitors(XPathVisitor visitor)
{
  if (null != m_predicates)
    {
    int n = m_predicates.length;
    for (int i = 0; i < n; i++)
      {
      ExpressionOwner predOwner = new PredOwner(i);
      if (visitor.visitPredicate(predOwner, m_predicates[i]))
        {
        m_predicates[i].callVisitors(predOwner, visitor);
      }

    }
  }
}
 
Example #5
Source File: StepPattern.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Call the visitors on the subtree.  Factored out from callVisitors
 * so it may be called by derived classes.
 */
protected void callSubtreeVisitors(XPathVisitor visitor)
{
  if (null != m_predicates)
  {
    int n = m_predicates.length;
    for (int i = 0; i < n; i++)
    {
      ExpressionOwner predOwner = new PredOwner(i);
      if (visitor.visitPredicate(predOwner, m_predicates[i]))
      {
        m_predicates[i].callVisitors(predOwner, visitor);
      }
    }
  }
  if (null != m_relativePathPattern)
  {
    m_relativePathPattern.callVisitors(this, visitor);
  }
}
 
Example #6
Source File: StepPattern.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Call the visitors on the subtree.  Factored out from callVisitors
 * so it may be called by derived classes.
 */
protected void callSubtreeVisitors(XPathVisitor visitor)
{
  if (null != m_predicates)
  {
    int n = m_predicates.length;
    for (int i = 0; i < n; i++)
    {
      ExpressionOwner predOwner = new PredOwner(i);
      if (visitor.visitPredicate(predOwner, m_predicates[i]))
      {
        m_predicates[i].callVisitors(predOwner, visitor);
      }
    }
  }
  if (null != m_relativePathPattern)
  {
    m_relativePathPattern.callVisitors(this, visitor);
  }
}
 
Example #7
Source File: PredicatedNodeTest.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This will traverse the heararchy, calling the visitor for
 * each member.  If the called visitor method returns
 * false, the subtree should not be called.
 *
 * @param visitor The visitor whose appropriate method will be called.
 */
public void callPredicateVisitors(XPathVisitor visitor)
{
  if (null != m_predicates)
    {
    int n = m_predicates.length;
    for (int i = 0; i < n; i++)
      {
      ExpressionOwner predOwner = new PredOwner(i);
      if (visitor.visitPredicate(predOwner, m_predicates[i]))
        {
        m_predicates[i].callVisitors(predOwner, visitor);
      }

    }
  }
}
 
Example #8
Source File: StepPattern.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Call the visitors on the subtree.  Factored out from callVisitors
 * so it may be called by derived classes.
 */
protected void callSubtreeVisitors(XPathVisitor visitor)
{
  if (null != m_predicates)
  {
    int n = m_predicates.length;
    for (int i = 0; i < n; i++)
    {
      ExpressionOwner predOwner = new PredOwner(i);
      if (visitor.visitPredicate(predOwner, m_predicates[i]))
      {
        m_predicates[i].callVisitors(predOwner, visitor);
      }
    }
  }
  if (null != m_relativePathPattern)
  {
    m_relativePathPattern.callVisitors(this, visitor);
  }
}
 
Example #9
Source File: PredicatedNodeTest.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * This will traverse the heararchy, calling the visitor for
 * each member.  If the called visitor method returns
 * false, the subtree should not be called.
 *
 * @param visitor The visitor whose appropriate method will be called.
 */
public void callPredicateVisitors(XPathVisitor visitor)
{
  if (null != m_predicates)
    {
    int n = m_predicates.length;
    for (int i = 0; i < n; i++)
      {
      ExpressionOwner predOwner = new PredOwner(i);
      if (visitor.visitPredicate(predOwner, m_predicates[i]))
        {
        m_predicates[i].callVisitors(predOwner, visitor);
      }

    }
  }
}
 
Example #10
Source File: PredicatedNodeTest.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * This will traverse the heararchy, calling the visitor for
 * each member.  If the called visitor method returns
 * false, the subtree should not be called.
 *
 * @param visitor The visitor whose appropriate method will be called.
 */
public void callPredicateVisitors(XPathVisitor visitor)
{
  if (null != m_predicates)
    {
    int n = m_predicates.length;
    for (int i = 0; i < n; i++)
      {
      ExpressionOwner predOwner = new PredOwner(i);
      if (visitor.visitPredicate(predOwner, m_predicates[i]))
        {
        m_predicates[i].callVisitors(predOwner, visitor);
      }

    }
  }
}
 
Example #11
Source File: HasPositionalPredChecker.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Visit a predicate within a location path.  Note that there isn't a
 * proper unique component for predicates, and that the expression will
 * be called also for whatever type Expression is.
 *
 * @param owner The owner of the expression, to which the expression can
 *              be reset if rewriting takes place.
 * @param pred The predicate object.
 * @return true if the sub expressions should be traversed.
 */
public boolean visitPredicate(ExpressionOwner owner, Expression pred)
{
  m_predDepth++;

  if(m_predDepth == 1)
  {
    if((pred instanceof Variable) ||
       (pred instanceof XNumber) ||
       (pred instanceof Div) ||
       (pred instanceof Plus) ||
       (pred instanceof Minus) ||
       (pred instanceof Mod) ||
       (pred instanceof Quo) ||
       (pred instanceof Mult) ||
       (pred instanceof com.sun.org.apache.xpath.internal.operations.Number) ||
       (pred instanceof Function))
        m_hasPositionalPred = true;
    else
      pred.callVisitors(owner, this);
  }

  m_predDepth--;

  // Don't go have the caller go any further down the subtree.
  return false;
}
 
Example #12
Source File: StepPattern.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
              if(visitor.visitMatchPattern(owner, this))
              {
                      callSubtreeVisitors(visitor);
              }
}
 
Example #13
Source File: Operation.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
      if(visitor.visitBinaryOperation(owner, this))
      {
              m_left.callVisitors(new LeftExprOwner(), visitor);
              m_right.callVisitors(this, visitor);
      }
}
 
Example #14
Source File: UnaryOperation.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
      if(visitor.visitUnaryOperation(owner, this))
      {
              m_right.callVisitors(this, visitor);
      }
}
 
Example #15
Source File: HasPositionalPredChecker.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Visit a function.
 * @param owner The owner of the expression, to which the expression can
 *              be reset if rewriting takes place.
 * @param func The function reference object.
 * @return true if the sub expressions should be traversed.
 */
public boolean visitFunction(ExpressionOwner owner, Function func)
{
        if((func instanceof FuncPosition) ||
           (func instanceof FuncLast))
                m_hasPositionalPred = true;
        return true;
}
 
Example #16
Source File: HasPositionalPredChecker.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Visit a function.
 * @param owner The owner of the expression, to which the expression can
 *              be reset if rewriting takes place.
 * @param func The function reference object.
 * @return true if the sub expressions should be traversed.
 */
public boolean visitFunction(ExpressionOwner owner, Function func)
{
        if((func instanceof FuncPosition) ||
           (func instanceof FuncLast))
                m_hasPositionalPred = true;
        return true;
}
 
Example #17
Source File: WalkingIterator.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
              if(visitor.visitLocationPath(owner, this))
              {
                      if(null != m_firstWalker)
                      {
                              m_firstWalker.callVisitors(this, visitor);
                      }
              }
}
 
Example #18
Source File: UnionPattern.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
      visitor.visitUnionPattern(owner, this);
      if(null != m_patterns)
      {
              int n = m_patterns.length;
              for(int i = 0; i < n; i++)
              {
                      m_patterns[i].callVisitors(new UnionPathPartOwner(i), visitor);
              }
      }
}
 
Example #19
Source File: Function.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
      if(visitor.visitFunction(owner, this))
      {
              callArgVisitors(visitor);
      }
}
 
Example #20
Source File: UnionPathIterator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
              if(visitor.visitUnionPath(owner, this))
              {
                      if(null != m_exprs)
                      {
                              int n = m_exprs.length;
                              for(int i = 0; i < n; i++)
                              {
                                      m_exprs[i].callVisitors(new iterOwner(i), visitor);
                              }
                      }
              }
}
 
Example #21
Source File: HasPositionalPredChecker.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Visit a function.
 * @param owner The owner of the expression, to which the expression can
 *              be reset if rewriting takes place.
 * @param func The function reference object.
 * @return true if the sub expressions should be traversed.
 */
public boolean visitFunction(ExpressionOwner owner, Function func)
{
        if((func instanceof FuncPosition) ||
           (func instanceof FuncLast))
                m_hasPositionalPred = true;
        return true;
}
 
Example #22
Source File: UnaryOperation.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
      if(visitor.visitUnaryOperation(owner, this))
      {
              m_right.callVisitors(this, visitor);
      }
}
 
Example #23
Source File: WalkingIterator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
              if(visitor.visitLocationPath(owner, this))
              {
                      if(null != m_firstWalker)
                      {
                              m_firstWalker.callVisitors(this, visitor);
                      }
              }
}
 
Example #24
Source File: UnionPathIterator.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
              if(visitor.visitUnionPath(owner, this))
              {
                      if(null != m_exprs)
                      {
                              int n = m_exprs.length;
                              for(int i = 0; i < n; i++)
                              {
                                      m_exprs[i].callVisitors(new iterOwner(i), visitor);
                              }
                      }
              }
}
 
Example #25
Source File: AxesWalker.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * This will traverse the heararchy, calling the visitor for
 * each member.  If the called visitor method returns
 * false, the subtree should not be called.
 *
 * @param owner The owner of the visitor, where that path may be
 *              rewritten if needed.
 * @param visitor The visitor whose appropriate method will be called.
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
      if(visitor.visitStep(owner, this))
      {
              callPredicateVisitors(visitor);
              if(null != m_nextWalker)
              {
                      m_nextWalker.callVisitors(this, visitor);
              }
      }
}
 
Example #26
Source File: LocPathIterator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
              if(visitor.visitLocationPath(owner, this))
              {
                      visitor.visitStep(owner, this);
                      callPredicateVisitors(visitor);
              }
}
 
Example #27
Source File: UnionPathIterator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
              if(visitor.visitUnionPath(owner, this))
              {
                      if(null != m_exprs)
                      {
                              int n = m_exprs.length;
                              for(int i = 0; i < n; i++)
                              {
                                      m_exprs[i].callVisitors(new iterOwner(i), visitor);
                              }
                      }
              }
}
 
Example #28
Source File: StepPattern.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
              if(visitor.visitMatchPattern(owner, this))
              {
                      callSubtreeVisitors(visitor);
              }
}
 
Example #29
Source File: AxesWalker.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This will traverse the heararchy, calling the visitor for
 * each member.  If the called visitor method returns
 * false, the subtree should not be called.
 *
 * @param owner The owner of the visitor, where that path may be
 *              rewritten if needed.
 * @param visitor The visitor whose appropriate method will be called.
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
      if(visitor.visitStep(owner, this))
      {
              callPredicateVisitors(visitor);
              if(null != m_nextWalker)
              {
                      m_nextWalker.callVisitors(this, visitor);
              }
      }
}
 
Example #30
Source File: Function.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
 */
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
{
      if(visitor.visitFunction(owner, this))
      {
              callArgVisitors(visitor);
      }
}