*/
private void toSAX(ContentHandler contentHandler,
NamespaceSupport namespaces, Object dictionaryParameter)
throws SAXException
{
AttributeMap attributes = new AttributeMap();
attributes.setNamespace(WingConstants.I18N);
if (dictionaryParameter instanceof Date)
{
Date date = (Date) dictionaryParameter;
DateFormat dateFormater = DateFormat
.getDateInstance(DateFormat.DEFAULT);
attributes.put(A_TYPE, TYPE_DATE);
attributes.put(A_VALUE, dateFormater.format(date));
// If no pattern is given then the default format is assumed.
}
else if (dictionaryParameter instanceof Integer)
{
Integer value = (Integer) dictionaryParameter;
attributes.put(A_TYPE, TYPE_NUMBER);
attributes.put(A_VALUE, String.valueOf(value));
}
else if (dictionaryParameter instanceof Double)
{
Double value = (Double) dictionaryParameter;
attributes.put(A_TYPE, TYPE_NUMBER);
attributes.put(A_VALUE, String.valueOf(value));
}
else if (dictionaryParameter instanceof Long)
{
Long value = (Long) dictionaryParameter;
attributes.put(A_TYPE, TYPE_NUMBER);
attributes.put(A_VALUE, String.valueOf(value));
}
else if (dictionaryParameter instanceof Short)
{
Short value = (Short) dictionaryParameter;
attributes.put(A_TYPE, TYPE_NUMBER);
attributes.put(A_VALUE, String.valueOf(value));
}
else if (dictionaryParameter instanceof Float)
{
Float value = (Float) dictionaryParameter;
attributes.put(A_TYPE, TYPE_NUMBER);
attributes.put(A_VALUE, String.valueOf(value));
}
startElement(contentHandler, namespaces, WingConstants.I18N, E_PARAM, attributes);
// If the type is unknown then the value is not included as an attribute