private void setLiteralLabel_1(String lex, String lang, RDFDatatype dtype) throws DatatypeFormatException { this.lexicalForm = lex; this.dtype = dtype; this.lang = (lang == null ? "" : lang); if (dtype == null) { value = lex; } else { setValue(lex); } normalize(); }
private void setLiteralLabel_2(Object value, String language, RDFDatatype dtype) throws DatatypeFormatException { // Constructor extraction: Preparation for moving into Node_Literal. this.dtype = dtype; this.lang = (language == null ? "" : language); if (value instanceof String) { String lex = (String)value; lexicalForm = lex; if (dtype == null) { this.value = lex; } else { setValue(lex); } } else { this.value = (dtype == null) ? value : dtype.cannonicalise( value ); } normalize(); if (dtype != null && lexicalForm == null) { // We are creating a literal from a java object, check the lexical form of the object is acceptable // Done here and uses this.dtype so it can use the normalized type wellformed = this.dtype.isValidValue( value ); if (JenaParameters.enableEagerLiteralValidation && !wellformed) { throw new DatatypeFormatException(value.toString(), dtype, "in literal creation"); } } }