Examples of DateTimeValue


Examples of net.sf.saxon.value.DateTimeValue

        controller.setURIResolver(env.getURIResolver());
        controller.setErrorListener(env.getErrorListener());
        controller.addTraceListener(env.getTraceListener());
        controller.setTraceFunctionDestination(env.getTraceFunctionDestination());
        controller.setSchemaValidationMode(env.getSchemaValidationMode());
        DateTimeValue currentDateTime = env.getCurrentDateTime();
        if (currentDateTime != null) {
            try {
                controller.setCurrentDateTime(currentDateTime);
            } catch (XPathException e) {
                throw new AssertionError(e);    // the value should already have been checked
View Full Code Here

Examples of net.sf.saxon.value.DateTimeValue

    /**
    * Evaluate in a general context
    */

    public Item evaluateItem(XPathContext context) throws XPathException {
        final DateTimeValue dt = DateTimeValue.getCurrentDateTime(context);
        final TypeHierarchy th = context.getConfiguration().getTypeHierarchy();
        final int targetType = getItemType(th).getPrimitiveType();
        switch (targetType) {
            case StandardNames.XS_DATE_TIME:
                return dt;
            case StandardNames.XS_DATE:
                return dt.convert(BuiltInAtomicType.DATE, true, context).asAtomic();
            case StandardNames.XS_TIME:
                return dt.convert(BuiltInAtomicType.TIME, true, context).asAtomic();
            case StandardNames.XS_DAY_TIME_DURATION:
            case StandardNames.XS_DURATION:
                return dt.getComponent(Component.TIMEZONE);
            default:
                throw new IllegalArgumentException("Wrong target type for current date/time");
        }
    }
View Full Code Here

Examples of net.sf.saxon.value.DateTimeValue

     *      for repeated calls within the same transformation
     */

    public DateTimeValue getCurrentDateTime() {
        if (currentDateTime==null) {
            currentDateTime = new DateTimeValue(new GregorianCalendar(), true);
        }
        return currentDateTime;
    }
View Full Code Here

Examples of net.sf.saxon.value.DateTimeValue

    /**
    * Evaluate in a general context
    */

    public Item evaluateItem(XPathContext context) throws XPathException {
        DateTimeValue dt = new DateTimeValue(context);
        int targetType = getItemType().getPrimitiveType();
        switch (targetType) {
            case Type.DATE_TIME:
                return dt;
            case Type.DATE:
                return (DateValue)dt.convert(Type.DATE, context);
            case Type.TIME:
                return (TimeValue)dt.convert(Type.TIME, context);
            case Type.DAY_TIME_DURATION:
            case Type.DURATION:
                return dt.getComponent(Component.TIMEZONE);
            default:
                throw new IllegalArgumentException("Wrong target type for current date/time");
        }
    }
View Full Code Here

Examples of net.sf.saxon.value.DateTimeValue

        int nargs = argument.length;
        SecondsDurationValue tz = null;
        if (nargs==1) {
            // use the implicit timezone
            tz = (SecondsDurationValue)new DateTimeValue(c).getComponent(Component.TIMEZONE);
            return in.setTimezone(tz);
        } else {
            AtomicValue av2 = (AtomicValue)argument[1].evaluateItem(c);
            if (av2==null) {
                return in.removeTimezone();
View Full Code Here

Examples of org.apache.derby.client.am.DateTimeValue

                        // The value may be a Date if it comes from one of the
                        // methods that don't specify the calendar, or a
                        // DateTimeValue if it comes from a method that does
                        // specify the calendar. Convert to DateTimeValue if
                        // needed.
                        DateTimeValue dateVal = (inputs[i] instanceof Date) ?
                                    new DateTimeValue((Date) inputs[i]) :
                                    (DateTimeValue) inputs[i];
                        writeDate(dateVal);
                        break;
                    case DRDAConstants.DRDA_TYPE_NTIME:
                        // The value may be a Time if it comes from one of the
                        // methods that don't specify the calendar, or a
                        // DateTimeValue if it comes from a method that does
                        // specify the calendar. Convert to DateTimeValue if
                        // needed.
                        DateTimeValue timeVal = (inputs[i] instanceof Time) ?
                                    new DateTimeValue((Time) inputs[i]) :
                                    (DateTimeValue) inputs[i];
                        writeTime(timeVal);
                        break;
                    case DRDAConstants.DRDA_TYPE_NTIMESTAMP:
                        // The value may be a Timestamp if it comes from one of
                        // the methods that don't specify the calendar, or a
                        // DateTimeValue if it comes from a method that does
                        // specify the calendar. Convert to DateTimeValue if
                        // needed.
                        DateTimeValue tsVal = (inputs[i] instanceof Timestamp) ?
                                    new DateTimeValue((Timestamp) inputs[i]) :
                                    (DateTimeValue) inputs[i];
                        writeTimestamp(tsVal);
                        break;
                    case DRDAConstants.DRDA_TYPE_NINTEGER8:
                        writeLongFdocaData(((Long) inputs[i]).longValue());
View Full Code Here

Examples of org.apache.derby.client.am.DateTimeValue

                        // The value may be a Date if it comes from one of the
                        // methods that don't specify the calendar, or a
                        // DateTimeValue if it comes from a method that does
                        // specify the calendar. Convert to DateTimeValue if
                        // needed.
                        DateTimeValue dateVal = (inputs[i] instanceof Date) ?
                                    new DateTimeValue((Date) inputs[i]) :
                                    (DateTimeValue) inputs[i];
                        writeDate(dateVal);
                        break;
                    case DRDAConstants.DRDA_TYPE_NTIME:
                        // The value may be a Time if it comes from one of the
                        // methods that don't specify the calendar, or a
                        // DateTimeValue if it comes from a method that does
                        // specify the calendar. Convert to DateTimeValue if
                        // needed.
                        DateTimeValue timeVal = (inputs[i] instanceof Time) ?
                                    new DateTimeValue((Time) inputs[i]) :
                                    (DateTimeValue) inputs[i];
                        writeTime(timeVal);
                        break;
                    case DRDAConstants.DRDA_TYPE_NTIMESTAMP:
                        // The value may be a Timestamp if it comes from one of
                        // the methods that don't specify the calendar, or a
                        // DateTimeValue if it comes from a method that does
                        // specify the calendar. Convert to DateTimeValue if
                        // needed.
                        DateTimeValue tsVal = (inputs[i] instanceof Timestamp) ?
                                    new DateTimeValue((Timestamp) inputs[i]) :
                                    (DateTimeValue) inputs[i];
                        writeTimestamp(tsVal);
                        break;
                    case DRDAConstants.DRDA_TYPE_NINTEGER8:
                        writeLongFdocaData(((Long) inputs[i]).longValue());
View Full Code Here

Examples of org.exist.xquery.value.DateTimeValue

                Date date_created = null;
                Date date_modified = null;

                if(created != null) {
                    try {
                        date_created = (new DateTimeValue(created)).getDate();
                    } catch(final XPathException xpe) {
                        listener.warn("Illegal creation date. Ignoring date...");
                    }
                }
                if(modified != null) {
                    try {
                        date_modified = (Date) (new DateTimeValue(modified)).getDate();
                    } catch(final XPathException xpe) {
                        listener.warn("Illegal modification date. Ignoring date...");
                    }
                }
View Full Code Here

Examples of org.pdf4j.saxon.value.DateTimeValue

        controller.setURIResolver(env.getURIResolver());
        controller.setErrorListener(env.getErrorListener());
        controller.addTraceListener(env.getTraceListener());
        controller.setTraceFunctionDestination(env.getTraceFunctionDestination());
        DateTimeValue currentDateTime = env.getCurrentDateTime();
        if (currentDateTime != null) {
            try {
                controller.setCurrentDateTime(currentDateTime);
            } catch (XPathException e) {
                throw new AssertionError(e);    // the value should already have been checked
View Full Code Here

Examples of xbird.xquery.dm.value.xsi.DateTimeValue

        return Date.class;
    }

    public AtomicValue createInstance(String literal, AtomicType srcType, DynamicContext dynEnv)
            throws XQueryException {
        return new DateTimeValue(literal, this);
    }
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.