ptolemy.actor.lib.jni.CompiledCompositeActor actor = (ptolemy.actor.lib.jni.CompiledCompositeActor) compositeActor;
List codeGenerators = actor.attributeList(CodeGenerator.class);
if (codeGenerators.size() == 0) {
// Add a codeGenerator
codeGenerator = new CCodeGenerator(actor,
"CodeGenerator_AutoAdded");
} else {
// Get the last CodeGenerator in the list, maybe
// it was added last?
codeGenerator = (CodeGenerator) codeGenerators