/** * Simplify an expression * @param visitor an expression visitor */ public Expression simplify(ExpressionVisitor visitor) throws XPathException { operand = visitor.simplify(operand); if (operand instanceof Literal) { return Literal.makeLiteral( new SequenceExtent(iterate(visitor.getStaticContext().makeEarlyEvaluationContext()))); } return this; }
/** * Simplify an expression * @param visitor an expression visitor */ public Expression simplify(ExpressionVisitor visitor) throws XPathException { operand = visitor.simplify(operand); if (operand instanceof Literal) { return Literal.makeLiteral( new SequenceExtent(iterate(visitor.getStaticContext().makeEarlyEvaluationContext()))); } return this; }
/** * Simplify an expression * @param visitor an expression visitor */ public Expression simplify(ExpressionVisitor visitor) throws XPathException { operand = visitor.simplify(operand); if (operand instanceof Literal) { ValueRepresentation val = SequenceExtent.makeSequenceExtent( iterate(visitor.getStaticContext().makeEarlyEvaluationContext())); return Literal.makeLiteral(Value.asValue(val)); } return this; }
/** * Simplify an expression * */ /*@NotNull*/ public Expression simplify() throws XPathException { Expression operand = getBaseExpression().simplify(); setBaseExpression(operand); if (operand instanceof Literal && requiredItemType instanceof AtomicType) { if (Literal.isEmptySequence(operand)) { return operand; } Configuration config = getConfiguration(); allocateConverterStatically(config, true); if (converter != null) { GroundedValue<?> val = iterate(new EarlyEvaluationContext(config)).materialize(); return Literal.makeLiteral(val, operand); } } return this; }
/** * Simplify an expression * */ /*@NotNull*/ public Expression simplify() throws XPathException { Expression operand = getBaseExpression().simplify(); setBaseExpression(operand); if (operand instanceof Literal && requiredItemType instanceof AtomicType) { if (Literal.isEmptySequence(operand)) { return operand; } Configuration config = getConfiguration(); allocateConverterStatically(config, true); if (converter != null) { GroundedValue<?> val = iterate(new EarlyEvaluationContext(config)).materialize(); return Literal.makeLiteral(val, operand); } } return this; }