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
ProtocolRequestWriter
beginRequest
in interface ProtocolRequestWriter
java.io.IOException
- on a failed IO operationpublic ProtocolRequestWriter writeData(DataSource source) throws java.io.IOException
ProtocolRequestWriter
writeData
in interface ProtocolRequestWriter
source
- a non-null DataSource objectjava.io.IOException
- on a failed IO operationpublic ProtocolRequestWriter writeMethodName(java.lang.String name) throws java.io.IOException
ProtocolRequestWriter
writeMethodName
in interface ProtocolRequestWriter
name
- 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 ProtocolRequestWriter
writeName
in interface ProtocolWriter
name
- 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 ProtocolRequestWriter
writeValue
in interface ProtocolWriter
value
- 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 ProtocolRequestWriter
writeValue
in interface ProtocolWriter
value
- 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 ProtocolRequestWriter
writeValue
in interface ProtocolWriter
value
- 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 ProtocolRequestWriter
writeValue
in interface ProtocolWriter
value
- 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 ProtocolRequestWriter
writeValue
in interface ProtocolWriter
value
- 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 ProtocolRequestWriter
writeValue
in interface ProtocolWriter
value
- a booleanjava.io.IOException
- on a failed IO operationpublic void close()
close
in interface ProtocolWriter
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public ProtocolRequestWriter endRequest() throws java.io.IOException
ProtocolRequestWriter
endRequest
in interface ProtocolRequestWriter
java.io.IOException
- on a failed IO operation