private Object convertValue()

in src/main/java/org/apache/sling/jcr/contentparser/impl/XmlContentParser.java [196:218]


    private Object convertValue(String value, int type) {
        switch (type) {
            case PropertyType.STRING:
            case PropertyType.NAME:
            case PropertyType.PATH:
            case PropertyType.REFERENCE:
            case PropertyType.WEAKREFERENCE:
            case PropertyType.URI:
                return value;
            case PropertyType.LONG:
                return Long.valueOf(value);
            case PropertyType.DOUBLE:
                return Double.valueOf(value);
            case PropertyType.DATE:
                return helper.tryParseCalendar(value);
            case PropertyType.BOOLEAN:
                return Boolean.valueOf(value);
            case PropertyType.DECIMAL:
                return new BigDecimal(value);
            default:
                throw new ParseException("Unsupported property type: " + PropertyType.nameFromValue(type));
        }
    }