Package org.apache.clerezza.rdf.core

Examples of org.apache.clerezza.rdf.core.InvalidLiteralTypeException


        }

        @Override
        public byte[] createObject(TypedLiteral literal) {
            if (!literal.getDataType().equals(base64Uri)) {
                throw new InvalidLiteralTypeException(byteArrayType, literal.getDataType());
            }
            return (byte[])Base64.decode(literal.getLexicalForm());
        }
View Full Code Here


        }

        @Override
        public Date createObject(TypedLiteral literal) {
            if (!literal.getDataType().equals(dateTimeUri)) {
                throw new InvalidLiteralTypeException(Date.class, literal.getDataType());
            }
            try {
                return DATE_FORMAT.parse(literal.getLexicalForm());
            } catch (ParseException ex) {
                throw new RuntimeException("Exception parsing literal as date", ex);
View Full Code Here

        @Override
        public Boolean createObject(TypedLiteral literal) {
            if (literal == TRUE) return true;
            else if (literal == FALSE) return false;
            else if (!literal.getDataType().equals(booleanUri)) {
                throw new InvalidLiteralTypeException(Boolean.class, literal.getDataType());
            }
            return Boolean.valueOf(literal.getLexicalForm());
        }
View Full Code Here

        }

        @Override
        public String createObject(TypedLiteral literal) {
            if (!literal.getDataType().equals(stringUri)) {
                throw new InvalidLiteralTypeException(String.class, literal.getDataType());
            }
            return literal.getLexicalForm();
        }
View Full Code Here

        }

        @Override
        public Integer createObject(TypedLiteral literal) {
            if (!decimalTypes.contains(literal.getDataType())) {
                throw new InvalidLiteralTypeException(Integer.class, literal.getDataType());
            }
            return new Integer(literal.getLexicalForm());
        }
View Full Code Here

        }

        @Override
        public Long createObject(TypedLiteral literal) {
            if (!decimalTypes.contains(literal.getDataType())) {
                throw new InvalidLiteralTypeException(Long.class, literal.getDataType());
            }
            return new Long(literal.getLexicalForm());
        }
View Full Code Here

        }

        @Override
        public Float createObject(TypedLiteral literal) {
            if (!literal.getDataType().equals(xsdFloat)) {
                throw new InvalidLiteralTypeException(Float.class, literal.getDataType());
            }
            return Float.valueOf(literal.getLexicalForm());
        }
View Full Code Here

        }

        @Override
        public Double createObject(TypedLiteral literal) {
            if (!literal.getDataType().equals(xsdDouble)) {
                throw new InvalidLiteralTypeException(Double.class, literal.getDataType());
            }
            return new Double(literal.getLexicalForm());
        }
View Full Code Here

        }

        @Override
        public BigInteger createObject(TypedLiteral literal) {
            if (!literal.getDataType().equals(xsdInteger)) {
                throw new InvalidLiteralTypeException(Double.class, literal.getDataType());
            }
            return new BigInteger(literal.getLexicalForm());
        }
View Full Code Here

        }

        @Override
        public UriRef createObject(TypedLiteral literal) {
            if (!literal.getDataType().equals(xsdAnyURI)) {
                throw new InvalidLiteralTypeException(UriRef.class, literal.getDataType());
            }
            return new UriRef(literal.getLexicalForm());
        }
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.InvalidLiteralTypeException

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.