Package com.hp.hpl.jena.datatypes

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


        } 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

                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

     */
    @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

     * 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

     * 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

     */
    @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

     * 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

     * 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

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

TOP

Related Classes of com.hp.hpl.jena.datatypes.DatatypeFormatException

Copyright © 2018 www.massapicom. 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.