Difference between revisions of "Artefact:Template/com/sphenon/ad/adcore/model/templates/JavaInstance"
From OOModels
Jump to navigationJump to search
AndreasLeue (talk | contribs) (New page: {{Metabox | Meta_Type = Type:org/oogenerator/Template/2.0 | Meta_Domain = Domain:it/development/formatting | Meta_Category = Type:org/oomodels/wiki/Template | Meta_Maturity = work in...) |
AndreasLeue (talk | contribs) |
||
Line 10: | Line 10: | ||
<div class="code"> | <div class="code"> | ||
<div class="templatetype"> | <div class="templatetype"> | ||
G-2.0-uml-1.0 -*- coding: utf-8; -*- | |||
</div> | </div> | ||
<span class="templateinsert">⊏ ➜ this.TemplateDeclaration(current) ⊐</span>… | |||
package ◂‖"Ⓟ/ModelParent/Path"▸; | package ◂‖"Ⓟ/ModelParent/Path"▸; | ||
< | <span class="templateinsert">⊏ ➜ this.Imports(current) ⊐</span>… | ||
⊏ ➜ this. | <span class="templateinsert">⊏ ➜ this.Annotations(current) ⊐</span>… | ||
</ | |||
public interface ◂‖"Ⓟ/Name"▸ … | public interface ◂‖"Ⓟ/Name"▸ … | ||
< | ⋮<span class="templateinsert">⊏ ➜ this.Bases(current) ⊐</span>… | ||
</ | |||
{ | { | ||
< | ⋮«¶(" ")»… | ||
⋮<span class="templateinsert">⊏ ➜ this.Attributes(current) ⊐</span>… | |||
</ | ⋮<span class="templateinsert">⊏ ➜ this.Operations(current) ⊐</span>… | ||
⋮«∀(-t:‖"✦/Interaction/Traits"){»… | |||
⋮<span class="templateinsert">⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterface_"+t)(uml_class) ⊐</span>… | |||
⋮«}/∃»… | |||
⋮«/¶»… | |||
} | } | ||
< | «∃(-code:‖"✦/LogicImplementation/InterfaceBody"){»◂eval(context, code, current)▸«}/∃»… | ||
⊰ | |||
⊰ ====================================================================================== ⊱… | |||
⊱… | ⊰ ====================================================================================== ⊱… | ||
</ | ⊰ ====================================================================================== ⊱… | ||
⊏ Ⓣ Imports(Object current) ⊐… | |||
import com.sphenon.basics.context.*; | |||
import com.sphenon.basics.tracking.annotations.*; | |||
«∀(parentpackage:‖"Ⓟ/ModelParent/Packages"){»… | |||
«⁇(‖"✦/Dependencies/IsEnclosed"){»… | |||
import ◂‖[parentpackage]"Ⓟ/Path"▸.*; | |||
«}/⁇»… | |||
«}/∀»… | |||
«∀(‖"Ⓟ/ModelParent/ExternalImports"){»… | |||
import ◂⊙▸; | |||
«}/∀»… | |||
«∀(‖"Ⓟ/ModelParent/ModelImports"){»… | |||
import ◂⊙▸; | |||
«}/∀»… | |||
«∀(‖"Ⓟ/ExternalImports"){»… | |||
import ◂⊙▸; | |||
«}/∀»… | |||
«∀(‖"Ⓟ/ModelImports"){»… | |||
import ◂⊙▸; | |||
«}/∀»… | |||
«∀(‖"✦/Dependencies/Imports"){»… | |||
import ◂⊙▸; | |||
«}/∀»… | |||
⊏ /Ⓣ ⊐… | |||
⊰ ====================================================================================== ⊱… | |||
⊏ Ⓣ TemplateDeclaration(Object current) ⊐… | |||
« ⇾(⊙,UMLClassTemplate) { | |||
¬∅(‖"Ⓟ/TemplateParameters") { | |||
»… | |||
template⋜«∀(⊙){»«¬➀{»,«}/¬➀»◂⊙▸«}/∀»⋝ | |||
« }/¬∅ }/⇾ »… | |||
⊏ /Ⓣ ⊐… | |||
⊰ ====================================================================================== ⊱… | |||
⊏ Ⓣ Annotations(Object current) ⊐… | |||
« Object uml_element = current; »… | |||
@ArtefactOrigin({"com.sphenon.ad.adcore.model.templates.JavaInterface.template"«∃(‖"Accessory/ArtefactOrigin"){»«∀(‖"Ⓟ/Track"){»,"◂⊙▸"«}/∀»«}/∃»}) | |||
<span class="templateinsert">⊏ ➜ this.XModelAnnotations(current, "Interface") ⊐</span>… | |||
⊏ /Ⓣ ⊐… | |||
⊰ ====================================================================================== ⊱… | |||
⊏ Ⓣ XModelAnnotations(Object current, String property) ⊐… | |||
«∃(-code:‖'✦/Annotations/" + property + "'){»… | |||
◂eval(context, code, current)▸ | |||
«}/∃»… | |||
⊏ /Ⓣ ⊐… | |||
⊰ ====================================================================================== ⊱… | |||
⊰ creates the "extends ...." List of the interface ⊱… | |||
⊏ Ⓣ Bases(Object current) ⊐… | |||
⋮« boolean first = true; »… | |||
⋮⊰ ------------------------------------------------------------------------------ ⊱… | |||
⋮⊰ list of all Bases directly specfied in the UMLModel | |||
with an additional check if it's not disabled via XModel property ⊱… | |||
⋮«∀(‖"Ⓟ/Bases"){ ⁇(‖"✦/Generalization/Interface"){ »… | |||
⋮«if(first){first=false;» | |||
extends «}else{», | |||
«}»◂‖"Ⓟ/Parent/Id"▸ | |||
⋮«}/⁇ }/∀»… | |||
⋮⊰ ------------------------------------------------------------------------------ ⊱… | |||
⋮⊰ list of all Bases implicitly specfied via a Stereotype ⊱… | |||
⋮«∀(‖"✦/CoreClasses/InterfaceBases"){»… | |||
⋮«if(first){first=false;» | |||
extends «}else{», | |||
«}»◂⊙▸ | |||
⋮«}/∀»… | |||
⋮⊰ ------------------------------------------------------------------------------ ⊱… | |||
⊏ /Ⓣ ⊐… | |||
⊰ ====================================================================================== ⊱… | |||
⊰ Attributes ⊱… | |||
⊏ Ⓣ Attributes(Object current) ⊐… | |||
⋮// ----------------------------------------------------------------------- | |||
⋮// -- Attributes --------------------------------------------------------- | |||
⋮«∀(a:‖"Ⓟ/Attributes"){»… | |||
⋮« if ("public".equals(‖"Ⓟ/Visibility")) { »… | |||
⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | |||
⋮<span class="templateinsert">⊏ ➜ this.XModelAnnotations(a, "InterfaceGet") ⊐</span>… | |||
⋮◂‖"Ⓟ/Visibility"▸ ⋖type⋗ get◂‖"Ⓟ/Name"▸ (CallContext context); | |||
⋮«¬⁇(-:‖"Ⓟ/IsReadOnly"){»… | |||
⋮«∃(-:‖"✦/Logic/DefaultValue"){»… | |||
⋮<span class="templateinsert">⊏ ➜ this.XModelAnnotations(a, "InterfaceDefault") ⊐</span>… | |||
⋮◂‖"Ⓟ/Visibility"▸ <span class="templateinsert">⊏➜this.ImplType(a)⊐</span> default◂‖"Ⓟ/Name"▸ (CallContext context); | |||
⋮«}/∃»… | |||
⋮<span class="templateinsert">⊏ ➜ this.XModelAnnotations(a, "InterfaceSet") ⊐</span>… | |||
⋮◂‖"Ⓟ/Visibility"▸ void set◂‖"Ⓟ/Name"▸ (CallContext context, <span class="templateinsert">⊏➜this.ImplType(a)⊐</span> ◂‖"Ⓟ/Name"⌘MC/LCU/JAVAID▸); | |||
⋮«}/¬⁇»… | |||
⋮«∀(-t:‖"✦/Interaction/Traits"){»… | |||
⋮<span class="templateinsert">⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterfaceAttribute_"+t)(a) ⊐</span>… | |||
⋮«}/∀»… | |||
⋮«}»… | |||
⋮«}/∀»… | |||
⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | |||
⋮// ----------------------------------------------------------------------- | |||
⊏ /Ⓣ ⊐… | |||
⊰ ====================================================================================== ⊱… | |||
⊰ chooses either ImplementationType, if given, otherwise Type ⊱… | |||
⊏ Ⓣ ImplType(Object current) ⊐… | |||
«∃(‖'✦/Logic/ImplementationType'){»◂⊙▸«}}else{{»⋖type⋗«}/∃»… | |||
⊏ /Ⓣ ⊐… | |||
⊰ ====================================================================================== ⊱… | |||
⊰ Operations ⊱… | |||
⊏ Ⓣ Operations(Object current) ⊐… | |||
⋮// ----------------------------------------------------------------------- | |||
⋮// -- Operations --------------------------------------------------------- | |||
⋮«∀(o:‖"Ⓟ/Operations"){»… | |||
⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | |||
⋮<span class="templateinsert">⊏ ➜ this.XModelAnnotations(o, "InterfaceOperation") ⊐</span>… | |||
⋮public ⋖type⋗ ◂‖"Ⓟ/Name"▸ (CallContext context«∀(‖"Ⓟ/Signature/Arguments"){», ⋖type⋗ ◂‖"Ⓟ/Name"⌘MC/LCU/JAVAID▸«}/∀»); | |||
⋮«∀(-t:‖"✦/Interaction/Traits"){»… | |||
⋮<span class="templateinsert">⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterfaceAttribute_"+t)(o) ⊐</span>… | |||
⋮«}/∀»… | |||
⋮«}/∀»… | |||
⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | |||
⋮// ----------------------------------------------------------------------- | |||
⊏ /Ⓣ ⊐… | |||
⊰ ====================================================================================== ⊱… | |||
</div> | </div> |
Revision as of 14:51, 30 June 2008
Classification | |
---|---|
Type | Type:org/oogenerator/Template/2.0 |
Domain | Domain:it/development/formatting |
Category | Type:org/oomodels/wiki/Template |
Maturity | work in progress |
Namespace (more) | |
create new pages |
Code[edit]
G-2.0-uml-1.0 -*- coding: utf-8; -*-
⊏ ➜ this.TemplateDeclaration(current) ⊐…
package ◂‖"Ⓟ/ModelParent/Path"▸;
⊏ ➜ this.Imports(current) ⊐… ⊏ ➜ this.Annotations(current) ⊐… public interface ◂‖"Ⓟ/Name"▸ … ⋮⊏ ➜ this.Bases(current) ⊐… { ⋮«¶(" ")»… ⋮⊏ ➜ this.Attributes(current) ⊐… ⋮⊏ ➜ this.Operations(current) ⊐… ⋮«∀(-t:‖"✦/Interaction/Traits"){»… ⋮⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterface_"+t)(uml_class) ⊐… ⋮«}/∃»… ⋮«/¶»… }
«∃(-code:‖"✦/LogicImplementation/InterfaceBody"){»◂eval(context, code, current)▸«}/∃»…
⊰ ====================================================================================== ⊱… ⊰ ====================================================================================== ⊱… ⊰ ====================================================================================== ⊱… ⊏ Ⓣ Imports(Object current) ⊐… import com.sphenon.basics.context.*; import com.sphenon.basics.tracking.annotations.*; «∀(parentpackage:‖"Ⓟ/ModelParent/Packages"){»… «⁇(‖"✦/Dependencies/IsEnclosed"){»… import ◂‖[parentpackage]"Ⓟ/Path"▸.*; «}/⁇»… «}/∀»… «∀(‖"Ⓟ/ModelParent/ExternalImports"){»… import ◂⊙▸; «}/∀»… «∀(‖"Ⓟ/ModelParent/ModelImports"){»… import ◂⊙▸; «}/∀»… «∀(‖"Ⓟ/ExternalImports"){»… import ◂⊙▸; «}/∀»… «∀(‖"Ⓟ/ModelImports"){»… import ◂⊙▸; «}/∀»… «∀(‖"✦/Dependencies/Imports"){»… import ◂⊙▸; «}/∀»… ⊏ /Ⓣ ⊐… ⊰ ====================================================================================== ⊱… ⊏ Ⓣ TemplateDeclaration(Object current) ⊐… « ⇾(⊙,UMLClassTemplate) { ¬∅(‖"Ⓟ/TemplateParameters") { »… template⋜«∀(⊙){»«¬➀{»,«}/¬➀»◂⊙▸«}/∀»⋝ « }/¬∅ }/⇾ »… ⊏ /Ⓣ ⊐… ⊰ ====================================================================================== ⊱… ⊏ Ⓣ Annotations(Object current) ⊐… « Object uml_element = current; »… @ArtefactOrigin({"com.sphenon.ad.adcore.model.templates.JavaInterface.template"«∃(‖"Accessory/ArtefactOrigin"){»«∀(‖"Ⓟ/Track"){»,"◂⊙▸"«}/∀»«}/∃»}) ⊏ ➜ this.XModelAnnotations(current, "Interface") ⊐… ⊏ /Ⓣ ⊐… ⊰ ====================================================================================== ⊱… ⊏ Ⓣ XModelAnnotations(Object current, String property) ⊐… «∃(-code:‖'✦/Annotations/" + property + "'){»… ◂eval(context, code, current)▸ «}/∃»… ⊏ /Ⓣ ⊐… ⊰ ====================================================================================== ⊱… ⊰ creates the "extends ...." List of the interface ⊱… ⊏ Ⓣ Bases(Object current) ⊐… ⋮« boolean first = true; »… ⋮⊰ ------------------------------------------------------------------------------ ⊱… ⋮⊰ list of all Bases directly specfied in the UMLModel with an additional check if it's not disabled via XModel property ⊱… ⋮«∀(‖"Ⓟ/Bases"){ ⁇(‖"✦/Generalization/Interface"){ »… ⋮«if(first){first=false;» extends «}else{», «}»◂‖"Ⓟ/Parent/Id"▸ ⋮«}/⁇ }/∀»… ⋮⊰ ------------------------------------------------------------------------------ ⊱… ⋮⊰ list of all Bases implicitly specfied via a Stereotype ⊱… ⋮«∀(‖"✦/CoreClasses/InterfaceBases"){»… ⋮«if(first){first=false;» extends «}else{», «}»◂⊙▸ ⋮«}/∀»… ⋮⊰ ------------------------------------------------------------------------------ ⊱… ⊏ /Ⓣ ⊐… ⊰ ====================================================================================== ⊱… ⊰ Attributes ⊱… ⊏ Ⓣ Attributes(Object current) ⊐… ⋮// ----------------------------------------------------------------------- ⋮// -- Attributes --------------------------------------------------------- ⋮«∀(a:‖"Ⓟ/Attributes"){»… ⋮« if ("public".equals(‖"Ⓟ/Visibility")) { »… ⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ⋮⊏ ➜ this.XModelAnnotations(a, "InterfaceGet") ⊐… ⋮◂‖"Ⓟ/Visibility"▸ ⋖type⋗ get◂‖"Ⓟ/Name"▸ (CallContext context); ⋮«¬⁇(-:‖"Ⓟ/IsReadOnly"){»… ⋮«∃(-:‖"✦/Logic/DefaultValue"){»… ⋮⊏ ➜ this.XModelAnnotations(a, "InterfaceDefault") ⊐… ⋮◂‖"Ⓟ/Visibility"▸ ⊏➜this.ImplType(a)⊐ default◂‖"Ⓟ/Name"▸ (CallContext context); ⋮«}/∃»… ⋮⊏ ➜ this.XModelAnnotations(a, "InterfaceSet") ⊐… ⋮◂‖"Ⓟ/Visibility"▸ void set◂‖"Ⓟ/Name"▸ (CallContext context, ⊏➜this.ImplType(a)⊐ ◂‖"Ⓟ/Name"⌘MC/LCU/JAVAID▸); ⋮«}/¬⁇»… ⋮«∀(-t:‖"✦/Interaction/Traits"){»… ⋮⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterfaceAttribute_"+t)(a) ⊐… ⋮«}/∀»… ⋮«}»… ⋮«}/∀»… ⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ⋮// ----------------------------------------------------------------------- ⊏ /Ⓣ ⊐… ⊰ ====================================================================================== ⊱… ⊰ chooses either ImplementationType, if given, otherwise Type ⊱… ⊏ Ⓣ ImplType(Object current) ⊐… «∃(‖'✦/Logic/ImplementationType'){»◂⊙▸«}}else{{»⋖type⋗«}/∃»… ⊏ /Ⓣ ⊐… ⊰ ====================================================================================== ⊱… ⊰ Operations ⊱… ⊏ Ⓣ Operations(Object current) ⊐… ⋮// ----------------------------------------------------------------------- ⋮// -- Operations --------------------------------------------------------- ⋮«∀(o:‖"Ⓟ/Operations"){»… ⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ⋮⊏ ➜ this.XModelAnnotations(o, "InterfaceOperation") ⊐… ⋮public ⋖type⋗ ◂‖"Ⓟ/Name"▸ (CallContext context«∀(‖"Ⓟ/Signature/Arguments"){», ⋖type⋗ ◂‖"Ⓟ/Name"⌘MC/LCU/JAVAID▸«}/∀»); ⋮«∀(-t:‖"✦/Interaction/Traits"){»… ⋮⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterfaceAttribute_"+t)(o) ⊐… ⋮«}/∀»… ⋮«}/∀»… ⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ⋮// ----------------------------------------------------------------------- ⊏ /Ⓣ ⊐… ⊰ ====================================================================================== ⊱…