Package org.apache.xmlrpc.serializer
Class XmlRpcWriter
java.lang.Object
org.apache.xmlrpc.serializer.XmlRpcWriter
This class is responsible for writing an XmlRpc request or an
XmlRpc response to an output stream.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final XmlRpcStreamConfig
static final String
The namespace URI for proprietary XML-RPC extensions.private final ContentHandler
private final TypeFactory
private static final Attributes
-
Constructor Summary
ConstructorsConstructorDescriptionXmlRpcWriter
(XmlRpcStreamConfig pConfig, ContentHandler pHandler, TypeFactory pTypeFactory) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
write
(XmlRpcRequest pRequest) Writes a clients request to the output stream.void
write
(XmlRpcRequestConfig pConfig, int pCode, String pMessage) Writes a servers error message to the output stream.void
write
(XmlRpcRequestConfig pConfig, int pCode, String pMessage, Throwable pThrowable) Writes a servers error message to the output stream.void
write
(XmlRpcRequestConfig pConfig, Object pResult) Writes a servers response to the output stream.protected void
writeValue
(Object pObject) Writes the XML representation of a Java object.
-
Field Details
-
EXTENSIONS_URI
The namespace URI for proprietary XML-RPC extensions.- See Also:
-
ZERO_ATTRIBUTES
-
config
-
typeFactory
-
handler
-
-
Constructor Details
-
XmlRpcWriter
Creates a new instance.- Parameters:
pConfig
- The clients configuration.pHandler
- The target SAX handler.pTypeFactory
- The type factory being used to create serializers.
-
-
Method Details
-
write
Writes a clients request to the output stream.- Parameters:
pRequest
- The request being written.- Throws:
SAXException
- Writing the request failed.
-
write
Writes a servers response to the output stream.- Parameters:
pConfig
- The request configuration.pResult
- The result object.- Throws:
SAXException
- Writing the response failed.
-
write
Writes a servers error message to the output stream.- Parameters:
pConfig
- The request configuration.pCode
- The error codepMessage
- The error message- Throws:
SAXException
- Writing the error message failed.
-
write
public void write(XmlRpcRequestConfig pConfig, int pCode, String pMessage, Throwable pThrowable) throws SAXException Writes a servers error message to the output stream.- Parameters:
pConfig
- The request configuration.pCode
- The error codepMessage
- The error messagepThrowable
- An exception, which is being sent to the client- Throws:
SAXException
- Writing the error message failed.
-
writeValue
Writes the XML representation of a Java object.- Parameters:
pObject
- The object being written.- Throws:
SAXException
- Writing the object failed.
-