*/
private void toSAX(ContentHandler contentHandler,
NamespaceSupport namespaces, Object dictionaryParameter)
throws SAXException
{
AttributeMap attributes = new AttributeMap();
attributes.setNamespace(WingConstants.I18N);
boolean unknownType = false;
if (dictionaryParameter.getClass().equals(Date.class.getName()))
{
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.getClass().equals(Integer.class.getName()))
{
Integer value = (Integer) dictionaryParameter;
attributes.put(A_TYPE, TYPE_NUMBER);
attributes.put(A_VALUE, String.valueOf(value));
}
else if (dictionaryParameter.getClass().equals(Double.class.getName()))
{
Double value = (Double) dictionaryParameter;
attributes.put(A_TYPE, TYPE_NUMBER);
attributes.put(A_VALUE, String.valueOf(value));
}
else if (dictionaryParameter.getClass().equals(Long.class.getName()))
{
Long value = (Long) dictionaryParameter;
attributes.put(A_TYPE, TYPE_NUMBER);
attributes.put(A_VALUE, String.valueOf(value));
}
else if (dictionaryParameter.getClass().equals(Short.class.getName()))
{
Short value = (Short) dictionaryParameter;
attributes.put(A_TYPE, TYPE_NUMBER);
attributes.put(A_VALUE, String.valueOf(value));
}
else if (dictionaryParameter.getClass().equals(Float.class.getName()))
{
Float value = (Float) dictionaryParameter;
attributes.put(A_TYPE, TYPE_NUMBER);
attributes.put(A_VALUE, String.valueOf(value));
}
else
{
// Unknown types or String
unknownType = true;