Examples of DatatypeFormatException


Examples of com.hp.hpl.jena.datatypes.DatatypeFormatException

        } else {
            Object value = getValue();
            if (value instanceof Character) {
                return (Character) value;
            } else {
                throw new DatatypeFormatException(value.toString() + " is not a Character");
            }
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.datatypes.DatatypeFormatException

                message +=" which is not an xsd type.";
            }
            message += " \n";
            String type =
            message += "Java representation type is " + (value == null ? "null" : value.getClass().toString());
            throw new DatatypeFormatException(message);
        }
    }   
View Full Code Here

Examples of com.hp.hpl.jena.datatypes.DatatypeFormatException

            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);
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.datatypes.DatatypeFormatException

                }
            }
            return names;
        } catch (Exception e) {
            e.printStackTrace();    // Temp
            throw new DatatypeFormatException(e.toString());
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.datatypes.DatatypeFormatException

     */
    @Override
    public Object parse(String lexicalForm) throws DatatypeFormatException {
        int index = lexicalForm.indexOf("/");
        if (index == -1) {
            throw new DatatypeFormatException(lexicalForm, theRationalType, "");
        }
        try {
            int numerator = Integer.parseInt(lexicalForm.substring(0, index));
            int denominator = Integer.parseInt(lexicalForm.substring(index+1));
            return new Rational(numerator, denominator);
        } catch (NumberFormatException e) {
            throw new DatatypeFormatException(lexicalForm, theRationalType, "");
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.datatypes.DatatypeFormatException

           
            // This means it will be the same as an integer elsewhere
            return RomanNumeral.r2i( lexicalForm );
        } catch (NumberFormatException ex)
        {
            throw new DatatypeFormatException(lexicalForm, this, ex.getMessage()) ;
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.datatypes.DatatypeFormatException

        } else {
            // typed literal
            if (value instanceof Boolean) {
                return ((Boolean)value).booleanValue();
            } else {
                throw new DatatypeFormatException(this.toString() + " is not a Boolean");
            }
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.datatypes.DatatypeFormatException

        } else {
            Object value = getValue();
            if (value instanceof Character) {
                return ((Character) value).charValue();
            } else {
                throw new DatatypeFormatException(value.toString() + " is not a Character");
            }
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.datatypes.DatatypeFormatException

                message +=" which is not an xsd type.";
            }
            message += " \n";
            String type =
            message += "Java representation type is " + (value == null ? "null" : value.getClass().toString());
            throw new DatatypeFormatException(message);
        }
    }   
View Full Code Here

Examples of com.hp.hpl.jena.datatypes.DatatypeFormatException

     * Turned off by default.
     */
    protected void checkWhitespace(String lexicalForm) {
        if (JenaParameters.enableWhitespaceCheckingOfTypedLiterals) {
            if ( ! lexicalForm.trim().equals(lexicalForm)) {
                throw new DatatypeFormatException(lexicalForm, this, "whitespace violation");
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.