Examples of ValidationFailure


Examples of net.sf.saxon.type.ValidationFailure

            if (config.getTypeHierarchy().isSubType(targetType, BuiltInAtomicType.QNAME)) {
                qnv = new QNameValue(prefix, uri, local, targetType, null);
            } else {
                qnv = new NotationValue(prefix, uri, local, (AtomicType)null);
            }
            ValidationFailure vf = targetType.validate(qnv, lexicalForm, config.getNameChecker());
            if (vf != null) {
                throw vf.makeException();
            }
            qnv.setTypeLabel(targetType);
            return qnv;
        }
    }
View Full Code Here

Examples of net.sf.saxon.type.ValidationFailure

        dt.typeLabel = BuiltInAtomicType.DATE_TIME;
        return dt;
    }

    private static ValidationFailure badDate(String msg, CharSequence value) {
        ValidationFailure err = new ValidationFailure(
                "Invalid dateTime value " + Err.wrap(value, Err.VALUE) + " (" + msg + ")");
        err.setErrorCode("FORG0001");
        return err;
    }
View Full Code Here

Examples of net.sf.saxon.type.ValidationFailure

        if (subtype.getFingerprint() == StandardNames.XS_DATE_TIME_STAMP) {
            if (hasTimezone()) {
                setTypeLabel(subtype);
                return null;
            } else {
                ValidationFailure err = new ValidationFailure(
                        "The value " + Err.depict(this) +
                                " is not a valid xs:dateTimeStamp: it has no timezone");
                err.setErrorCode("FORG0001");
                return err;
            }
        } else {
            throw new IllegalArgumentException("Unknown subtype of xs:dateTime");
        }
View Full Code Here

Examples of net.sf.saxon.type.ValidationFailure

        case StandardNames.XS_UNTYPED_ATOMIC:
            return new UntypedAtomicValue(getStringValueCS());

        default:
            ValidationFailure err = new ValidationFailure("Cannot convert dateTime to " +
                    requiredType.getDisplayName());
            err.setErrorCode("XPTY0004");
            return err;
        }
    }
View Full Code Here

Examples of net.sf.saxon.type.ValidationFailure

            return new UntypedAtomicValue(getStringValueCS());
        case StandardNames.XS_BASE64_BINARY:
            return new Base64BinaryValue(binaryValue);

        default:
            ValidationFailure err = new ValidationFailure("Cannot convert hexBinarry to " +
                    requiredType.getDisplayName());
            err.setErrorCode("XPTY0004");
            return err;
        }
    }
View Full Code Here

Examples of net.sf.saxon.type.ValidationFailure

        }
        return d;
    }

    private static ValidationFailure badDate(String msg, CharSequence value) {
        ValidationFailure err = new ValidationFailure(
                "Invalid date " + Err.wrap(value, Err.VALUE) + " (" + msg + ")");
        err.setErrorCode("FORG0001");
        return err;
    }
View Full Code Here

Examples of net.sf.saxon.type.ValidationFailure

        try {
            return new DurationValue(
                    !negative, years, months, days, hours, minutes, seconds, microseconds, BuiltInAtomicType.DURATION);
        } catch (IllegalArgumentException err) {
            // catch values that exceed limits
            return new ValidationFailure(err.getMessage());
        }
    }
View Full Code Here

Examples of net.sf.saxon.type.ValidationFailure

            return new ValidationFailure(err.getMessage());
        }
    }

    protected static ValidationFailure badDuration(String msg, CharSequence s) {
        ValidationFailure err = new ValidationFailure("Invalid duration value '" + s + "' (" + msg + ')');
        err.setErrorCode("FORG0001");
        return err;
    }
View Full Code Here

Examples of net.sf.saxon.type.ValidationFailure

        case StandardNames.XS_YEAR_MONTH_DURATION:
            return YearMonthDurationValue.fromMonths(months * (negative ? -1 : +1));
        case StandardNames.XS_DAY_TIME_DURATION:
            return new DayTimeDurationValue((negative ? -1 : +1), 0, 0, 0, seconds, microseconds);
        default:
            ValidationFailure err = new ValidationFailure("Cannot convert duration to " +
                    requiredType.getDisplayName());
            err.setErrorCode("XPTY0004");
            return err;
        }
    }
View Full Code Here

Examples of net.sf.saxon.type.ValidationFailure

        case StandardNames.XS_NMTOKEN:
            return makeRestrictedString(value, requiredType,
                    (validate ? context.getConfiguration().getNameChecker() : null));

        default:
            ValidationFailure err = new ValidationFailure("Cannot convert anyURI to " +
                                     requiredType.getDisplayName());
            err.setErrorCode("XPTY0004");
            return err;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.