Package org.apache.xmlrpc.serializer
Class XmlRpcWriter
- java.lang.Object
-
- org.apache.xmlrpc.serializer.XmlRpcWriter
-
public class XmlRpcWriter extends java.lang.Object
This class is responsible for writing an XmlRpc request or an XmlRpc response to an output stream.
-
-
Field Summary
Fields Modifier and Type Field Description private XmlRpcStreamConfig
config
static java.lang.String
EXTENSIONS_URI
The namespace URI for proprietary XML-RPC extensions.private org.xml.sax.ContentHandler
handler
private TypeFactory
typeFactory
private static org.xml.sax.Attributes
ZERO_ATTRIBUTES
-
Constructor Summary
Constructors Constructor Description XmlRpcWriter(XmlRpcStreamConfig pConfig, org.xml.sax.ContentHandler pHandler, TypeFactory pTypeFactory)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
write(XmlRpcRequest pRequest)
Writes a clients request to the output stream.void
write(XmlRpcRequestConfig pConfig, int pCode, java.lang.String pMessage)
Writes a servers error message to the output stream.void
write(XmlRpcRequestConfig pConfig, int pCode, java.lang.String pMessage, java.lang.Throwable pThrowable)
Writes a servers error message to the output stream.void
write(XmlRpcRequestConfig pConfig, java.lang.Object pResult)
Writes a servers response to the output stream.protected void
writeValue(java.lang.Object pObject)
Writes the XML representation of a Java object.
-
-
-
Field Detail
-
EXTENSIONS_URI
public static final java.lang.String EXTENSIONS_URI
The namespace URI for proprietary XML-RPC extensions.- See Also:
- Constant Field Values
-
ZERO_ATTRIBUTES
private static final org.xml.sax.Attributes ZERO_ATTRIBUTES
-
config
private final XmlRpcStreamConfig config
-
typeFactory
private final TypeFactory typeFactory
-
handler
private final org.xml.sax.ContentHandler handler
-
-
Constructor Detail
-
XmlRpcWriter
public XmlRpcWriter(XmlRpcStreamConfig pConfig, org.xml.sax.ContentHandler pHandler, TypeFactory pTypeFactory)
Creates a new instance.- Parameters:
pConfig
- The clients configuration.pHandler
- The target SAX handler.pTypeFactory
- The type factory being used to create serializers.
-
-
Method Detail
-
write
public void write(XmlRpcRequest pRequest) throws org.xml.sax.SAXException
Writes a clients request to the output stream.- Parameters:
pRequest
- The request being written.- Throws:
org.xml.sax.SAXException
- Writing the request failed.
-
write
public void write(XmlRpcRequestConfig pConfig, java.lang.Object pResult) throws org.xml.sax.SAXException
Writes a servers response to the output stream.- Parameters:
pConfig
- The request configuration.pResult
- The result object.- Throws:
org.xml.sax.SAXException
- Writing the response failed.
-
write
public void write(XmlRpcRequestConfig pConfig, int pCode, java.lang.String pMessage) throws org.xml.sax.SAXException
Writes a servers error message to the output stream.- Parameters:
pConfig
- The request configuration.pCode
- The error codepMessage
- The error message- Throws:
org.xml.sax.SAXException
- Writing the error message failed.
-
write
public void write(XmlRpcRequestConfig pConfig, int pCode, java.lang.String pMessage, java.lang.Throwable pThrowable) throws org.xml.sax.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:
org.xml.sax.SAXException
- Writing the error message failed.
-
writeValue
protected void writeValue(java.lang.Object pObject) throws org.xml.sax.SAXException
Writes the XML representation of a Java object.- Parameters:
pObject
- The object being written.- Throws:
org.xml.sax.SAXException
- Writing the object failed.
-
-