Examples of XsdDataTypeEnum


Examples of org.apache.stanbol.entityhub.model.clerezza.RdfResourceUtils.XsdDataTypeEnum

            TypedLiteral literal = (TypedLiteral) value;
            if (literal.getDataType() == null) { // if no dataType is defined
                // return a Text without a language
                return valueFactory.createText(literal);
            } else {
                XsdDataTypeEnum mapping = RdfResourceUtils.XSD_DATATYPE_VALUE_MAPPING.get(literal.getDataType());
                if (mapping != null) {
                    if (mapping.getMappedClass() != null) {
                        try {
                            return literalFactory.createObject(mapping.getMappedClass(), literal);
                        } catch (RuntimeException e){
                            log.info("Unable to convert Literal value {} to Java Class {} because of {} with message {}",
                                new Object[]{literal,mapping.getMappedClass().getSimpleName(),
                                             e.getClass().getSimpleName(),e.getMessage()});
                            log.trace("Exception:",e);
                            //STANBOL-698: Decide what to do in such cases
                            //(a) throw an exception
                            // throw e;
View Full Code Here

Examples of org.apache.stanbol.entityhub.model.clerezza.RdfResourceUtils.XsdDataTypeEnum

            TypedLiteral literal = (TypedLiteral) value;
            if(literal.getDataType() == null){ //if no dataType is defined
                //return a Text without a language
                return valueFactory.createText(literal);
            } else {
                XsdDataTypeEnum mapping = RdfResourceUtils.XSD_DATATYPE_VALUE_MAPPING.get(literal.getDataType());
                if(mapping != null){
                    if(mapping.getMappedClass() != null){
                        return literalFactory.createObject(mapping.getMappedClass(), literal);
                    } else { //if no mapped class
                        //bypass the LiteralFactory and return the string representation
                        return literal.getLexicalForm();
                    }
                } else { //if dataType is not supported
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.