Java Code Examples for org.apache.xpath.Expression#exprSetParent()

The following examples show how to use org.apache.xpath.Expression#exprSetParent() . 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: UnionPathIterator.java    From j2objc with Apache License 2.0 6 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	
	if(!(exp instanceof LocPathIterator))
	{
		// Yuck.  Need FilterExprIter.  Or make it so m_exprs can be just 
		// plain expressions?
		WalkingIterator wi = new WalkingIterator(getPrefixResolver());
		FilterExprWalker few = new FilterExprWalker(wi);
		wi.setFirstWalker(few);
		few.setInnerExpression(exp);
		wi.exprSetParent(UnionPathIterator.this);
		few.exprSetParent(wi);
		exp.exprSetParent(few);
		exp = wi;
	}
	else
		exp.exprSetParent(UnionPathIterator.this);
	m_exprs[m_index] = (LocPathIterator)exp;
}
 
Example 2
Source File: FuncExtFunction.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Set the parent node.
 * For an extension function, we also need to set the parent
 * node for all argument expressions.
 * 
 * @param n The parent node
 */
public void exprSetParent(ExpressionNode n) 
{
	
  super.exprSetParent(n);
    
  int nArgs = m_argVec.size();

  for (int i = 0; i < nArgs; i++)
  {
    Expression arg = (Expression) m_argVec.elementAt(i);

    arg.exprSetParent(n);
  }		
}
 
Example 3
Source File: FunctionMultiArgs.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Set an argument expression for a function.  This method is called by the
 * XPath compiler.
 *
 * @param arg non-null expression that represents the argument.
 * @param argNum The argument number index.
 *
 * @throws WrongNumberArgsException If a derived class determines that the
 * number of arguments is incorrect.
 */
public void setArg(Expression arg, int argNum)
        throws WrongNumberArgsException
{

  if (argNum < 3)
    super.setArg(arg, argNum);
  else
  {
    if (null == m_args)
    {
      m_args = new Expression[1];
      m_args[0] = arg;
    }
    else
    {

      // Slow but space conservative.
      Expression[] args = new Expression[m_args.length + 1];

      System.arraycopy(m_args, 0, args, 0, m_args.length);

      args[m_args.length] = arg;
      m_args = args;
    }
    arg.exprSetParent(this);
  }
}
 
Example 4
Source File: FunctionOneArg.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(this);
	m_arg0 = exp;
}
 
Example 5
Source File: AxesWalker.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(this);
	m_nextWalker = (AxesWalker)exp;
}
 
Example 6
Source File: FilterExprIterator.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
  exp.exprSetParent(FilterExprIterator.this);
  m_expr = exp;
}
 
Example 7
Source File: FuncExtFunction.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(FuncExtFunction.this);
	m_exp = exp;
}
 
Example 8
Source File: Function3Args.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(Function3Args.this);
	m_arg2 = exp;
}
 
Example 9
Source File: FilterExprIteratorSimple.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
  exp.exprSetParent(FilterExprIteratorSimple.this);
  m_expr = exp;
}
 
Example 10
Source File: FilterExprIteratorSimple.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * Set the inner contained expression of this filter.
 */
public void setInnerExpression(Expression expr)
{
  expr.exprSetParent(this);
  m_expr = expr;
}
 
Example 11
Source File: WalkingIterator.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(this);
	m_firstWalker = (AxesWalker)exp;
}
 
Example 12
Source File: FilterExprWalker.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(FilterExprWalker.this);
	m_expr = exp;
}
 
Example 13
Source File: Function2Args.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(Function2Args.this);
	m_arg1 = exp;
}
 
Example 14
Source File: UnaryOperation.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(this);
	m_right = exp;
}
 
Example 15
Source File: Operation.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(this);
	m_right = exp;
}
 
Example 16
Source File: Operation.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(Operation.this);
	m_left = exp;
}
 
Example 17
Source File: UnionPattern.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(UnionPattern.this);
	m_patterns[m_index] = (StepPattern)exp;
}
 
Example 18
Source File: StepPattern.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
  exp.exprSetParent(this);
	m_relativePathPattern = (StepPattern)exp;
}
 
Example 19
Source File: FunctionPattern.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{
	exp.exprSetParent(FunctionPattern.this);
	m_functionExpr = exp;
}
 
Example 20
Source File: FuncExtFunction.java    From j2objc with Apache License 2.0 3 votes vote down vote up
/**
 * Set an argument expression for a function.  This method is called by the
 * XPath compiler.
 *
 * @param arg non-null expression that represents the argument.
 * @param argNum The argument number index.
 *
 * @throws WrongNumberArgsException If the argNum parameter is beyond what
 * is specified for this function.
 */
public void setArg(Expression arg, int argNum)
        throws WrongNumberArgsException
{
  m_argVec.addElement(arg);
  arg.exprSetParent(this);
}