org.apache.xmlrpc
Class XmlRpcResponseProcessor
java.lang.Object
org.apache.xmlrpc.XmlRpcResponseProcessor
public class XmlRpcResponseProcessor
extends java.lang.Object
Process an Object and produce byte array that represents the specified
encoding of the output as an XML-RPC response. This is NOT thread safe.
byte[] | encodeException(Exception x, String encoding) - Process an exception, and return output in the specified
encoding.
|
byte[] | encodeException(Exception x, String encoding, int code) - Process an exception, and return output in the specified
encoding.
|
byte[] | encodeResponse(Object responseParam, String encoding) - Process a successful response, and return output in the
specified encoding.
|
(package private) void | writeError(int code, String message, XmlWriter writer) - Writes an XML-RPC error response to the XML writer.
|
(package private) void | writeResponse(Object param, XmlWriter writer) - Writes an XML-RPC response to the XML writer.
|
EMPTY_BYTE_ARRAY
private static final byte[] EMPTY_BYTE_ARRAY
XmlRpcResponseProcessor
public XmlRpcResponseProcessor()
Creates a new instance.
encodeException
public byte[] encodeException(Exception x,
String encoding)
Process an exception, and return output in the specified
encoding.
encoding
- The output encoding.
- byte[] The XML-RPC response.
encodeException
public byte[] encodeException(Exception x,
String encoding,
int code)
Process an exception, and return output in the specified
encoding.
encoding
- The output encoding.code
- The XML-RPC faultCode.
- byte[] The XML-RPC response.
encodeResponse
public byte[] encodeResponse(Object responseParam,
String encoding)
throws IOException,
UnsupportedEncodingException,
XmlRpcException
Process a successful response, and return output in the
specified encoding.
responseParam
- The response to process.encoding
- The output encoding.
- byte[] The XML-RPC response.
writeError
(package private) void writeError(int code,
String message,
XmlWriter writer)
throws XmlRpcException,
IOException
Writes an XML-RPC error response to the XML writer.
writeResponse
(package private) void writeResponse(Object param,
XmlWriter writer)
throws XmlRpcException,
IOException
Writes an XML-RPC response to the XML writer.
Copyright B) 1999-2002 Apache Software Foundation. All Rights Reserved.