Add newlines to xmlrpc end tags
This commit is contained in:
parent
a61b636d85
commit
8976d8fb7f
1 changed files with 17 additions and 17 deletions
|
@ -10,27 +10,27 @@ import java.util.Map;
|
|||
public class XmlRpcStreamWriter {
|
||||
private static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
||||
private static final String METHOD_CALL_START_TAG = "<methodCall>";
|
||||
private static final String METHOD_CALL_END_TAG = "</methodCall>";
|
||||
private static final String METHOD_CALL_END_TAG = "</methodCall>\n";
|
||||
private static final String METHOD_NAME_START_TAG = "<methodName>";
|
||||
private static final String METHOD_NAME_END_TAG = "</methodName>";
|
||||
private static final String METHOD_NAME_END_TAG = "</methodName>\n";
|
||||
private static final String METHOD_RESPONSE_START_TAG = "<methodResponse>";
|
||||
private static final String METHOD_RESPONSE_END_TAG = "</methodResponse>";
|
||||
private static final String METHOD_RESPONSE_END_TAG = "</methodResponse>\n";
|
||||
private static final String PARAMS_START_TAG = "<params>";
|
||||
private static final String PARAMS_END_TAG = "</params>";
|
||||
private static final String PARAMS_END_TAG = "</params>\n";
|
||||
private static final String PARAM_START_TAG = "<param>";
|
||||
private static final String PARAM_END_TAG = "</param>";
|
||||
private static final String PARAM_END_TAG = "</param>\n";
|
||||
private static final String VALUE_START_TAG = "<value>";
|
||||
private static final String VALUE_END_TAG = "</value>";
|
||||
private static final String VALUE_END_TAG = "</value>\n";
|
||||
private static final String ARRAY_START_TAG = "<array>";
|
||||
private static final String ARRAY_END_TAG = "</array>";
|
||||
private static final String ARRAY_END_TAG = "</array>\n";
|
||||
private static final String DATA_START_TAG = "<data>";
|
||||
private static final String DATA_END_TAG = "</data>";
|
||||
private static final String DATA_END_TAG = "</data>\n";
|
||||
private static final String STRUCT_START_TAG = "<struct>";
|
||||
private static final String STRUCT_END_TAG = "</struct>";
|
||||
private static final String STRUCT_END_TAG = "</struct>\n";
|
||||
private static final String MEMBER_START_TAG = "<member>";
|
||||
private static final String MEMBER_END_TAG = "</member>";
|
||||
private static final String MEMBER_END_TAG = "</member>\n";
|
||||
private static final String NAME_START_TAG = "<name>";
|
||||
private static final String NAME_END_TAG = "</name>";
|
||||
private static final String NAME_END_TAG = "</name>\n";
|
||||
|
||||
private Writer writer;
|
||||
|
||||
|
@ -80,35 +80,35 @@ public class XmlRpcStreamWriter {
|
|||
writer.write ( VALUE_START_TAG );
|
||||
writer.write ( "<string>" );
|
||||
writer.write ( escapeXml ( ( String ) value ) );
|
||||
writer.write ( "</string>" );
|
||||
writer.write ( "</string>\n" );
|
||||
writer.write ( VALUE_END_TAG );
|
||||
}
|
||||
else if ( value instanceof Integer ) {
|
||||
writer.write ( VALUE_START_TAG );
|
||||
writer.write ( "<i4>" );
|
||||
writer.write ( value.toString ( ) );
|
||||
writer.write ( "</i4>" );
|
||||
writer.write ( "</i4>\n" );
|
||||
writer.write ( VALUE_END_TAG );
|
||||
} else if(value instanceof Long)
|
||||
{
|
||||
writer.write ( VALUE_START_TAG );
|
||||
writer.write ( "<i8>" );
|
||||
writer.write ( value.toString () ); // Save it as a int for now due to unclear handling
|
||||
writer.write ( "</i8>" );
|
||||
writer.write ( "</i8>\n" );
|
||||
writer.write ( VALUE_END_TAG );
|
||||
}
|
||||
else if ( value instanceof Double ) {
|
||||
writer.write ( VALUE_START_TAG );
|
||||
writer.write ( "<double>" );
|
||||
writer.write ( value.toString ( ) );
|
||||
writer.write ( "</double>" );
|
||||
writer.write ( "</double>\n" );
|
||||
writer.write ( VALUE_END_TAG );
|
||||
}
|
||||
else if ( value instanceof Boolean ) {
|
||||
writer.write ( VALUE_START_TAG );
|
||||
writer.write ( "<string>" );
|
||||
writer.write ( value.toString ( ) );
|
||||
writer.write ( "</string>" );
|
||||
writer.write ( "</string>\n" );
|
||||
writer.write ( VALUE_END_TAG );
|
||||
}
|
||||
else if ( value instanceof List ) {
|
||||
|
@ -143,7 +143,7 @@ public class XmlRpcStreamWriter {
|
|||
writer.write ( VALUE_START_TAG );
|
||||
writer.write ( "<int>" );
|
||||
writer.write ( value.toString () ); // Treat as a integer for now
|
||||
writer.write ( "</int>" );
|
||||
writer.write ( "</int>\n" );
|
||||
writer.write ( VALUE_END_TAG );
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue