in shared/impl-vlt/src/main/java/org/apache/sling/ide/impl/vlt/ConversionUtils.java [29:98]
public static Object getPropertyValue(Property property) throws RepositoryException {
Object propertyValue = null;
// TODO - handle isMultiple() == true
switch (property.getType()) {
case PropertyType.BOOLEAN:
if (property.isMultiple()) {
propertyValue = toBooleanArray(property.getValues());
} else {
propertyValue = property.getBoolean();
}
break;
case PropertyType.DATE:
if (property.isMultiple()) {
propertyValue = toCalendarArray(property.getValues());
} else {
propertyValue = property.getDate();
}
break;
case PropertyType.DECIMAL:
if (property.isMultiple()) {
propertyValue = toDecimalArray(property.getValues());
} else {
propertyValue = property.getDecimal();
}
break;
case PropertyType.DOUBLE:
if (property.isMultiple()) {
propertyValue = toDoubleArray(property.getValues());
} else {
propertyValue = property.getDouble();
}
break;
case PropertyType.LONG:
if (property.isMultiple()) {
propertyValue = toLongArray(property.getValues());
} else {
propertyValue = property.getLong();
}
break;
case PropertyType.PATH:
case PropertyType.STRING:
case PropertyType.REFERENCE:
case PropertyType.WEAKREFERENCE:
case PropertyType.URI:
case PropertyType.NAME:
if (property.isMultiple()) {
propertyValue = toStringArray(property.getValues());
} else {
propertyValue = property.getString();
}
break;
case PropertyType.BINARY:
// explicitly skip, not part of the ResourceProxy abstraction
break;
default:
// TODO warn if property type not known
break;
}
return propertyValue;
}