try {
final Class propertySchemaClass = ClassUtils.forName(property.getSchema().getType(), ClassUtils.
getDefaultClassLoader());
if (GuardedString.class.equals(propertySchemaClass)) {
value = new GuardedString((values.get(0).toString()).toCharArray());
} else if (GuardedByteArray.class.equals(propertySchemaClass)) {
value = new GuardedByteArray((byte[]) values.get(0));
} else if (Character.class.equals(propertySchemaClass) || Character.TYPE.equals(propertySchemaClass)) {
value = values.get(0) != null && !values.get(0).toString().isEmpty()
? values.get(0).toString().charAt(0)