From bf0958fcbb32037960d55bbe352f932d55521811 Mon Sep 17 00:00:00 2001 From: seinturi Date: Thu, 30 Mar 2017 09:17:52 +0000 Subject: [PATCH] Add information to link the generate code to its source code element. --- .../osgi/FCOOCtrlSourceCodeGenerator.java | 25 ++----------------- .../comp/FCCompCtrlSourceCodeGenerator.java | 4 +-- .../InitializerCompCtrlClassGenerator.java | 4 +-- .../opt/oo/FCOOCtrlSourceCodeGenerator.java | 4 +-- .../oo/InitializerOOCtrlClassGenerator.java | 4 +-- .../oo/light/FCOOCtrlSourceCodeGenerator.java | 18 ++++--------- .../InitializerOOCtrlClassGenerator.java | 4 +-- .../tinfilet/TinfiParserSupportImpl.java | 2 +- 8 files changed, 18 insertions(+), 47 deletions(-) diff --git a/tinfi/extension/osgi/opt/oo/src/main/java/org/ow2/frascati/tinfi/osgi/FCOOCtrlSourceCodeGenerator.java b/tinfi/extension/osgi/opt/oo/src/main/java/org/ow2/frascati/tinfi/osgi/FCOOCtrlSourceCodeGenerator.java index 3d0963db8..f53cbcbf1 100644 --- a/tinfi/extension/osgi/opt/oo/src/main/java/org/ow2/frascati/tinfi/osgi/FCOOCtrlSourceCodeGenerator.java +++ b/tinfi/extension/osgi/opt/oo/src/main/java/org/ow2/frascati/tinfi/osgi/FCOOCtrlSourceCodeGenerator.java @@ -66,33 +66,15 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator { // Implementation of the FCSourceCodeGeneratorItf interface // ----------------------------------------------------------------------- - /** - * Return true if the current source code generator handles the - * specified controller descriptor. - * - * @param controllerDesc the controller descriptor to be checked - * @return - * true if controllerDesc should be accepted - */ @Override public boolean acceptCtrlDesc( Object controllerDesc ) { boolean accept = controllerDesc.equals(SCA_OSGI_PRIMITIVE); return accept; } - /** - * Generate the source code associated to a Fractal component. - * The membrane implementation and the initializer implementation are - * generated. - * - * @param type the component type - * @param controllerDesc the component controller descriptor - * @param contentDesc the component content descriptor - * @return the initializer class generator for this component - */ @Override public SourceCodeGeneratorItf generate( - Type type, Object controllerDesc, Object contentDesc ) + Type type, Object controllerDesc, Object contentDesc, Object source ) throws IOException { /* @@ -101,14 +83,11 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator { osgig.check(type,controllerDesc,contentDesc); SourceCodeGeneratorItf scg = - super.generate(type,controllerDesc,contentDesc); + super.generate(type,controllerDesc,contentDesc,source); return scg; } - /** - * Return the source code generator for component interfaces. - */ @Override public ProxyClassGeneratorItf getInterfaceClassGenerator(InterfaceType it) { diff --git a/tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/FCCompCtrlSourceCodeGenerator.java b/tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/FCCompCtrlSourceCodeGenerator.java index 271797a40..271d9cfa1 100644 --- a/tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/FCCompCtrlSourceCodeGenerator.java +++ b/tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/FCCompCtrlSourceCodeGenerator.java @@ -113,10 +113,10 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator { getInitializerClassGenerator( Juliac jc, FCSourceCodeGeneratorItf fcscg, CompBasedMembraneDesc membraneDesc, ComponentType ct, - Object contentDesc ) { + Object contentDesc, Object source ) { return new InitializerCompCtrlClassGenerator( - jc,fcscg,membraneDesc,ct,contentDesc); + jc,fcscg,membraneDesc,ct,contentDesc,source); } /** diff --git a/tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/InitializerCompCtrlClassGenerator.java b/tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/InitializerCompCtrlClassGenerator.java index f4d9f0bf6..5d8734a18 100644 --- a/tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/InitializerCompCtrlClassGenerator.java +++ b/tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/InitializerCompCtrlClassGenerator.java @@ -47,9 +47,9 @@ extends org.objectweb.fractal.juliac.opt.comp.InitializerCompCtrlClassGenerator public InitializerCompCtrlClassGenerator( Juliac jc, FCSourceCodeGeneratorItf fcscg, CompBasedMembraneDesc membraneDesc, ComponentType ct, - Object contentDesc ) { + Object contentDesc, Object source ) { - super(jc,fcscg,membraneDesc,ct,contentDesc); + super(jc,fcscg,membraneDesc,ct,contentDesc,source); } @Override diff --git a/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/FCOOCtrlSourceCodeGenerator.java b/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/FCOOCtrlSourceCodeGenerator.java index bfbd4d939..f4cc95109 100644 --- a/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/FCOOCtrlSourceCodeGenerator.java +++ b/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/FCOOCtrlSourceCodeGenerator.java @@ -96,10 +96,10 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator { protected InitializerOOCtrlClassGenerator getInitializerClassGenerator( Juliac jc, FCSourceCodeGeneratorItf fcscg, SimpleMembraneDesc membraneDesc, ComponentType ct, - Object contentDesc ) { + Object contentDesc, Object source ) { return new InitializerOOCtrlClassGenerator( - jc,fcscg,membraneDesc,ct,contentDesc); + jc,fcscg,membraneDesc,ct,contentDesc,source); } /** diff --git a/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/InitializerOOCtrlClassGenerator.java b/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/InitializerOOCtrlClassGenerator.java index 67336d628..3bad55da0 100644 --- a/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/InitializerOOCtrlClassGenerator.java +++ b/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/InitializerOOCtrlClassGenerator.java @@ -48,9 +48,9 @@ extends org.objectweb.fractal.juliac.opt.oo.InitializerOOCtrlClassGenerator { public InitializerOOCtrlClassGenerator( Juliac jc, FCSourceCodeGeneratorItf fcscg, SimpleMembraneDesc membraneDesc, ComponentType ct, - Object contentDesc ) { + Object contentDesc, Object source ) { - super(jc,fcscg,membraneDesc,ct,contentDesc); + super(jc,fcscg,membraneDesc,ct,contentDesc,source); } @Override diff --git a/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/FCOOCtrlSourceCodeGenerator.java b/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/FCOOCtrlSourceCodeGenerator.java index 6867dc7c6..eda143ffa 100644 --- a/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/FCOOCtrlSourceCodeGenerator.java +++ b/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/FCOOCtrlSourceCodeGenerator.java @@ -55,18 +55,10 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator { mloader.put(SCALightComposite.NAME,SCALightComposite.class); } - /** - * Generate the implementation of the membrane associated to a Fractal - * component. - * - * @param ct the component type - * @param ctrldesc the component controller descriptor - * @param contentClassName the name of the component content class - * @return data about the membrane implementation - */ @Override public SimpleMembraneDesc generateMembraneImpl( - ComponentType ct, String ctrldesc, String contentClassName ) + ComponentType ct, String ctrldesc, String contentClassName, + Object source ) throws IOException { /* @@ -75,17 +67,17 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator { */ generateSCAContentControllerImpl(contentClassName); - return super.generateMembraneImpl(ct,ctrldesc,contentClassName); + return super.generateMembraneImpl(ct,ctrldesc,contentClassName,source); } @Override protected InitializerOOCtrlClassGenerator getInitializerClassGenerator( Juliac jc, FCSourceCodeGeneratorItf fcscg, SimpleMembraneDesc membraneDesc, ComponentType ct, - Object contentDesc ) { + Object contentDesc, Object source ) { return new InitializerOOCtrlClassGenerator( - jc,fcscg,membraneDesc,ct,contentDesc); + jc,fcscg,membraneDesc,ct,contentDesc,source); } diff --git a/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/InitializerOOCtrlClassGenerator.java b/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/InitializerOOCtrlClassGenerator.java index b3c08108c..083d6b633 100644 --- a/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/InitializerOOCtrlClassGenerator.java +++ b/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/InitializerOOCtrlClassGenerator.java @@ -61,9 +61,9 @@ extends org.ow2.frascati.tinfi.opt.oo.InitializerOOCtrlClassGenerator { public InitializerOOCtrlClassGenerator( Juliac jc, FCSourceCodeGeneratorItf fcscg, SimpleMembraneDesc membraneDesc, ComponentType ct, - Object contentDesc ) { + Object contentDesc, Object source ) { - super(jc,fcscg,membraneDesc,ct,contentDesc); + super(jc,fcscg,membraneDesc,ct,contentDesc,source); } @Override diff --git a/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/tinfilet/TinfiParserSupportImpl.java b/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/tinfilet/TinfiParserSupportImpl.java index f5b37c9e1..31fb48cee 100644 --- a/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/tinfilet/TinfiParserSupportImpl.java +++ b/tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/tinfilet/TinfiParserSupportImpl.java @@ -349,7 +349,7 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf { /* * Generate the Juliac factory class for the component. */ - SourceCodeGeneratorItf icg = jc.generate(ct,controller,adl); + SourceCodeGeneratorItf icg = jc.generate(ct,controller,adl,cl); /* * Generate a second factory that extends the previous one and that -- GitLab