Commit bf0958fc authored by seinturi's avatar seinturi

Add information to link the generate code to its source code element.

parent 64881335
...@@ -66,33 +66,15 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator { ...@@ -66,33 +66,15 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator {
// Implementation of the FCSourceCodeGeneratorItf interface // Implementation of the FCSourceCodeGeneratorItf interface
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/**
* Return <code>true</code> if the current source code generator handles the
* specified controller descriptor.
*
* @param controllerDesc the controller descriptor to be checked
* @return
* <code>true</code> if <code>controllerDesc</code> should be accepted
*/
@Override @Override
public boolean acceptCtrlDesc( Object controllerDesc ) { public boolean acceptCtrlDesc( Object controllerDesc ) {
boolean accept = controllerDesc.equals(SCA_OSGI_PRIMITIVE); boolean accept = controllerDesc.equals(SCA_OSGI_PRIMITIVE);
return accept; 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 @Override
public SourceCodeGeneratorItf generate( public SourceCodeGeneratorItf generate(
Type type, Object controllerDesc, Object contentDesc ) Type type, Object controllerDesc, Object contentDesc, Object source )
throws IOException { throws IOException {
/* /*
...@@ -101,14 +83,11 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator { ...@@ -101,14 +83,11 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator {
osgig.check(type,controllerDesc,contentDesc); osgig.check(type,controllerDesc,contentDesc);
SourceCodeGeneratorItf scg = SourceCodeGeneratorItf scg =
super.generate(type,controllerDesc,contentDesc); super.generate(type,controllerDesc,contentDesc,source);
return scg; return scg;
} }
/**
* Return the source code generator for component interfaces.
*/
@Override @Override
public ProxyClassGeneratorItf getInterfaceClassGenerator(InterfaceType it) { public ProxyClassGeneratorItf getInterfaceClassGenerator(InterfaceType it) {
......
...@@ -113,10 +113,10 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator { ...@@ -113,10 +113,10 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
getInitializerClassGenerator( getInitializerClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<CompBasedMembraneDesc> fcscg, Juliac jc, FCSourceCodeGeneratorItf<CompBasedMembraneDesc> fcscg,
CompBasedMembraneDesc membraneDesc, ComponentType ct, CompBasedMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) { Object contentDesc, Object source ) {
return new InitializerCompCtrlClassGenerator( return new InitializerCompCtrlClassGenerator(
jc,fcscg,membraneDesc,ct,contentDesc); jc,fcscg,membraneDesc,ct,contentDesc,source);
} }
/** /**
......
...@@ -47,9 +47,9 @@ extends org.objectweb.fractal.juliac.opt.comp.InitializerCompCtrlClassGenerator ...@@ -47,9 +47,9 @@ extends org.objectweb.fractal.juliac.opt.comp.InitializerCompCtrlClassGenerator
public InitializerCompCtrlClassGenerator( public InitializerCompCtrlClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<CompBasedMembraneDesc> fcscg, Juliac jc, FCSourceCodeGeneratorItf<CompBasedMembraneDesc> fcscg,
CompBasedMembraneDesc membraneDesc, ComponentType ct, CompBasedMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) { Object contentDesc, Object source ) {
super(jc,fcscg,membraneDesc,ct,contentDesc); super(jc,fcscg,membraneDesc,ct,contentDesc,source);
} }
@Override @Override
......
...@@ -96,10 +96,10 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator { ...@@ -96,10 +96,10 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
protected InitializerOOCtrlClassGenerator getInitializerClassGenerator( protected InitializerOOCtrlClassGenerator getInitializerClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg, Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg,
SimpleMembraneDesc membraneDesc, ComponentType ct, SimpleMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) { Object contentDesc, Object source ) {
return new InitializerOOCtrlClassGenerator( return new InitializerOOCtrlClassGenerator(
jc,fcscg,membraneDesc,ct,contentDesc); jc,fcscg,membraneDesc,ct,contentDesc,source);
} }
/** /**
......
...@@ -48,9 +48,9 @@ extends org.objectweb.fractal.juliac.opt.oo.InitializerOOCtrlClassGenerator { ...@@ -48,9 +48,9 @@ extends org.objectweb.fractal.juliac.opt.oo.InitializerOOCtrlClassGenerator {
public InitializerOOCtrlClassGenerator( public InitializerOOCtrlClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg, Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg,
SimpleMembraneDesc membraneDesc, ComponentType ct, SimpleMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) { Object contentDesc, Object source ) {
super(jc,fcscg,membraneDesc,ct,contentDesc); super(jc,fcscg,membraneDesc,ct,contentDesc,source);
} }
@Override @Override
......
...@@ -55,18 +55,10 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator { ...@@ -55,18 +55,10 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator {
mloader.put(SCALightComposite.NAME,SCALightComposite.class); 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 @Override
public SimpleMembraneDesc generateMembraneImpl( public SimpleMembraneDesc generateMembraneImpl(
ComponentType ct, String ctrldesc, String contentClassName ) ComponentType ct, String ctrldesc, String contentClassName,
Object source )
throws IOException { throws IOException {
/* /*
...@@ -75,17 +67,17 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator { ...@@ -75,17 +67,17 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator {
*/ */
generateSCAContentControllerImpl(contentClassName); generateSCAContentControllerImpl(contentClassName);
return super.generateMembraneImpl(ct,ctrldesc,contentClassName); return super.generateMembraneImpl(ct,ctrldesc,contentClassName,source);
} }
@Override @Override
protected InitializerOOCtrlClassGenerator getInitializerClassGenerator( protected InitializerOOCtrlClassGenerator getInitializerClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg, Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg,
SimpleMembraneDesc membraneDesc, ComponentType ct, SimpleMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) { Object contentDesc, Object source ) {
return new InitializerOOCtrlClassGenerator( return new InitializerOOCtrlClassGenerator(
jc,fcscg,membraneDesc,ct,contentDesc); jc,fcscg,membraneDesc,ct,contentDesc,source);
} }
......
...@@ -61,9 +61,9 @@ extends org.ow2.frascati.tinfi.opt.oo.InitializerOOCtrlClassGenerator { ...@@ -61,9 +61,9 @@ extends org.ow2.frascati.tinfi.opt.oo.InitializerOOCtrlClassGenerator {
public InitializerOOCtrlClassGenerator( public InitializerOOCtrlClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg, Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg,
SimpleMembraneDesc membraneDesc, ComponentType ct, SimpleMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) { Object contentDesc, Object source ) {
super(jc,fcscg,membraneDesc,ct,contentDesc); super(jc,fcscg,membraneDesc,ct,contentDesc,source);
} }
@Override @Override
......
...@@ -349,7 +349,7 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf { ...@@ -349,7 +349,7 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf {
/* /*
* Generate the Juliac factory class for the component. * 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 * Generate a second factory that extends the previous one and that
......
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