/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression */ public Expression copy() { return new ErrorExpression(exception); }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression */ public Expression copy() { return new ErrorExpression(exception); }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression */ public Expression copy() { return new ErrorExpression(exception); }
/** * Parse a node constructor. This is allowed only in XQuery, so the method throws * an error for XPath. * * @return the expression that results from the parsing * @throws net.sf.saxon.trans.XPathException if a static error occurs */ /*@NotNull*/ protected Expression parseConstructor() throws XPathException { grumble("Node constructor expressions are allowed only in XQuery, not in XPath"); return new ErrorExpression(); }
/** * Parse a Typeswitch Expression. * This construct is XQuery-only, so the XPath version of this * method throws an error unconditionally * * @return the expression that results from the parsing * @throws XPathException if a static error is found */ /*@NotNull*/ protected Expression parseTypeswitchExpression() throws XPathException { grumble("typeswitch is not allowed in XPath"); return new ErrorExpression(); }
/** * Parse a node constructor. This is allowed only in XQuery, so the method throws * an error for XPath. * * @return the expression that results from the parsing * @throws net.sf.saxon.trans.XPathException if a static error occurs */ /*@NotNull*/ protected Expression parseConstructor() throws XPathException { grumble("Node constructor expressions are allowed only in XQuery, not in XPath"); return new ErrorExpression(); }
/** * Parse a Typeswitch Expression. * This construct is XQuery-only, so the XPath version of this * method throws an error unconditionally * * @return the expression that results from the parsing * @throws XPathException if a static error is found */ /*@NotNull*/ protected Expression parseTypeswitchExpression() throws XPathException { grumble("typeswitch is not allowed in XPath"); return new ErrorExpression(); }
/** * Parse a Validate Expression. * This construct is XQuery-only, so the XPath version of this * method throws an error unconditionally * * @return the parsed expression; except that this version of the method always * throws an exception * @throws XPathException if a static error is found */ /*@NotNull*/ protected Expression parseValidateExpression() throws XPathException { grumble("validate{} expressions are not allowed in XPath"); return new ErrorExpression(); }
/** * Parse a Switch Expression. * This construct is XQuery-only. * SwitchExpr ::= "switch" "(" Expr ")" SwitchCaseClause+ "default" "return" ExprSingle * SwitchCaseClause ::= ("case" ExprSingle)+ "return" ExprSingle * * @return the parsed expression * @throws XPathException in the event of a syntax error */ /*@NotNull*/ protected Expression parseSwitchExpression() throws XPathException { grumble("switch is not allowed in XPath"); return new ErrorExpression(); }
/** * Parse an Extension Expression * This construct is XQuery-only, so the XPath version of this * method throws an error unconditionally * * @return the parsed expression; except that this version of the method * always throws an exception * @throws XPathException if a static error is found */ /*@NotNull*/ protected Expression parseExtensionExpression() throws XPathException { grumble("extension expressions (#...#) are not allowed in XPath"); return new ErrorExpression(); }
/** * Parse a try/catch Expression * This construct is XQuery-3.0 only, so the XPath version of this * method throws an error unconditionally * * @return the parsed expression; except that this version of the method * always throws an exception * @throws XPathException if a static error is found */ /*@NotNull*/ protected Expression parseTryCatchExpression() throws XPathException { grumble("try/catch expressions are not allowed in XPath"); return new ErrorExpression(); }
/** * Parse an Extension Expression * This construct is XQuery-only, so the XPath version of this * method throws an error unconditionally * * @return the parsed expression; except that this version of the method * always throws an exception * @throws XPathException if a static error is found */ /*@NotNull*/ protected Expression parseExtensionExpression() throws XPathException { grumble("extension expressions (#...#) are not allowed in XPath"); return new ErrorExpression(); }
/** * Make an instruction to implement xsl:evaluate */ public Expression makeEvaluateInstruction(XSLEvaluate source, ComponentDeclaration decl) throws XPathException { return new ErrorExpression(new XPathException("xsl:evaluate is not available in this configuration", "XTDE3175")); // Should not be called: xsl:evaluate is not supported in Saxon-HE }
/** * Make an instruction to implement xsl:evaluate */ public Expression makeEvaluateInstruction(XSLEvaluate source, ComponentDeclaration decl) throws XPathException { return new ErrorExpression(new XPathException("xsl:evaluate is not available in this configuration", "XTDE3175")); // Should not be called: xsl:evaluate is not supported in Saxon-HE }
public void detachChild() { if (DEBUG) { childExpression.setParentExpression(null); StringWriter sw = new StringWriter(); new XPathException("dummy").printStackTrace(new PrintWriter(sw)); childExpression = new ErrorExpression("child expression has been detached: " + sw.toString(), "ZZZ", false); ExpressionTool.copyLocationInfo(parentExpression, childExpression); } }
@Override public Expression copy(RebindingMap rebindings) { if (exception != null) { ErrorExpression e2 = new ErrorExpression(exception); e2.setOriginalExpression(original); ExpressionTool.copyLocationInfo(this, e2); return e2; } else { ErrorExpression e2 = new ErrorExpression(message, errorCode, isTypeError); e2.setOriginalExpression(original); ExpressionTool.copyLocationInfo(this, e2); return e2; } }
public void detachChild() { if (DEBUG) { childExpression.setParentExpression(null); StringWriter sw = new StringWriter(); new XPathException("dummy").printStackTrace(new PrintWriter(sw)); childExpression = new ErrorExpression("child expression has been detached: " + sw.toString(), "ZZZ", false); ExpressionTool.copyLocationInfo(parentExpression, childExpression); } }
public void optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { try { setChildExpression(getChildExpression().optimize(visitor, contextInfo)); } catch (XPathException e) { e.maybeSetLocation(getChildExpression().getLocation()); if (!e.isReportableStatically()) { visitor.getStaticContext().issueWarning( "Evaluation will always throw a dynamic error: " + e.getMessage(), getChildExpression().getLocation()); setChildExpression(new ErrorExpression(e)); } else { throw e; } } }
public void typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { try { setChildExpression(getChildExpression().typeCheck(visitor, contextInfo)); } catch (XPathException e) { e.maybeSetLocation(getChildExpression().getLocation()); if (!e.isReportableStatically()) { visitor.getStaticContext().issueWarning( "Evaluation will always throw a dynamic error: " + e.getMessage(), getChildExpression().getLocation()); setChildExpression(new ErrorExpression(e)); } else { throw e; } } }
public void optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { try { setChildExpression(getChildExpression().optimize(visitor, contextInfo)); } catch (XPathException e) { e.maybeSetLocation(getChildExpression().getLocation()); if (!e.isReportableStatically()) { visitor.getStaticContext().issueWarning( "Evaluation will always throw a dynamic error: " + e.getMessage(), getChildExpression().getLocation()); setChildExpression(new ErrorExpression(e)); } else { throw e; } } }