|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.flat502.rox.marshal.xmlrpc.XmlRpcMethod
public abstract class XmlRpcMethod
This is the base class for XML-RPC method calls and responses.
For details about the marshalling process see
XmlRpcMarshaller
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.flat502.rox.marshal.xmlrpc.XmlRpcConstants |
---|
XmlRpcConstants.ContentTypes, XmlRpcConstants.Formats, XmlRpcConstants.Tags, XmlRpcConstants.Types |
Constructor Summary | |
---|---|
protected |
XmlRpcMethod(FieldNameEncoder fieldNameEncoder)
Initialize a new instance of this class. |
Method Summary | |
---|---|
java.lang.String |
getContentType()
Called to get the value for the Content-Type
HTTP header. |
java.lang.String |
getHttpMethod()
|
java.lang.String |
getHttpURI(java.net.URL url)
|
byte[] |
marshal()
Marshals the current instance into a byte array encoded using UTF-8. |
byte[] |
marshal(java.nio.charset.Charset charSet)
Marshals the current instance into a byte array encoded using the specified character set. |
void |
marshal(java.io.OutputStream out)
Marshals the current instance to an OutputStream encoded
using UTF-8. |
void |
marshal(java.io.OutputStream out,
java.nio.charset.Charset charSet)
Marshals the current instance to an OutputStream encoded
using the specified character set. |
protected abstract void |
marshalImpl(XmlPrinter out)
The central hook for marshalling for sub-classes. |
protected void |
marshalValue(XmlPrinter out,
int depth,
java.lang.Object param)
|
void |
setCompactXml(boolean compact)
Configure the compactness of the marshalled form of this instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected XmlRpcMethod(FieldNameEncoder fieldNameEncoder)
fieldNameEncoder
- An implementation of FieldNameEncoder
used when
struct members are marshalled. May be null
.Method Detail |
---|
public void setCompactXml(boolean compact)
The marshalled form of instances is compact by default.
compact
- A flag indicating whether to produce compact XML (true
)
or more readable XML (true
).public java.lang.String getHttpMethod()
public java.lang.String getHttpURI(java.net.URL url)
public java.lang.String getContentType()
RpcMethod
Content-Type
HTTP header.
This is used when constructing requests and responses, and when validating requests and responses.
getContentType
in interface RpcMethod
text/xml
.public byte[] marshal() throws java.io.IOException, MarshallingException
java.io.IOException
- if an error occurs while storing the marshalled form of this
instance out this instance.
MarshallingException
- if an error occurs while marshalling this instance.public byte[] marshal(java.nio.charset.Charset charSet) throws java.io.IOException, MarshallingException
charSet
- The character set to use when encoding the marshalled form of
this instance.
java.io.IOException
- if an error occurs while storing the marshalled form of this
instance out this instance.
MarshallingException
- if an error occurs while marshalling this instance.public void marshal(java.io.OutputStream out) throws java.io.IOException, MarshallingException
OutputStream
encoded
using UTF-8.
out
- The OutputStream
to marshal this instance to.
java.io.IOException
- if an error occurs while storing the marshalled form of this
instance out this instance.
MarshallingException
- if an error occurs while marshalling this instance.public void marshal(java.io.OutputStream out, java.nio.charset.Charset charSet) throws java.io.IOException, MarshallingException
OutputStream
encoded
using the specified character set.
marshal
in interface RpcMethod
out
- The OutputStream
to marshal this instance to.charSet
- The character set to use when encoding the marshalled form of
this instance.
java.io.IOException
- if an error occurs while storing the marshalled form of this
instance out this instance.
MarshallingException
- if an error occurs while marshalling this instance.protected abstract void marshalImpl(XmlPrinter out) throws java.io.IOException, MarshallingException
Implementations should write their marshalled form to the given stream which has already been initialized with an appropriate encoding.
out
- The stream implementations should marshal themselves to.
java.io.IOException
- Implementations may raise an exception if a problem occurs
while writing the marshalled form of this instance out.
MarshallingException
- Implementations may raise an exception if a problem occurs
while marshalling is being attempted.protected void marshalValue(XmlPrinter out, int depth, java.lang.Object param) throws MarshallingException, java.io.IOException
MarshallingException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |