Artefact:Template/com/sphenon/ad/adcore/model/templates/JavaInstance
From OOModels
< Artefact:Template | com | sphenon | ad | adcore | model | templates
Jump to navigationJump to search
Revision as of 14:51, 30 June 2008 by AndreasLeue (talk | contribs)
| 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) ⊐…
⋮«}/∀»…
⋮«}/∀»…
⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
⋮// -----------------------------------------------------------------------
⊏ /Ⓣ ⊐…
⊰ ====================================================================================== ⊱…