Change datatypes to the XMLRPC standard
This commit is contained in:
parent
c4cb1966bd
commit
4f9a39fc4d
2 changed files with 7 additions and 8 deletions
|
@ -103,6 +103,7 @@ public class XmlRpcStreamReader {
|
|||
switch ( localName ) {
|
||||
case "string":
|
||||
return deserializeString ( );
|
||||
case "i4":
|
||||
case "int":
|
||||
return deserializeInt ( );
|
||||
case "double":
|
||||
|
@ -115,8 +116,6 @@ public class XmlRpcStreamReader {
|
|||
return deserializeStruct ( );
|
||||
case "nil":
|
||||
return null;
|
||||
case "i4":
|
||||
return deserializeByte ( );
|
||||
case "i8":
|
||||
return deserializeLong ( );
|
||||
default:
|
||||
|
|
|
@ -85,23 +85,23 @@ public class XmlRpcStreamWriter {
|
|||
}
|
||||
else if ( value instanceof Integer ) {
|
||||
writer.write ( VALUE_START_TAG );
|
||||
writer.write ( "<int>" );
|
||||
writer.write ( "<i4>" );
|
||||
writer.write ( value.toString ( ) );
|
||||
writer.write ( "</int>" );
|
||||
writer.write ( "</i4>" );
|
||||
writer.write ( VALUE_END_TAG );
|
||||
} else if(value instanceof Long)
|
||||
{
|
||||
writer.write ( VALUE_START_TAG );
|
||||
writer.write ( "<int>" );
|
||||
writer.write ( "<i8>" );
|
||||
writer.write ( value.toString () ); // Save it as a int for now due to unclear handling
|
||||
writer.write ( "</int>" );
|
||||
writer.write ( "</i8>" );
|
||||
writer.write ( VALUE_END_TAG );
|
||||
}
|
||||
else if ( value instanceof Double ) {
|
||||
writer.write ( VALUE_START_TAG );
|
||||
writer.write ( "<real>" );
|
||||
writer.write ( "<double>" );
|
||||
writer.write ( value.toString ( ) );
|
||||
writer.write ( "</real>" );
|
||||
writer.write ( "</double>" );
|
||||
writer.write ( VALUE_END_TAG );
|
||||
}
|
||||
else if ( value instanceof Boolean ) {
|
||||
|
|
Loading…
Reference in a new issue