protected abstract static class RMIWrap.WrapperBodyWriter
extends java.lang.Object
Encapsulates the ability to write the body of a wrapper class.
Modifier and Type | Field and Description |
---|---|
protected java.lang.Class |
interfaceClass
The interface class (i.e.
|
protected java.lang.String |
interfaceName
The type name of
interfaceClass . |
Constructor and Description |
---|
RMIWrap.WrapperBodyWriter(java.lang.Class interfaceClass)
Create a new WrapperBodyWriter with the given interface class.
|
Modifier and Type | Method and Description |
---|---|
(package private) java.lang.String |
classDeclExtra()
Extra stuff (e.g.
|
(package private) abstract void |
processMethod(java.io.PrintWriter out,
java.lang.reflect.Method method)
Called by the default impl of
writeWrapperBody(java.io.PrintWriter) to process a
method of interfaceClass . |
(package private) void |
writeDropoutHook(java.io.PrintWriter out,
java.lang.String hookName,
java.lang.reflect.Method method,
java.lang.String paramsExtra)
Write a dropout hook.
|
(package private) void |
writeSignature(java.io.PrintWriter out,
java.lang.reflect.Method method,
boolean remote,
boolean handler)
Write a method signature.
|
(package private) void |
writeTypeUnwrap(java.io.PrintWriter out,
java.lang.Class type,
java.lang.String name,
java.lang.String prefix,
java.lang.String suffix)
Write a type unwrap block.
|
(package private) void |
writeTypeWrap(java.io.PrintWriter out,
java.lang.Class type,
java.lang.String name,
java.lang.String prefix,
java.lang.String suffix)
Write a type wrap block.
|
(package private) void |
writeWrapperBody(java.io.PrintWriter out)
Write the body of the wrapper class.
|
protected java.lang.Class interfaceClass
The interface class (i.e. foo.API) for which a wrapper is being written.
protected java.lang.String interfaceName
The type name of interfaceClass
.
RMIWrap.WrapperBodyWriter(java.lang.Class interfaceClass)
Create a new WrapperBodyWriter with the given interface class.
interfaceClass
- the interface class (i.e. foo.API)void writeWrapperBody(java.io.PrintWriter out)
Write the body of the wrapper class.
Default impl calls processMethod(java.io.PrintWriter, java.lang.reflect.Method)
for all methods of interfaceClass
.
out
- where to writeabstract void processMethod(java.io.PrintWriter out, java.lang.reflect.Method method)
Called by the default impl of writeWrapperBody(java.io.PrintWriter)
to process a
method of interfaceClass
.
out
- where to writemethod
- the Method to processjava.lang.String classDeclExtra()
Extra stuff (e.g. extends and implements specs) that should be added at the end of the class declaration.
Default impl returns the empty string.
void writeSignature(java.io.PrintWriter out, java.lang.reflect.Method method, boolean remote, boolean handler)
Write a method signature.
out
- where to writemethod
- the Method for which to write a signatureremote
- whether to write a remote sig (adding "Remote" to the
method name and throwing RemoteException)handler
- whether to write a RemoteException handler sig (adding
"RemoteException" to the method name and taking an additional
RemoteException parameter e
)void writeTypeUnwrap(java.io.PrintWriter out, java.lang.Class type, java.lang.String name, java.lang.String prefix, java.lang.String suffix)
Write a type unwrap block.
out
- where to writetype
- the type to unwrapname
- the symbol name to unwrapprefix
- optional prefix to write before the unwrap, null for nonesuffix
- optional suffix to write after the unwrap, null for nonevoid writeTypeWrap(java.io.PrintWriter out, java.lang.Class type, java.lang.String name, java.lang.String prefix, java.lang.String suffix)
Write a type wrap block.
out
- where to writetype
- the type to wrapname
- the symbol name to wrapprefix
- optional prefix to write before the wrap, null for nonesuffix
- optional suffix to write after the wrap, null for nonevoid writeDropoutHook(java.io.PrintWriter out, java.lang.String hookName, java.lang.reflect.Method method, java.lang.String paramsExtra)
Write a dropout hook.
A dropout hook is a call to hookName
and a check of the
return value. If the return is not null, then it is returned
immediately.
out
- where to writehookName
- the name of the hook to callmethod
- the method from which the hook is being calledparamsExtra
- extra parameters to add to the hook call (all params
of method
will be added first)