Commit 79340b8b authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

cherry-pick cd2917695

parent 046d7a95
......@@ -399,9 +399,15 @@ aspect Java_Class {
}
if (getType().Java_needInstance() || hasDependencies()) {
env.println("import se.lth.control.labcomm"+env.verStr+".Encoder;");
env.println("import se.lth.control.labcomm"+env.verStr+".SampleDispatcher;");
env.println("import se.lth.control.labcomm"+env.verStr+".SampleHandler;");
env.println();
}
if (getType().Java_needInstance()) {
env.println("import java.io.IOException;");
env.println("import se.lth.control.labcomm"+env.verStr+".Decoder;");
}
// For types without type_dependencies and not needing an instance,
// currently just an empty class is generated
......@@ -409,18 +415,21 @@ aspect Java_Class {
env.println();
env.indent();
if(hasDependencies() || isReferenced()) {
// XXX Java_emitRegisterEncoder(env);
// XXX Java_emitDispatcher(env, false);
}
if (getType().Java_needInstance()) {
getType().Java_emitInstance(env);
Java_emitEncoder(env);
Java_emitDecoder(env);
}
if(hasDependencies() || isReferenced()) {
// XXX Java_emitRegisterEncoder(env);
// XXX Java_emitDispatcher(env, false);
Java_emitSignature(env);
}
env.unindent();
env.println("}");
env.println();
}
......@@ -471,6 +480,13 @@ aspect Java_Class {
Java_emitEncoder(env);
Java_emitDecoder(env);
Java_emitSignature(env);
env.unindent();
env.println("}");
env.println();
}
public void Decl.Java_emitSignature(Java_env env) {
env.println("private static byte[] signature = new byte[] {");
env.indent();
SignatureList signature = signature(env.version);
......@@ -492,10 +508,8 @@ aspect Java_Class {
env.println("};");
env.unindent();
env.println();
env.println("}");
}
public void Decl.Java_emitDispatcher(Java_env env, boolean canDecodeAndHandle) {
env.println("private static class Dispatcher implements SampleDispatcher {");
env.indent();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment