use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate in project webtools.sourceediting by eclipse.
the class FnTimezoneFromDate method timezone_from_date.
/**
* Timezone-from-Date operation.
*
* @param args
* Result from the expressions evaluation.
* @throws DynamicError
* Dynamic error.
* @return Result of fn:timezone-from-date operation.
*/
public static ResultSequence timezone_from_date(Collection args) throws DynamicError {
Collection cargs = Function.convert_arguments(args, expected_args());
ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
if (arg1.empty()) {
return ResultBuffer.EMPTY;
}
XSDate dt = (XSDate) arg1.first();
if (dt.timezoned()) {
return dt.tz();
}
return ResultBuffer.EMPTY;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate in project webtools.sourceediting by eclipse.
the class FnCurrentDate method current_date.
/**
* Current-Date operation.
*
* @param args
* Result from the expressions evaluation.
* @param dc
* Result of dynamic context operation.
* @throws DynamicError
* Dynamic error.
* @return Result of fn:current-date operation.
*/
public static ResultSequence current_date(Collection args, DynamicContext dc) throws DynamicError {
assert args.size() == 0;
XSDayTimeDuration tz = new XSDayTimeDuration(dc.getTimezoneOffset());
AnyType res = new XSDate(dc.getCurrentDateTime(), tz);
return ResultSequenceFactory.create_new(res);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate 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;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate in project webtools.sourceediting by eclipse.
the class FnAdjustDateToTimeZone method expectedArgs.
/**
* Obtain a list of expected arguments.
*
* @return Result of operation.
*/
public static synchronized Collection expectedArgs() {
if (_expected_args == null) {
_expected_args = new ArrayList();
_expected_args.add(new SeqType(new XSDate(), SeqType.OCC_QMARK));
_expected_args.add(new SeqType(new XSDayTimeDuration(), SeqType.OCC_QMARK));
}
return _expected_args;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate in project webtools.sourceediting by eclipse.
the class FnYearFromDate method year_from_date.
/**
* Year-from-Date operation.
*
* @param args
* Result from the expressions evaluation.
* @throws DynamicError
* Dynamic error.
* @return Result of fn:year-from-date operation.
*/
public static ResultSequence year_from_date(Collection args) throws DynamicError {
Collection cargs = Function.convert_arguments(args, expected_args());
ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
if (arg1.empty()) {
return ResultBuffer.EMPTY;
}
XSDate dt = (XSDate) arg1.first();
int res = dt.year();
return new XSInteger(BigInteger.valueOf(res));
}
Aggregations