final Property property = item.getItemProperty(pid);
if (property == null && !formatNullProperties) {
return null;
}//not exists
PropertyFormatter propertyFormatter = instances.get(pid);
if (propertyFormatter != null) {
propertyFormatter.setPropertyDataSource(property);
return propertyFormatter;
}
Class<? extends PropertyFormatter> propertyFormatterClass = classes.get(pid);
if (propertyFormatterClass != null) {
try {
propertyFormatter = propertyFormatterClass.newInstance();
} catch (InstantiationException e) {
throw new IllegalStateException(
"getItemProperty: can't create "
+ propertyFormatterClass.getName()
+ " instance for PID=" + pid, e);
} catch (IllegalAccessException e) {
throw new IllegalStateException(
"getItemProperty: can't create "
+ propertyFormatterClass.getName()
+ " instance for PID=" + pid + ": IAE", e);
}// t
propertyFormatter.setPropertyDataSource(property);
return propertyFormatter;
}// i
return property;// as is
}//getItemProperty