return _escapeUnsafeHtml;
}
protected AWEncodedString stringValueForObjectInComponent (Object objectValue, AWComponent component)
{
AWEncodedString encodedString = null;
if (_formatter != null) {
Object formatter = _formatter.value(component);
if (formatter != null) {
objectValue = AWFormatting.get(formatter).format(formatter, objectValue);
}
}
boolean unsafeOnly = _escapeUnsafeHtmlBinding == null ? _escapeUnsafeHtml :
_escapeUnsafeHtmlBinding.booleanValue(component);
boolean doEscapeHtml = unsafeOnly ? true :
((_escapeHtmlBinding == null) ? _escapeHtml : _escapeHtmlBinding.booleanValue(component));
if (unsafeOnly) {
encodedString = component.escapeUnsafeString(objectValue);
}
else if (doEscapeHtml) {
encodedString = component.escapeString(objectValue);
}
else if (objectValue instanceof AWEncodedString) {
encodedString = (AWEncodedString)objectValue;
}
else {
String stringValue = (objectValue instanceof String) ? (String)objectValue : AWUtil.toString(objectValue);
encodedString = AWEncodedString.sharedEncodedString(stringValue);
}
boolean useBR = (_useBrBinding == null) ? _useBr : _useBrBinding.booleanValue(component);
boolean useNbsp = (_useNbspBinding == null) ? _useNbsp : _useNbspBinding.booleanValue(component);
if (useBR || useNbsp) {
String string = encodedString.string();
if (useBR) {
string = StringUtil.replaceCharByString(string, '\n', "<br/>");
}
if (useNbsp) {
string = StringUtil.replaceCharByString(string, ' ', " ");
}
encodedString = new AWEncodedString(string);
}
return encodedString;
}