Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
frascati
frascati
Commits
bf0958fc
Commit
bf0958fc
authored
Mar 30, 2017
by
seinturi
Browse files
Add information to link the generate code to its source code element.
parent
64881335
Changes
8
Hide whitespace changes
Inline
Side-by-side
tinfi/extension/osgi/opt/oo/src/main/java/org/ow2/frascati/tinfi/osgi/FCOOCtrlSourceCodeGenerator.java
View file @
bf0958fc
...
...
@@ -66,33 +66,15 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator {
// 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
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
)
{
...
...
tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/FCCompCtrlSourceCodeGenerator.java
View file @
bf0958fc
...
...
@@ -113,10 +113,10 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
getInitializerClassGenerator
(
Juliac
jc
,
FCSourceCodeGeneratorItf
<
CompBasedMembraneDesc
>
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
);
}
/**
...
...
tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/InitializerCompCtrlClassGenerator.java
View file @
bf0958fc
...
...
@@ -47,9 +47,9 @@ extends org.objectweb.fractal.juliac.opt.comp.InitializerCompCtrlClassGenerator
public
InitializerCompCtrlClassGenerator
(
Juliac
jc
,
FCSourceCodeGeneratorItf
<
CompBasedMembraneDesc
>
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
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/FCOOCtrlSourceCodeGenerator.java
View file @
bf0958fc
...
...
@@ -96,10 +96,10 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
protected
InitializerOOCtrlClassGenerator
getInitializerClassGenerator
(
Juliac
jc
,
FCSourceCodeGeneratorItf
<
SimpleMembraneDesc
>
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
);
}
/**
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/InitializerOOCtrlClassGenerator.java
View file @
bf0958fc
...
...
@@ -48,9 +48,9 @@ extends org.objectweb.fractal.juliac.opt.oo.InitializerOOCtrlClassGenerator {
public
InitializerOOCtrlClassGenerator
(
Juliac
jc
,
FCSourceCodeGeneratorItf
<
SimpleMembraneDesc
>
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
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/FCOOCtrlSourceCodeGenerator.java
View file @
bf0958fc
...
...
@@ -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
<
SimpleMembraneDesc
>
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
);
}
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/InitializerOOCtrlClassGenerator.java
View file @
bf0958fc
...
...
@@ -61,9 +61,9 @@ extends org.ow2.frascati.tinfi.opt.oo.InitializerOOCtrlClassGenerator {
public
InitializerOOCtrlClassGenerator
(
Juliac
jc
,
FCSourceCodeGeneratorItf
<
SimpleMembraneDesc
>
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
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/tinfilet/TinfiParserSupportImpl.java
View file @
bf0958fc
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment