/** * Returns the String representation of this Exception * @return the String representation of this Exception **/ public String toString() { StringBuffer sb = new StringBuffer("ValidationException: "); String message = getMessage(); if (message != null) { sb.append(message); } return sb.toString(); }
/** * Returns the String representation of this Exception * @return the String representation of this Exception **/ public String toString() { StringBuffer sb = new StringBuffer("ValidationException: "); String message = getMessage(); if (message != null) { sb.append(message); } return sb.toString(); }
/** * Returns the detail message string of this throwable. * * @return the detail message string of this {@code Throwable} instance * (which may be {@code null}). */ @Override public String getMessage() { // The message held in the ValidationFailure is sometimes updated, so we use that one in preference. // The message in the exception can't be updated, it can only be set from the constructor. if (failure != null) { return failure.getMessage(); } else { return super.getMessage(); } }
/** * Returns the detail message string of this throwable. * * @return the detail message string of this {@code Throwable} instance * (which may be {@code null}). */ @Override public String getMessage() { // The message held in the ValidationFailure is sometimes updated, so we use that one in preference. // The message in the exception can't be updated, it can only be set from the constructor. if (failure != null) { return failure.getMessage(); } else { return super.getMessage(); } }
/** * Create a new ValidationException that wraps a ValidationFailure * @param failure the ValidationFailure to be wrapped */ public ValidationException(ValidationFailure failure) { super(failure.getMessage(), failure.getErrorCode(), failure.getLocator()); this.failure = failure; }
/** * Create a new ValidationException that wraps a ValidationFailure * @param failure the ValidationFailure to be wrapped */ public ValidationException(ValidationFailure failure) { super(failure.getMessage(), failure.getErrorCode(), failure.getLocator()); this.failure = failure; }
/** * Factory method: create a dateTime value from a supplied string, in ISO 8601 format, allowing * a year value of 0 to represent the year before year 1 (that is, following the XSD 1.1 rules). * <p>The {@code hasNoYearZero} property in the result is set to false.</p> * * @param s a string in the lexical space of xs:dateTime * @return a DateTimeValue representing the xs:dateTime supplied, including a timezone offset if * present in the lexical representation * @throws DateTimeParseException if the format of the supplied string is invalid. * @since 9.9 */ public static DateTimeValue parse(CharSequence s) throws DateTimeParseException { ConversionResult result = makeDateTimeValue(s, ConversionRules.DEFAULT); if (result instanceof ValidationFailure) { throw new DateTimeParseException(((ValidationFailure) result).getMessage(), s, 0); } else { return (DateTimeValue)result; } }
/** * Factory method: create an xs:date value from a supplied string, in ISO 8601 format, allowing * a year value of 0 to represent the year before year 1 (that is, following the XSD 1.1 rules). * <p>The {@code hasNoYearZero} property in the result is set to false.</p> * * @param s a string in the lexical space of xs:date * @return a DateValue representing the xs:date supplied, including a timezone offset if * present in the lexical representation * @throws DateTimeParseException if the format of the supplied string is invalid. * @since 9.9 */ public static DateValue parse(CharSequence s) throws DateTimeParseException { ConversionResult result = makeDateValue(s, ConversionRules.DEFAULT); if (result instanceof ValidationFailure) { throw new DateTimeParseException(((ValidationFailure) result).getMessage(), s, 0); } else { return (DateValue) result; } }
/** * Factory method: create an xs:date value from a supplied string, in ISO 8601 format, allowing * a year value of 0 to represent the year before year 1 (that is, following the XSD 1.1 rules). * <p>The {@code hasNoYearZero} property in the result is set to false.</p> * * @param s a string in the lexical space of xs:date * @return a DateValue representing the xs:date supplied, including a timezone offset if * present in the lexical representation * @throws DateTimeParseException if the format of the supplied string is invalid. * @since 9.9 */ public static DateValue parse(CharSequence s) throws DateTimeParseException { ConversionResult result = makeDateValue(s, ConversionRules.DEFAULT); if (result instanceof ValidationFailure) { throw new DateTimeParseException(((ValidationFailure) result).getMessage(), s, 0); } else { return (DateValue) result; } }
/** * Factory method: create a dateTime value from a supplied string, in ISO 8601 format, allowing * a year value of 0 to represent the year before year 1 (that is, following the XSD 1.1 rules). * <p>The {@code hasNoYearZero} property in the result is set to false.</p> * * @param s a string in the lexical space of xs:dateTime * @return a DateTimeValue representing the xs:dateTime supplied, including a timezone offset if * present in the lexical representation * @throws DateTimeParseException if the format of the supplied string is invalid. * @since 9.9 */ public static DateTimeValue parse(CharSequence s) throws DateTimeParseException { ConversionResult result = makeDateTimeValue(s, ConversionRules.DEFAULT); if (result instanceof ValidationFailure) { throw new DateTimeParseException(((ValidationFailure) result).getMessage(), s, 0); } else { return (DateTimeValue)result; } }
/** * Returns the String representation of this Exception * * @return the String representation of this Exception */ public String toString() { FastStringBuffer sb = new FastStringBuffer("ValidationException: "); String message = getMessage(); if (message != null) { sb.append(message); } return sb.toString(); }
/** * Returns the String representation of this Exception * * @return the String representation of this Exception */ public String toString() { FastStringBuffer sb = new FastStringBuffer("ValidationException: "); String message = getMessage(); if (message != null) { sb.append(message); } return sb.toString(); }
ValidationFailure err = (ValidationFailure)result; String code = err.getErrorCode(); dynamicError(err.getMessage(), code, context); return null;
code = "FORG0001"; dynamicError(err.getMessage(), code, context); return null;
/** * Perform early (compile-time) evaluation */ protected Expression preEvaluate() throws XPathException { GroundedValue literalOperand = ((Literal) getBaseExpression()).getValue(); if (literalOperand instanceof AtomicValue && converter != null) { ConversionResult result = converter.convert((AtomicValue) literalOperand); if (result instanceof ValidationFailure) { ValidationFailure err = (ValidationFailure) result; String code = err.getErrorCode(); if (code == null) { code = "FORG0001"; } throw new XPathException(err.getMessage(), code, this.getLocation()); } else { return Literal.makeLiteral((AtomicValue) result, this); } } if (literalOperand.getLength() == 0) { if (allowsEmpty()) { return getBaseExpression(); } else { XPathException err = new XPathException("Cast can never succeed: the operand must not be an empty sequence", "XPTY0004", this.getLocation()); err.setIsTypeError(true); throw err; } } return this; }
/** * Perform early (compile-time) evaluation */ protected Expression preEvaluate() throws XPathException { GroundedValue literalOperand = ((Literal) getBaseExpression()).getValue(); if (literalOperand instanceof AtomicValue && converter != null) { ConversionResult result = converter.convert((AtomicValue) literalOperand); if (result instanceof ValidationFailure) { ValidationFailure err = (ValidationFailure) result; String code = err.getErrorCode(); if (code == null) { code = "FORG0001"; } throw new XPathException(err.getMessage(), code, this.getLocation()); } else { return Literal.makeLiteral((AtomicValue) result, this); } } if (literalOperand.getLength() == 0) { if (allowsEmpty()) { return getBaseExpression(); } else { XPathException err = new XPathException("Cast can never succeed: the operand must not be an empty sequence", "XPTY0004", this.getLocation()); err.setIsTypeError(true); throw err; } } return this; }
" does not the match the required type " + schemaType.getDescription() + ". " + err.getMessage());
" does not the match the required type " + schemaType.getDescription() + ". " + err.getMessage());
" does not the match the required type " + schemaType.getDescription() + ". " + err.getMessage());
" does not the match the required type " + schemaType.getDescription() + ". " + err.getMessage()); err.setErrorCode("XTTE1555"); err.setLocator(getLocation());