Search in sources :

Example 11 with XSTime

use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime in project webtools.sourceediting by eclipse.

the class FnTimezoneFromTime method expected_args.

/**
 * Obtain a list of expected arguments.
 *
 * @return Result of operation.
 */
public static synchronized Collection expected_args() {
    if (_expected_args == null) {
        _expected_args = new ArrayList();
        _expected_args.add(new SeqType(new XSTime(), SeqType.OCC_QMARK));
    }
    return _expected_args;
}
Also used : SeqType(org.eclipse.wst.xml.xpath2.processor.internal.SeqType) ArrayList(java.util.ArrayList) XSTime(org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime)

Example 12 with XSTime

use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime in project webtools.sourceediting by eclipse.

the class FnCurrentTime method current_time.

/**
 * Current-Time operation.
 *
 * @param args
 *            Result from the expressions evaluation.
 * @param dc
 *            Result of dynamic context operation.
 * @throws DynamicError
 *             Dynamic error.
 * @return Result of fn:current-time operation.
 */
public static ResultSequence current_time(Collection args, DynamicContext dc) throws DynamicError {
    assert args.size() == 0;
    Duration d = dc.getTimezoneOffset();
    XSDayTimeDuration tz = new XSDayTimeDuration(0, d.getHours(), d.getMinutes(), 0.0, d.getSign() == -1);
    AnyType res = new XSTime(dc.getCurrentDateTime(), tz);
    return ResultSequenceFactory.create_new(res);
}
Also used : XSDayTimeDuration(org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration) Duration(javax.xml.datatype.Duration) XSDayTimeDuration(org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration) XSTime(org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime) AnyType(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType)

Example 13 with XSTime

use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime in project webtools.sourceediting by eclipse.

the class FnDateTime method expected_args.

/**
 * Obtain a list of expected arguments.
 *
 * @return Result of operation.
 */
public static synchronized Collection expected_args() {
    if (_expected_args == null) {
        _expected_args = new ArrayList();
        _expected_args.add(new SeqType(new XSDate(), SeqType.OCC_QMARK));
        _expected_args.add(new SeqType(new XSTime(), SeqType.OCC_QMARK));
    }
    return _expected_args;
}
Also used : XSDate(org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate) SeqType(org.eclipse.wst.xml.xpath2.processor.internal.SeqType) ArrayList(java.util.ArrayList) XSTime(org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime)

Aggregations

XSTime (org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime)13 ArrayList (java.util.ArrayList)6 Collection (java.util.Collection)6 ResultSequence (org.eclipse.wst.xml.xpath2.api.ResultSequence)6 SeqType (org.eclipse.wst.xml.xpath2.processor.internal.SeqType)6 XSDayTimeDuration (org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration)3 Iterator (java.util.Iterator)2 Duration (javax.xml.datatype.Duration)2 XSDate (org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate)2 XSInteger (org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger)2 BigDecimal (java.math.BigDecimal)1 Calendar (java.util.Calendar)1 GregorianCalendar (java.util.GregorianCalendar)1 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)1 AnyType (org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType)1 XSDateTime (org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime)1 XSDecimal (org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal)1 XSDuration (org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration)1