public BigDecimal getDecimal() { raise(new ExprEvalTypeException("Not a decimal: "+this)) ; return null ; } public float getFloat() { raise(new ExprEvalTypeException("Not a float: "+this)) ; return Float.NaN ; }
public boolean getBoolean() { raise(new ExprEvalTypeException("Not a boolean: "+this)) ; return false ; } public String getString() { raise(new ExprEvalTypeException("Not a string: "+this)) ; return null ; }
public float getFloat() { raise(new ExprEvalTypeException("Not a float: "+this)) ; return Float.NaN ; } public double getDouble() { raise(new ExprEvalTypeException("Not a double: "+this)) ; return Double.NaN ; }
public String getString() { raise(new ExprEvalTypeException("Not a string: "+this)) ; return null ; } public BigInteger getInteger() { raise(new ExprEvalTypeException("Not an integer: "+this)) ; return null ; }
public XSDDateTime getDateTime() { raise(new ExprEvalTypeException("No DateTime value: "+this)) ; return null ; } // public XSDDateTime getDate() { raise(new ExprEvalException("Not a date: "+this)) ; return null ; }
public BigDecimal getDecimal() { raise(new ExprEvalTypeException("Not a decimal: "+this)) ; return null ; } public float getFloat() { raise(new ExprEvalTypeException("Not a float: "+this)) ; return Float.NaN ; }
public float getFloat() { raise(new ExprEvalTypeException("Not a float: "+this)) ; return Float.NaN ; } public double getDouble() { raise(new ExprEvalTypeException("Not a double: "+this)) ; return Double.NaN ; }
public XMLGregorianCalendar getDateTime() { raise(new ExprEvalTypeException("No DateTime value: "+this)) ; return null ; } public Duration getDuration() { raise(new ExprEvalTypeException("Not a duration: "+this)) ; return null ; }
public double getDouble() { raise(new ExprEvalTypeException("Not a double: "+this)) ; return Double.NaN ; } // Value representation for all date and time values.
public Duration getDuration() { raise(new ExprEvalTypeException("Not a duration: "+this)) ; return null ; }
public BigInteger getInteger() { raise(new ExprEvalTypeException("Not an integer: "+this)) ; return null ; } public BigDecimal getDecimal() { raise(new ExprEvalTypeException("Not a decimal: "+this)) ; return null ; }
public double getDouble() { raise(new ExprEvalTypeException("Not a double: "+this)) ; return Double.NaN ; } public XSDDateTime getDateTime() { raise(new ExprEvalTypeException("No DateTime value: "+this)) ; return null ; }
public boolean getBoolean() { raise(new ExprEvalTypeException("Not a boolean: "+this)) ; return false ; } public String getString() { raise(new ExprEvalTypeException("Not a string: "+this)) ; return null ; }
private void forceToNode() { if ( node == null ) node = asNode() ; if ( node == null ) raise(new ExprEvalException("Not a node: "+this)) ; }
private void forceToNode() { if ( node == null ) node = asNode() ; if ( node == null ) raise(new ExprEvalException("Not a node: "+this)) ; }
public static String lang(Node node) { if ( !node.isLiteral() ) NodeValue.raise(new ExprTypeException("lang: Not a literal: " + FmtUtils.stringForNode(node))) ; String s = node.getLiteralLanguage() ; if ( s == null ) s = "" ; return s ; }
public static String lang(Node node) { if ( ! node.isLiteral() ) NodeValue.raise(new ExprTypeException("lang: Not a literal: "+FmtUtils.stringForNode(node))) ; String s = node.getLiteralLanguage() ; if ( s == null ) s = "" ; return s ; }
public static String str(Node node) { if ( node.isLiteral() ) return node.getLiteral().getLexicalForm() ; if ( node.isURI() ) return node.getURI() ; // if ( node.isBlank() ) return node.getBlankNodeId().getLabelString() ; // if ( node.isBlank() ) return "" ; if ( node.isBlank() ) NodeValue.raise(new ExprTypeException("Blank node: " + node)) ; NodeValue.raise(new ExprEvalException("Not a string: " + node)) ; return "[undef]" ; }
public static Node datatype(Node node) { if ( ! node.isLiteral() ) { NodeValue.raise(new ExprTypeException("datatype: Not a literal: "+node) ); return null ; } String s = node.getLiteralDatatypeURI() ; boolean plainLiteral = (s == null || s.equals("") ) ; if ( plainLiteral ) { boolean simpleLiteral = (node.getLiteralLanguage() == null || node.getLiteralLanguage().equals("") ) ; if ( ! simpleLiteral ) NodeValue.raise(new ExprTypeException("datatype: Literal has language tag: "+node) ); return XSD.xstring.asNode() ; } return Node.createURI(s) ; }
public static String str(Node node) { if ( node.isLiteral() ) return node.getLiteral().getLexicalForm() ; if ( node.isURI() ) return node.getURI() ; // if ( node.isBlank() ) return node.getBlankNodeId().getLabelString() ; // if ( node.isBlank() ) return "" ; if ( node.isBlank() ) NodeValue.raise(new ExprTypeException("Blank node: "+node)) ; NodeValue.raise(new ExprEvalException("Not a string: "+node)) ; return "[undef]" ; }