text = defaultValue;
text = renderParams.defaultValue;
        void writeResponse(Object value, StringBuffer buffer, boolean useDefault)                throws UnsupportedEncodingException {            String text;            if (value == null) {                if (useDefault) {                    text = defaultValue;                } else {                    return;                }            } else {                // do not render doubles as doubles unless                // they actually have a decimal place. This is necessary because                // all numbers are handled as Double in JavaScript.                if (value instanceof Double) {                    Double d = (Double) value;                    if (d.longValue() == d.doubleValue()) {                        text = Long.toString(d.longValue());                    } else {                        text = d.toString();                    }                } else {                    text = value.toString();                }            }            if ((text != null) && (text.length() > 0)) {                // only write prefix/suffix if value is not null, if we write the default                // value provided by the macro tag, we assume it's already complete                if (prefix != null && value != null) {                    buffer.append(prefix);                }                switch (encoding) {                    case ENCODE_NONE:                        buffer.append(text);                        break;                    case ENCODE_HTML:                        HtmlEncoder.encode(text, buffer);                        break;                    case ENCODE_XML:                        HtmlEncoder.encodeXml(text, buffer);                        break;                    case ENCODE_FORM:                        HtmlEncoder.encodeFormValue(text, buffer);                        break;                    case ENCODE_URL:                        buffer.append(UrlEncoded.encode(text, app.charset));                        break;                    case ENCODE_ALL:                        HtmlEncoder.encodeAll(text, buffer);                        break;                }                if (suffix != null && value != null) {                    buffer.append(suffix);                }            }        }