public Item map(Item item) throws XPathException { if (item instanceof UntypedAtomicValue) { ConversionResult val = ((UntypedAtomicValue)item).convert(requiredItemType, true, context); if (val instanceof ValidationFailure) { ValidationFailure vex = (ValidationFailure)val; vex.setLocator(UntypedAtomicConverter.this); throw vex.makeException(); } return (AtomicValue)val; } else { return item; } } };
public Item map(Item item) throws XPathException { if (item instanceof UntypedAtomicValue) { ConversionResult val = ((UntypedAtomicValue)item).convert(requiredItemType, true, context); if (val instanceof ValidationFailure) { ValidationFailure vex = (ValidationFailure)val; vex.setLocator(UntypedAtomicConverter.this); throw vex.makeException(); } return (AtomicValue)val; } else { return item; } } };
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 Item map(Item item) throws XPathException { if (item instanceof UntypedAtomicValue) { ConversionResult val = ((UntypedAtomicValue)item).convert(requiredItemType, true, context); if (val instanceof ValidationFailure) { ValidationFailure vex = (ValidationFailure)val; vex.setLocator(UntypedAtomicConverter.this); throw vex.makeException(); } return (AtomicValue)val; } else { return item; } } };
/** * Evaluate as an Item. This should only be called if the UntypedAtomicConverter has cardinality zero-or-one */ public Item evaluateItem(XPathContext context) throws XPathException { Item item = operand.evaluateItem(context); if (item == null) { return null; } if (item instanceof UntypedAtomicValue) { ConversionResult val = ((UntypedAtomicValue)item).convert(requiredItemType, true, context); if (val instanceof ValidationFailure) { ValidationFailure err = (ValidationFailure)val; err.setLocator(this); throw err.makeException(); } else { return (AtomicValue)val; } } else { return item; } }
/** * Evaluate as an Item. This should only be called if the UntypedAtomicConverter has cardinality zero-or-one */ public Item evaluateItem(XPathContext context) throws XPathException { Item item = operand.evaluateItem(context); if (item == null) { return null; } if (item instanceof UntypedAtomicValue) { ConversionResult val = ((UntypedAtomicValue)item).convert(requiredItemType, true, context); if (val instanceof ValidationFailure) { ValidationFailure err = (ValidationFailure)val; err.setLocator(this); throw err.makeException(); } else { return (AtomicValue)val; } } else { return item; } }
/** * Evaluate as an Item. This should only be called if the UntypedAtomicConverter has cardinality zero-or-one */ public Item evaluateItem(XPathContext context) throws XPathException { Item item = operand.evaluateItem(context); if (item == null) { return null; } if (item instanceof UntypedAtomicValue) { ConversionResult val = ((UntypedAtomicValue)item).convert(requiredItemType, true, context); if (val instanceof ValidationFailure) { ValidationFailure err = (ValidationFailure)val; err.setLocator(this); throw err.makeException(); } else { return (AtomicValue)val; } } else { return item; } }
/** * Get a ValidationFailure object containing information from this ValidationException * @return a ValidationFailure object */ public ValidationFailure getValidationFailure() { if (failure != null) { return failure; } else { ValidationFailure failure = new ValidationFailure(getMessage()); failure.setErrorCodeQName(getErrorCodeQName()); failure.setLocator(getLocator()); return failure; } }
/** * Get a ValidationFailure object containing information from this ValidationException * @return a ValidationFailure object */ public ValidationFailure getValidationFailure() { if (failure != null) { return failure; } else { ValidationFailure failure = new ValidationFailure(getMessage()); failure.setErrorCodeQName(getErrorCodeQName()); failure.setLocator(getLocator()); return failure; } }
/** * Creates a new ValidationFailure with the given nested * exception. * * @param exception the nested exception */ public static ValidationFailure fromException(/*@NotNull*/ Exception exception) { if (exception instanceof ValidationException) { return ((ValidationException)exception).getValidationFailure(); } else if (exception instanceof XPathException) { ValidationFailure failure = new ValidationFailure(exception.getMessage()); if (((XPathException) exception).getErrorCodeQName() == null) { failure.setErrorCode("FORG0001"); } else { failure.setErrorCodeQName(((XPathException) exception).getErrorCodeQName()); } failure.setLocator(((XPathException) exception).getLocator()); return failure; } else { return new ValidationFailure(exception.getMessage()); } }
/** * Creates a new ValidationFailure with the given nested * exception. * * @param exception the nested exception */ public static ValidationFailure fromException(/*@NotNull*/ Exception exception) { if (exception instanceof ValidationException) { return ((ValidationException)exception).getValidationFailure(); } else if (exception instanceof XPathException) { ValidationFailure failure = new ValidationFailure(exception.getMessage()); if (((XPathException) exception).getErrorCodeQName() == null) { failure.setErrorCode("FORG0001"); } else { failure.setErrorCodeQName(((XPathException) exception).getErrorCodeQName()); } failure.setLocator(((XPathException) exception).getLocator()); return failure; } else { return new ValidationFailure(exception.getMessage()); } }
selectValue.getStringValue(), null, env.getConfiguration().getNameChecker()); if (err != null) { err.setLocator(this); throw err.makeException();
selectValue.getStringValue(), null, env.getConfiguration().getNameChecker()); if (err != null) { err.setLocator(this); throw err.makeException();
selectValue.getStringValue(), null, getConfiguration().getConversionRules()); if (err != null) { err.setLocator(getLocation()); err.setErrorCode(isXSLT() ? "XTTE1540" : "XQDY0027"); throw err.makeException();
selectValue.getStringValue(), null, getConfiguration().getConversionRules()); if (err != null) { err.setLocator(getLocation()); err.setErrorCode(isXSLT() ? "XTTE1540" : "XQDY0027"); throw err.makeException();
err.getMessage()); err.setErrorCode("XTTE1555"); err.setLocator(getLocation()); throw err.makeException();
err.getMessage()); err.setErrorCode("XTTE1555"); err.setLocator(getLocation()); throw err.makeException();
ve.setConstraintReference(1, "cvc-elt", "4.3"); ve.setErrorCode(instr.isXSLT() ? "XTTE1515" : "XQDY0027"); ve.setLocator(instr.getLocation()); throw ve.makeException();
ve.setConstraintReference(1, "cvc-elt", "4.3"); ve.setErrorCode(instr.isXSLT() ? "XTTE1515" : "XQDY0027"); ve.setLocator(instr.getLocation()); throw ve.makeException();