public synchronized void setProperty(String name, Object value) {
if (name.equals(Property.CELL_FORMATTER.getName())) {
String cellFormatterClass = (String) value;
try {
CellFormatter formatter =
RolapSchema.getCellFormatter(
cellFormatterClass,
null);
this.cellFormatter =
new RolapResult.CellFormatterValueFormatter(formatter);
} catch (Exception e) {
throw MondrianResource.instance().CellFormatterLoadFailed
.ex(
cellFormatterClass, getUniqueName(), e);
}
}
if (name.equals(Property.CELL_FORMATTER_SCRIPT.name)) {
String language = (String) getPropertyValue(
Property.CELL_FORMATTER_SCRIPT_LANGUAGE.name);
String scriptText = (String) value;
try {
final Scripts.ScriptDefinition script =
new Scripts.ScriptDefinition(
scriptText,
Scripts.ScriptLanguage.lookup(language));
CellFormatter formatter =
RolapSchema.getCellFormatter(
null,
script);
this.cellFormatter =
new RolapResult.CellFormatterValueFormatter(formatter);