switch (t)
{
case NULL :
return new NullValue();
case BOOLEAN :
return new BooleanValue((Boolean)object);
case BYTE :
return new LongValue((Byte)object);
case SHORT :
return new LongValue((Short)object);
case INT :
return new LongValue((Integer)object);
case LONG :
return new LongValue((Long)object);
case FLOAT :
return new DoubleValue((Float)object);
case DOUBLE :
return new DoubleValue((Double)object);
case CHAR :
return new StringValue(Character.toString((Character)object));
case STRING :
return new StringValue((String)object);
case ENUM :
return new StringValue(((Enum)object).name());
case ARRAY_BOOLEAN : {
JsonValue jsonArray = new ArrayValue();
int length = Array.getLength(object);
for (int i = 0; i < length; i++)
{
jsonArray.addElement(new BooleanValue(Array.getBoolean(object, i)));
}
return jsonArray;
}
case ARRAY_BYTE : {
JsonValue jsonArray = new ArrayValue();