/** * Parse a lexical form of this datatype to a value * @throws DatatypeFormatException if the lexical form is not legal */ @Override public Object parse(String lexicalForm) throws DatatypeFormatException { try { ValidationContext context = new ValidationState(); ValidatedInfo resultInfo = new ValidatedInfo(); Object result = typeDeclaration.validate(lexicalForm, context, resultInfo); return convertValidatedDataValue(resultInfo); } catch (InvalidDatatypeValueException e) { throw new DatatypeFormatException(lexicalForm, this, "during parse -" + e); } }