b185502683
In addition to the streamable generation, there were also issues with the receiver stuff, mostly to do with import
ordering. Modernizing that code to use ImportSet and {importGroups} seems to have fixed it.
NOTE: This is also broken in narya 1.9, but it not really worth the effort to fix that. It's easier just to move all
the projects that need it back to trunk. Hurray bleeding edge!
Testing done: gencode in orth and who, checked no diffs were generated.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6727 542714f4-19e9-0310-aa3c-eee0fc999fb1
56 lines
1.3 KiB
Cheetah
56 lines
1.3 KiB
Cheetah
package {{package}};
|
|
|
|
{{#importGroups}}
|
|
{{#this}}
|
|
import {{this}};
|
|
{{/this}}
|
|
|
|
{{/importGroups}}
|
|
/**
|
|
* Dispatches calls to a {@link {{name}}Receiver} instance.
|
|
*/
|
|
public class {{name}}Decoder extends InvocationDecoder
|
|
{
|
|
/** The generated hash code used to identify this receiver class. */
|
|
public static final String RECEIVER_CODE = "{{receiver_code}}";
|
|
|
|
{{#methods}}
|
|
/** The method id used to dispatch {@link {{name}}Receiver#{{method.name}}}
|
|
* notifications. */
|
|
public static final int {{code}} = {{-index}};
|
|
|
|
{{/methods}}
|
|
/**
|
|
* Creates a decoder that may be registered to dispatch invocation
|
|
* service notifications to the specified receiver.
|
|
*/
|
|
public {{name}}Decoder ({{name}}Receiver receiver)
|
|
{
|
|
this.receiver = receiver;
|
|
}
|
|
|
|
@Override
|
|
public String getReceiverCode ()
|
|
{
|
|
return RECEIVER_CODE;
|
|
}
|
|
|
|
@Override
|
|
public void dispatchNotification (int methodId, Object[] args)
|
|
{
|
|
switch (methodId) {
|
|
{{#methods}}
|
|
case {{code}}:
|
|
(({{name}}Receiver)receiver).{{method.name}}(
|
|
{{getUnwrappedArgListAsListeners}}
|
|
);
|
|
return;
|
|
|
|
{{/methods}}
|
|
default:
|
|
super.dispatchNotification(methodId, args);
|
|
return;
|
|
}
|
|
}
|
|
}
|