public Object getProperty(String name) { if (name.equals("expression")) { return Expression.this.getLocation(); } else { return null; } }
/** * Get a hashCode that offers the guarantee that if A.isIdentical(B), then A.identityHashCode() == B.identityHashCode() * * @return a hashCode suitable for use when testing for identity. */ public int identityHashCode() { return System.identityHashCode(Expression.this.getLocation()); }
/** * Get a hashCode that offers the guarantee that if A.isIdentical(B), then A.identityHashCode() == B.identityHashCode() * * @return a hashCode suitable for use when testing for identity. */ public int identityHashCode() { return System.identityHashCode(Expression.this.getLocation()); }
public Object getProperty(String name) { if (name.equals("expression")) { return Expression.this.getLocation(); } else { return null; } }
public void maybeSetFailingExpression(Expression failingExpression) { if (this.failingExpression == null) { this.failingExpression = failingExpression; } maybeSetLocation(failingExpression.getLocation()); }
@Override public Expression makeFunctionCall(Expression... arguments) { // Fix bug 2597 Expression e = super.makeFunctionCall(arguments); location = e.getLocation(); return e; }
/** * Get the column number identifying the position of the instruction. * * @return -1 if column number is not known */ public int getColumnNumber() { return expr.getLocation().getColumnNumber(); }
/** * Get the URI of the module containing the instruction * * @return the module's URI, or null indicating unknown */ /*@Nullable*/ public String getSystemId() { return expr.getLocation().getSystemId(); }
/** * Get the column number identifying the position of the instruction. * * @return -1 if column number is not known */ public int getColumnNumber() { return expr.getLocation().getColumnNumber(); }
/** * Get the line number of the instruction within its module * * @return the line number */ public int getLineNumber() { return expr.getLocation().getLineNumber(); }
@Override public Expression makeFunctionCall(Expression... arguments) { // Fix bug 2597 Expression e = super.makeFunctionCall(arguments); location = e.getLocation(); return e; }
@Override public Expression makeFunctionCall(Expression... arguments) { location = arguments[0].getLocation(); Expression expr = Doc.maybePreEvaluate(this, arguments); return expr == null ? super.makeFunctionCall(arguments) : expr; }
public ConversionResult convert(/*@NotNull*/ AtomicValue input) { ValidationFailure vf = new ValidationFailure( "Implicit conversion of untypedAtomic value to " + requiredItemType.toString() + " is not allowed"); vf.setErrorCode("XPTY0117"); vf.setLocator(operand.getLocation()); return vf; } };
public ConversionResult convert(/*@NotNull*/ AtomicValue input) { ValidationFailure vf = new ValidationFailure( "Implicit conversion of untypedAtomic value to " + requiredItemType.toString() + " is not allowed"); vf.setErrorCode("XPTY0117"); vf.setLocator(operand.getLocation()); return vf; } };
public InstructionDetails(Expression expr) { setConstructType(expr.getConstructType()); setLineNumber(expr.getLocation().getLineNumber()); setSystemId(expr.getLocation().getSystemId()); setColumnNumber(expr.getLocation().getColumnNumber()); setProperty("name", expr.getExpressionName()); }
public T next() throws XPathException { try { return base.next(); } catch (XPathException e1) { e1.maybeSetLocation(expression.getLocation()); listener.fatalError(e1); e1.setHasBeenReported(true); throw e1; } }
public static void trace(Configuration config, String message, Expression exp) { if (config.getBooleanProperty(Feature.TRACE_OPTIMIZER_DECISIONS)) { Logger err = config.getLogger(); err.info("OPT : At line " + exp.getLocation().getLineNumber() + " of " + exp.getLocation().getSystemId()); err.info("OPT : " + message); err.info("OPT : Expression after rewrite: " + exp.toString()); exp.verifyParentPointers(); } }
public static void trace(Configuration config, String message, Expression exp) { if (config.getBooleanProperty(Feature.TRACE_OPTIMIZER_DECISIONS)) { Logger err = config.getLogger(); err.info("OPT : At line " + exp.getLocation().getLineNumber() + " of " + exp.getLocation().getSystemId()); err.info("OPT : " + message); err.info("OPT : Expression after rewrite: " + exp.toString()); exp.verifyParentPointers(); } }
protected static void mustBeArrayOrMap(Expression exp, Item baseItem) throws XPathException { XPathException exception = new XPathException("The items on the LHS of the '?' operator must be maps or arrays; but value (" + baseItem.toShortString() + ") was supplied", "XPTY0004"); exception.setIsTypeError(true); exception.setLocation(exp.getLocation()); exception.setFailingExpression(exp); throw exception; }
protected static void mustBeArrayOrMap(Expression exp, Item baseItem) throws XPathException { XPathException exception = new XPathException("The items on the LHS of the '?' operator must be maps or arrays; but value (" + baseItem.toShortString() + ") was supplied", "XPTY0004"); exception.setIsTypeError(true); exception.setLocation(exp.getLocation()); exception.setFailingExpression(exp); throw exception; }