public static NodeValue dtGetDay(NodeValue nv) { if ( nv.isDateTime() || nv.isDate() || nv.isGMonthDay() || nv.isGDay() ) { DateTimeStruct dts = parseAnyDT(nv) ; return NodeValue.makeNode(dts.day, XSDDatatype.XSDinteger) ; } throw new ExprEvalException("Not a month datatype") ; }
public static NodeValue dtGetDay(NodeValue nv) { if ( nv.isDateTime() || nv.isDate() || nv.isGMonthDay() || nv.isGDay() ) { DateTimeStruct dts = parseAnyDT(nv) ; return NodeValue.makeNode(dts.day, XSDDatatype.XSDinteger) ; } throw new ExprEvalException("Not a month datatype") ; }
public static NodeValue dtGetMonth(NodeValue nv) { if ( nv.isDateTime() || nv.isDate() || nv.isGYearMonth() || nv.isGMonth() || nv.isGMonthDay() ) { DateTimeStruct dts = parseAnyDT(nv) ; return NodeValue.makeNode(dts.month, XSDDatatype.XSDinteger) ; } throw new ExprEvalException("Not a month datatype") ; }
public static NodeValue dtGetMonth(NodeValue nv) { if ( nv.isDateTime() || nv.isDate() || nv.isGYearMonth() || nv.isGMonth() || nv.isGMonthDay() ) { DateTimeStruct dts = parseAnyDT(nv) ; return NodeValue.makeNode(dts.month, XSDDatatype.XSDinteger) ; } throw new ExprEvalException("Not a month datatype") ; }
public boolean hasDateTime() { return isDateTime() || isDate() || isTime() || isGYear() || isGYearMonth() || isGMonth() || isGMonthDay() || isGDay() ; } public boolean isDateTime() { return false ; }
public boolean hasDateTime() { return isDateTime() || isDate() || isTime() || isGYear() || isGYearMonth() || isGMonth() || isGMonthDay() || isGDay() ; } public boolean isDateTime() { return false ; }
if ( nv.isGMonthDay() ) return nv ; if ( ! nv.isDateTime() && ! nv.isDate() ) throw new ExprEvalTypeException("Can't cast to XSD:gMonthDay: "+nv) ; String x = String.format("--%02d-%02d", xsdDT.getMonths(), xsdDT.getDays()) ;
if ( nv.isGMonthDay() ) return nv ; if ( ! nv.isDateTime() && ! nv.isDate() ) throw new ExprEvalTypeException("Can't cast to XSD:gMonthDay: "+nv) ; String x = String.format("--%02d-%02d", xsdDT.getMonth(), xsdDT.getDay()) ;
private static ValueSpaceClassification classifyValueSpace(NodeValue nv) { if ( nv.isNumber() ) return VSPACE_NUM ; if ( nv.isDateTime() ) return VSPACE_DATETIME ; if ( nv.isDate() ) return VSPACE_DATE ; if ( nv.isTime() ) return VSPACE_TIME ; if ( nv.isDuration() ) return VSPACE_DURATION ; if ( nv.isGYear() ) return VSPACE_G_YEAR ; if ( nv.isGYearMonth() ) return VSPACE_G_YEARMONTH ; if ( nv.isGMonth() ) return VSPACE_G_MONTH ; if ( nv.isGMonthDay() ) return VSPACE_G_MONTHDAY ; if ( nv.isGDay() ) return VSPACE_G_DAY ; if ( VALUE_EXTENSIONS && nv.isDate() ) return VSPACE_DATE ; if ( nv.isString()) return VSPACE_STRING ; if ( nv.isBoolean()) return VSPACE_BOOLEAN ; if ( ! nv.isLiteral() ) return VSPACE_NODE ; if ( VALUE_EXTENSIONS && nv.getNode() != null && nv.getNode().isLiteral() && ! nv.getNode().getLiteralLanguage().equals("") ) return VSPACE_LANG ; return VSPACE_UNKNOWN ; }
private static ValueSpaceClassification classifyValueSpace(NodeValue nv) { if ( nv.isNumber() ) return VSPACE_NUM ; if ( nv.isDateTime() ) return VSPACE_DATETIME ; if ( nv.isDate() ) return VSPACE_DATE ; if ( nv.isTime() ) return VSPACE_TIME ; if ( nv.isDuration() ) return VSPACE_DURATION ; if ( nv.isGYear() ) return VSPACE_G_YEAR ; if ( nv.isGYearMonth() ) return VSPACE_G_YEARMONTH ; if ( nv.isGMonth() ) return VSPACE_G_MONTH ; if ( nv.isGMonthDay() ) return VSPACE_G_MONTHDAY ; if ( nv.isGDay() ) return VSPACE_G_DAY ; if ( VALUE_EXTENSIONS && nv.isDate() ) return VSPACE_DATE ; if ( nv.isString()) return VSPACE_STRING ; if ( nv.isBoolean()) return VSPACE_BOOLEAN ; if ( ! nv.isLiteral() ) return VSPACE_NODE ; if ( VALUE_EXTENSIONS && nv.getNode() != null && nv.getNode().isLiteral() && ! nv.getNode().getLiteralLanguage().equals("") ) return VSPACE_LANG ; return VSPACE_UNKNOWN ; }
private static DateTimeStruct parseAnyDT(NodeValue nv) { String lex = nv.getNode().getLiteralLexicalForm() ; if ( nv.isDateTime() ) return DateTimeStruct.parseDateTime(lex) ; if ( nv.isDate() ) return DateTimeStruct.parseDate(lex) ; if ( nv.isGYear() ) return DateTimeStruct.parseGYear(lex) ; if (nv.isGYearMonth() ) return DateTimeStruct.parseGYearMonth(lex) ; if (nv.isGMonth() ) return DateTimeStruct.parseGMonth(lex) ; if (nv.isGMonthDay() ) return DateTimeStruct.parseGMonthDay(lex) ; if (nv.isGDay() ) return DateTimeStruct.parseGDay(lex) ; if ( nv.isTime() ) return DateTimeStruct.parseTime(lex) ; return null ; }
private static DateTimeStruct parseAnyDT(NodeValue nv) { String lex = nv.getNode().getLiteralLexicalForm() ; if ( nv.isDateTime() ) return DateTimeStruct.parseDateTime(lex) ; if ( nv.isDate() ) return DateTimeStruct.parseDate(lex) ; if ( nv.isGYear() ) return DateTimeStruct.parseGYear(lex) ; if (nv.isGYearMonth() ) return DateTimeStruct.parseGYearMonth(lex) ; if (nv.isGMonth() ) return DateTimeStruct.parseGMonth(lex) ; if (nv.isGMonthDay() ) return DateTimeStruct.parseGMonthDay(lex) ; if (nv.isGDay() ) return DateTimeStruct.parseGDay(lex) ; if ( nv.isTime() ) return DateTimeStruct.parseTime(lex) ; return null ; }