Converts the specified start/end time to an item. @param string start (integer, dayTimeDuration, dateTime, time); can be null @param info input info (can be null) @return item or null @throws QueryException query exception
(final String string, final InputInfo info)
| 119 | * @throws QueryException query exception |
| 120 | */ |
| 121 | public static Item toTime(final String string, final InputInfo info) throws QueryException { |
| 122 | // undefined |
| 123 | if(string == null || string.isEmpty()) return null; |
| 124 | // integer |
| 125 | if(string.matches("^\\d+$")) return Itr.get(Itr.parse(token(string), info)); |
| 126 | // dayTimeDuration |
| 127 | if(Dur.DTD.matcher(string).matches()) return new DTDur(token(string), info); |
| 128 | // time |
| 129 | if(ADate.TIME.matcher(string).matches()) return new Tim(token(string), info); |
| 130 | // dateTime |
| 131 | return new Dtm(token(string), BasicType.DATE_TIME, info); |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * Returns the bindings for a query. |