public abstract class ForwardingProtocolRequestWriter extends java.lang.Object implements ProtocolRequestWriter
Useful for wrapping and subclassing without inheritance.
| Modifier and Type | Method and Description |
|---|---|
ProtocolRequestWriter |
beginRequest()
Start a request
|
void |
close()
|
ProtocolRequestWriter |
endRequest()
Finish a request
|
ProtocolRequestWriter |
writeData(DataSource source)
Set a DataSource as request data
|
ProtocolRequestWriter |
writeMethodName(java.lang.String name)
Write the method name of the request
|
ProtocolRequestWriter |
writeName(java.lang.String name)
Write the name of a parameter
|
ProtocolRequestWriter |
writeValue(boolean value)
Write the value of a parameter
|
ProtocolRequestWriter |
writeValue(double value)
Write the value of a parameter
|
ProtocolRequestWriter |
writeValue(float value)
Write the value of a parameter
|
ProtocolRequestWriter |
writeValue(long value)
Write the value of a parameter
|
ProtocolRequestWriter |
writeValue(java.lang.Object value)
Write the value of a parameter
|
ProtocolRequestWriter |
writeValue(java.lang.String value)
Write the value of a parameter
|
public ProtocolRequestWriter beginRequest() throws java.io.IOException
ProtocolRequestWriterbeginRequest in interface ProtocolRequestWriterjava.io.IOException - on a failed IO operationpublic ProtocolRequestWriter writeData(DataSource source) throws java.io.IOException
ProtocolRequestWriterwriteData in interface ProtocolRequestWritersource - a non-null DataSource objectjava.io.IOException - on a failed IO operationpublic ProtocolRequestWriter writeMethodName(java.lang.String name) throws java.io.IOException
ProtocolRequestWriterwriteMethodName in interface ProtocolRequestWritername - a non-null stringjava.io.IOException - on a failed IO operationpublic ProtocolRequestWriter writeName(java.lang.String name) throws java.io.IOException
ProtocolWriter
Every call of this method should be followed by a call to one the variants of writeValue()
writeName in interface ProtocolRequestWriterwriteName in interface ProtocolWritername - the non-null name of the parameterjava.io.IOException - on a failed IO operationpublic ProtocolRequestWriter writeValue(java.lang.Object value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue() should be preceded by a call to
ProtocolWriter.writeName(String).
The provided argument must be a non-null object, of type String or any of the boxed variants of
primitive types. An object will be accepted if Class.isPrimitive() returns true for the object type.
writeValue in interface ProtocolRequestWriterwriteValue in interface ProtocolWritervalue - a non-null objectjava.io.IOException - on a failed IO operationpublic ProtocolRequestWriter writeValue(java.lang.String value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue() should be preceded by a call to
ProtocolWriter.writeName(String).
writeValue in interface ProtocolRequestWriterwriteValue in interface ProtocolWritervalue - a non-null String objectjava.io.IOException - on failed IO operationspublic ProtocolRequestWriter writeValue(double value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue() should be preceded by a call to
ProtocolWriter.writeName(String).
writeValue in interface ProtocolRequestWriterwriteValue in interface ProtocolWritervalue - a doublejava.io.IOException - on a failed IO operationpublic ProtocolRequestWriter writeValue(float value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue() should be preceded by a call to
ProtocolWriter.writeName(String).
writeValue in interface ProtocolRequestWriterwriteValue in interface ProtocolWritervalue - a floatjava.io.IOException - on a failed IO operationpublic ProtocolRequestWriter writeValue(long value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue() should be preceded by a call to
ProtocolWriter.writeName(String).
writeValue in interface ProtocolRequestWriterwriteValue in interface ProtocolWritervalue - a longjava.io.IOException - on a failed IO operationpublic ProtocolRequestWriter writeValue(boolean value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue() should be preceded by a call to
ProtocolWriter.writeName(String).
writeValue in interface ProtocolRequestWriterwriteValue in interface ProtocolWritervalue - a booleanjava.io.IOException - on a failed IO operationpublic void close()
close in interface ProtocolWriterclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic ProtocolRequestWriter endRequest() throws java.io.IOException
ProtocolRequestWriterendRequest in interface ProtocolRequestWriterjava.io.IOException - on a failed IO operation