Difference between revisions of "Artefact:Template/com/sphenon/ad/adcore/model/templates/JavaInstance"

From OOModels
< Artefact:Template‎ | com‎ | sphenon‎ | ad‎ | adcore‎ | model‎ | templates
Jump to navigationJump to search
 
(5 intermediate revisions by the same user not shown)
Line 9: Line 9:


<div class="code">
<div class="code">
<div class="templatetype">
<span class="oogintro">G-2.0-uml-1.0 -*- coding: utf-8; -*-</span>
G-2.0-uml-1.0 -*- coding: utf-8; -*-
  <span class="oogtemplatecode">⊏ ➜ this.TemplateDeclaration(current) ⊐</span><span class="oogcontinuation">…</span>
</div>
  package <span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/ModelParent/Path"</span>▸</span>;
  <span class="templateinsert">⊏ ➜ this.TemplateDeclaration(current) ⊐</span>…
  package ◂‖"Ⓟ/ModelParent/Path"▸;


  <span class="templateinsert">⊏ ➜ this.Imports(current) ⊐</span>…
  <span class="oogtemplatecode">⊏ ➜ this.Imports(current) ⊐</span><span class="oogcontinuation">…</span>
  <span class="templateinsert">⊏ ➜ this.Annotations(current) ⊐</span>…
  <span class="oogtemplatecode">⊏ ➜ this.Annotations(current) ⊐</span><span class="oogcontinuation">…</span>
  public interface ◂‖"Ⓟ/Name"▸ …
  public interface <span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Name"</span>▸</span> <span class="oogcontinuation">…</span>
    ⋮<span class="templateinsert">⊏ ➜ this.Bases(current) ⊐</span>…
<span class="oogindentation">  ⋮</span><span class="oogtemplatecode">⊏ ➜ this.Bases(current) ⊐</span><span class="oogcontinuation">…</span>
  {
  {
    ⋮«¶("    ")»…
<span class="oogindentation">  ⋮</span><span class="oogcode">«¶("    ")»</span><span class="oogcontinuation">…</span>
    ⋮<span class="templateinsert">⊏ ➜ this.Attributes(current) ⊐</span>…
<span class="oogindentation">  ⋮</span><span class="oogtemplatecode">⊏ ➜ this.Attributes(current) ⊐</span><span class="oogcontinuation">…</span>
    ⋮<span class="templateinsert">⊏ ➜ this.Operations(current) ⊐</span>…
<span class="oogindentation">  ⋮</span><span class="oogtemplatecode">⊏ ➜ this.Operations(current) ⊐</span><span class="oogcontinuation">…</span>
    ⋮«∀(-t:‖"✦/Interaction/Traits"){»…
<span class="oogindentation">  ⋮</span><span class="oogcode">«∀(-t:<span class="oogpath">‖"✦/Interaction/Traits"</span>){»</span><span class="oogcontinuation">…</span>
    ⋮<span class="templateinsert">⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterface_"+t)(uml_class) ⊐</span>…
<span class="oogindentation">  ⋮</span><span class="oogtemplatecode">⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterface_"+t)(uml_class) ⊐</span><span class="oogcontinuation">…</span>
    ⋮«}/∃»…
<span class="oogindentation">  ⋮</span><span class="oogcode">«}/∃»</span><span class="oogcontinuation">…</span>
    ⋮«/¶»…
<span class="oogindentation">  ⋮</span><span class="oogcode">«/¶»</span><span class="oogcontinuation">…</span>
  }
  }


  «∃(-code:‖"✦/LogicImplementation/InterfaceBody"){»◂eval(context, code, current)▸«}/∃»…
  <span class="oogcode">«∃(-code:<span class="oogpath">‖"✦/LogicImplementation/InterfaceBody"</span>){»</span><span class="oogexpression">◂eval(context, code, current)▸</span><span class="oogcode">«}/∃»</span><span class="oogcontinuation">…</span>


  ⊰ ====================================================================================== ⊱…
  <span class="oogcomment">⊰ ====================================================================================== ⊱</span><span class="oogcontinuation">…</span>
  ⊰ ====================================================================================== ⊱…
  <span class="oogcomment">⊰ ====================================================================================== ⊱</span><span class="oogcontinuation">…</span>
  ⊰ ====================================================================================== ⊱…
  <span class="oogcomment">⊰ ====================================================================================== ⊱</span><span class="oogcontinuation">…</span>
  ⊏ Ⓣ Imports(Object current) ⊐…
  <span class="oogtemplatecode">⊏ Ⓣ Imports(Object current) ⊐</span><span class="oogcontinuation">…</span>
  import com.sphenon.basics.context.*;
  import com.sphenon.basics.context.*;
  import com.sphenon.basics.tracking.annotations.*;
  import com.sphenon.basics.tracking.annotations.*;
  «∀(parentpackage:‖"Ⓟ/ModelParent/Packages"){»…
  <span class="oogcode">«∀(parentpackage:<span class="oogpath">‖"Ⓟ/ModelParent/Packages"</span>){»</span><span class="oogcontinuation">…</span>
  «⁇(‖"✦/Dependencies/IsEnclosed"){»…
  <span class="oogcode">«⁇(<span class="oogpath">‖"✦/Dependencies/IsEnclosed"</span>){»</span><span class="oogcontinuation">…</span>
  import ◂‖[parentpackage]"Ⓟ/Path"▸.*;
  import <span class="oogexpression">◂<span class="oogpath">‖[parentpackage]"Ⓟ/Path"</span>▸</span>.*;
  «}/⁇»…
  <span class="oogcode">«}/⁇»</span><span class="oogcontinuation">…</span>
  «}/∀»…
  <span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
«∀(‖"Ⓟ/ModelParent/ExternalImports"){»…
  <span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/ModelParent/ExternalImports"</span>){»</span><span class="oogcontinuation">…</span>
import ◂⊙▸;
  import <span class="oogexpression">◂⊙▸</span>;
«}/∀»…
  <span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
  «∀(‖"Ⓟ/ModelParent/ModelImports"){»…
  <span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/ModelParent/ModelImports"</span>){»</span><span class="oogcontinuation">…</span>
  import ◂⊙▸;
  import <span class="oogexpression">◂⊙▸</span>;
  «}/∀»…
  <span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
  «∀(‖"Ⓟ/ExternalImports"){»…
  <span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/ExternalImports"</span>){»</span><span class="oogcontinuation">…</span>
import ◂⊙▸;
  import <span class="oogexpression">◂⊙▸</span>;
«}/∀»…
  <span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
«∀(‖"Ⓟ/ModelImports"){»…
  <span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/ModelImports"</span>){»</span><span class="oogcontinuation">…</span>
  import ◂⊙▸;
import <span class="oogexpression">◂⊙▸</span>;
  «}/∀»…
<span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
  «∀(‖"✦/Dependencies/Imports"){»…
<span class="oogcode">«∀(<span class="oogpath">‖"✦/Dependencies/Imports"</span>){»</span><span class="oogcontinuation">…</span>
  import ◂⊙▸;
import <span class="oogexpression">◂⊙▸</span>;
  «}/∀»…
<span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
⊏ /Ⓣ ⊐…
<span class="oogtemplatecode">⊏ /Ⓣ ⊐</span><span class="oogcontinuation">…</span>
  ⊰ ====================================================================================== ⊱…
<span class="oogcomment">⊰ ====================================================================================== ⊱</span><span class="oogcontinuation">…</span>
⊏ Ⓣ TemplateDeclaration(Object current) ⊐…
  <span class="oogtemplatecode">⊏ Ⓣ TemplateDeclaration(Object current) ⊐</span><span class="oogcontinuation">…</span>
  « ⇾(⊙,UMLClassTemplate) {
<span class="oogcode">« ⇾(⊙,UMLClassTemplate) {
     ¬∅(‖"Ⓟ/TemplateParameters") {
     ¬∅(<span class="oogpath">‖"Ⓟ/TemplateParameters"</span>) {
  »…
  »</span><span class="oogcontinuation">…</span>
  template⋜«∀(⊙){»«¬➀{»,«}/¬➀»◂⊙▸«}/∀»⋝
  template<span class="oogjavatemplate">⋜<span class="oogcode">«∀(⊙){»</span><span class="oogcode">«¬➀{»</span>,<span class="oogcode">«}/¬➀»</span><span class="oogexpression">◂⊙▸</span><span class="oogcode">«}/∀»</span>⋝</span>
« }/¬∅ }/⇾ »…
  <span class="oogcode">« }/¬∅ }/⇾ »</span><span class="oogcontinuation">…</span>
⊏ /Ⓣ ⊐…
<span class="oogtemplatecode">⊏ /Ⓣ ⊐</span><span class="oogcontinuation">…</span>
  ⊰ ====================================================================================== ⊱…
<span class="oogcomment">⊰ ====================================================================================== ⊱</span><span class="oogcontinuation">…</span>
  ⊏ Ⓣ Annotations(Object current) ⊐…
  <span class="oogtemplatecode">⊏ Ⓣ Annotations(Object current) ⊐</span><span class="oogcontinuation">…</span>
« Object uml_element = current; »…
<span class="oogcode">« Object uml_element = current; »</span><span class="oogcontinuation">…</span>
  @ArtefactOrigin({"com.sphenon.ad.adcore.model.templates.JavaInterface.template"«∃(‖"Accessory/ArtefactOrigin"){»«∀(‖"Ⓟ/Track"){»,"◂⊙▸"«}/∀»«}/∃»})
  @ArtefactOrigin({"com.sphenon.ad.adcore.model.templates.JavaInterface.template"<span class="oogcode">«∃(<span class="oogpath">‖"Accessory/ArtefactOrigin"</span>){»</span><span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/Track"</span>){»</span>,"<span class="oogexpression">◂⊙▸</span>"<span class="oogcode">«}/∀»</span><span class="oogcode">«}/∃»</span>})
<span class="templateinsert">⊏ ➜ this.XModelAnnotations(current, "Interface") ⊐</span>…
<span class="oogtemplatecode">⊏ ➜ this.XModelAnnotations(current, "Interface") ⊐</span><span class="oogcontinuation">…</span>
⊏ /Ⓣ ⊐…
<span class="oogtemplatecode">⊏ /Ⓣ ⊐</span><span class="oogcontinuation">…</span>
⊰ ====================================================================================== ⊱…
<span class="oogcomment">⊰ ====================================================================================== ⊱</span><span class="oogcontinuation">…</span>
⊏ Ⓣ XModelAnnotations(Object current, String property) ⊐…
  <span class="oogtemplatecode">⊏ Ⓣ XModelAnnotations(Object current, String property) ⊐</span><span class="oogcontinuation">…</span>
«∃(-code:‖'✦/Annotations/" + property + "'){»…
  <span class="oogcode">«∃(-code:<span class="oogpath">‖'✦/Annotations/" + property + "'</span>){»</span><span class="oogcontinuation">…</span>
  ◂eval(context, code, current)▸
<span class="oogexpression">◂eval(context, code, current)▸</span>
«}/∃»…
<span class="oogcode">«}/∃»</span><span class="oogcontinuation">…</span>
⊏ /Ⓣ ⊐…
<span class="oogtemplatecode">⊏ /Ⓣ ⊐</span><span class="oogcontinuation">…</span>
  ⊰ ====================================================================================== ⊱…
<span class="oogcomment">⊰ ====================================================================================== ⊱</span><span class="oogcontinuation">…</span>
⊰ creates the "extends ...." List of the interface                                      ⊱…
<span class="oogcomment">⊰ creates the "extends ...." List of the interface                                      ⊱</span><span class="oogcontinuation">…</span>
⊏ Ⓣ Bases(Object current) ⊐…
<span class="oogtemplatecode">⊏ Ⓣ Bases(Object current) ⊐</span><span class="oogcontinuation">…</span>
        ⋮« boolean first = true; »…
<span class="oogindentation">      ⋮</span><span class="oogcode">« boolean first = true; »</span><span class="oogcontinuation">…</span>
        ⋮⊰ ------------------------------------------------------------------------------ ⊱…
<span class="oogindentation">      ⋮</span><span class="oogcomment">⊰ ------------------------------------------------------------------------------ ⊱</span><span class="oogcontinuation">…</span>
        ⋮⊰ list of all Bases directly specfied in the UMLModel
<span class="oogindentation">      ⋮</span><span class="oogcomment">⊰ list of all Bases directly specfied in the UMLModel
          with an additional check if it's not disabled via XModel property            ⊱…
          with an additional check if it's not disabled via XModel property            ⊱</span><span class="oogcontinuation">…</span>
        ⋮«∀(‖"Ⓟ/Bases"){ ⁇(‖"✦/Generalization/Interface"){ »…
  <span class="oogindentation">      ⋮</span><span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/Bases"</span>){ ⁇(<span class="oogpath">‖"✦/Generalization/Interface"</span>){ »</span><span class="oogcontinuation">…</span>
            ⋮«if(first){first=false;»
<span class="oogindentation">          ⋮</span><span class="oogcode">«if(first){first=false;»</span>
    extends «}else{»,
    extends <span class="oogcode">«}else{»</span>,
            «}»◂‖"Ⓟ/Parent/Id"▸
            <span class="oogcode">«}»</span><span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Parent/Id"</span>▸</span>
        ⋮«}/⁇ }/∀»…
<span class="oogindentation">      ⋮</span><span class="oogcode">«}/⁇ }/∀»</span><span class="oogcontinuation">…</span>
        ⋮⊰ ------------------------------------------------------------------------------ ⊱…
<span class="oogindentation">      ⋮</span><span class="oogcomment">⊰ ------------------------------------------------------------------------------ ⊱</span><span class="oogcontinuation">…</span>
        ⋮⊰ list of all Bases implicitly specfied via a Stereotype                        ⊱…
<span class="oogindentation">      ⋮</span><span class="oogcomment">⊰ list of all Bases implicitly specfied via a Stereotype                        ⊱</span><span class="oogcontinuation">…</span>
        ⋮«∀(‖"✦/CoreClasses/InterfaceBases"){»…
<span class="oogindentation">      ⋮</span><span class="oogcode">«∀(<span class="oogpath">‖"✦/CoreClasses/InterfaceBases"</span>){»</span><span class="oogcontinuation">…</span>
            ⋮«if(first){first=false;»
<span class="oogindentation">          ⋮</span><span class="oogcode">«if(first){first=false;»</span>
    extends «}else{»,
    extends <span class="oogcode">«}else{»</span>,
            «}»◂⊙▸
            <span class="oogcode">«}»</span><span class="oogexpression">◂⊙▸</span>
        ⋮«}/∀»…
<span class="oogindentation">      ⋮</span><span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
        ⋮⊰ ------------------------------------------------------------------------------ ⊱…
<span class="oogindentation">      ⋮</span><span class="oogcomment">⊰ ------------------------------------------------------------------------------ ⊱</span><span class="oogcontinuation">…</span>
⊏ /Ⓣ ⊐…
<span class="oogtemplatecode">⊏ /Ⓣ ⊐</span><span class="oogcontinuation">…</span>
  ⊰ ====================================================================================== ⊱…
<span class="oogcomment">⊰ ====================================================================================== ⊱</span><span class="oogcontinuation">…</span>
⊰ Attributes                                                                            ⊱…
<span class="oogcomment">⊰ Attributes                                                                            ⊱</span><span class="oogcontinuation">…</span>
⊏ Ⓣ Attributes(Object current) ⊐…
<span class="oogtemplatecode">⊏ Ⓣ Attributes(Object current) ⊐</span><span class="oogcontinuation">…</span>
    ⋮// -----------------------------------------------------------------------
<span class="oogindentation">    ⋮</span>// -----------------------------------------------------------------------
    ⋮// -- Attributes ---------------------------------------------------------
  <span class="oogindentation">    ⋮</span>// -- Attributes ---------------------------------------------------------
                ⋮«∀(a:‖"Ⓟ/Attributes"){»…
<span class="oogindentation">                ⋮</span><span class="oogcode">«∀(a:<span class="oogpath">‖"Ⓟ/Attributes"</span>){»</span><span class="oogcontinuation">…</span>
                    ⋮« if ("public".equals(‖"Ⓟ/Visibility")) { »…
<span class="oogindentation">                    ⋮</span><span class="oogcode">« if ("public".equals(<span class="oogpath">‖"Ⓟ/Visibility"</span>)) { »</span><span class="oogcontinuation">…</span>
    ⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
<span class="oogindentation">    ⋮</span>// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    ⋮<span class="templateinsert">⊏ ➜ this.XModelAnnotations(a, "InterfaceGet") ⊐</span>…
  <span class="oogindentation">    ⋮</span><span class="oogtemplatecode">⊏ ➜ this.XModelAnnotations(a, "InterfaceGet") ⊐</span><span class="oogcontinuation">…</span>
    ⋮◂‖"Ⓟ/Visibility"▸ ⋖type⋗ get◂‖"Ⓟ/Name"▸ (CallContext context);
  <span class="oogindentation">    ⋮</span><span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Visibility"</span>▸</span> <span class="oogtag">⋖type⋗</span> get<span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Name"</span>▸</span> (CallContext context);
                        ⋮«¬⁇(-:‖"Ⓟ/IsReadOnly"){»…
<span class="oogindentation">                        ⋮</span><span class="oogcode">«¬⁇(-:<span class="oogpath">‖"Ⓟ/IsReadOnly"</span>){»</span><span class="oogcontinuation">…</span>
                            ⋮«∃(-:‖"✦/Logic/DefaultValue"){»…
<span class="oogindentation">                            ⋮</span><span class="oogcode">«∃(-:<span class="oogpath">‖"✦/Logic/DefaultValue"</span>){»</span><span class="oogcontinuation">…</span>
    ⋮<span class="templateinsert">⊏ ➜ this.XModelAnnotations(a, "InterfaceDefault") ⊐</span>…
<span class="oogindentation">    ⋮</span><span class="oogtemplatecode">⊏ ➜ this.XModelAnnotations(a, "InterfaceDefault") ⊐</span><span class="oogcontinuation">…</span>
    ⋮◂‖"Ⓟ/Visibility"▸ <span class="templateinsert">⊏➜this.ImplType(a)⊐</span> default◂‖"Ⓟ/Name"▸ (CallContext context);
<span class="oogindentation">    ⋮</span><span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Visibility"</span>▸</span> <span class="oogtemplatecode">⊏➜this.ImplType(a)⊐</span> default<span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Name"</span>▸</span> (CallContext context);
                            ⋮«}/∃»…
<span class="oogindentation">                            ⋮</span><span class="oogcode">«}/∃»</span><span class="oogcontinuation">…</span>
    ⋮<span class="templateinsert">⊏ ➜ this.XModelAnnotations(a, "InterfaceSet") ⊐</span>…
<span class="oogindentation">    ⋮</span><span class="oogtemplatecode">⊏ ➜ this.XModelAnnotations(a, "InterfaceSet") ⊐</span><span class="oogcontinuation">…</span>
    ⋮◂‖"Ⓟ/Visibility"▸ void set◂‖"Ⓟ/Name"▸ (CallContext context, <span class="templateinsert">⊏➜this.ImplType(a)⊐</span> ◂‖"Ⓟ/Name"⌘MC/LCU/JAVAID▸);
<span class="oogindentation">    ⋮</span><span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Visibility"</span>▸</span> void set<span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Name"</span>▸</span> (CallContext context, <span class="oogtemplatecode">⊏➜this.ImplType(a)⊐</span> <span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Name"</span><span class="oogencoding">⌘MC/LCU/JAVAID</span>▸</span>);
                        ⋮«}/¬⁇»…
<span class="oogindentation">                        ⋮</span><span class="oogcode">«}/¬⁇»</span><span class="oogcontinuation">…</span>
                        ⋮«∀(-t:‖"✦/Interaction/Traits"){»…
<span class="oogindentation">                        ⋮</span><span class="oogcode">«∀(-t:<span class="oogpath">‖"✦/Interaction/Traits"</span>){»</span><span class="oogcontinuation">…</span>
    ⋮<span class="templateinsert">⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterfaceAttribute_"+t)(a) ⊐</span>…
<span class="oogindentation">    ⋮</span><span class="oogtemplatecode">⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterfaceAttribute_"+t)(a) ⊐</span><span class="oogcontinuation">…</span>
                        ⋮«}/∀»…
<span class="oogindentation">                        ⋮</span><span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
                    ⋮«}»…
<span class="oogindentation">                    ⋮</span><span class="oogcode">«}»</span><span class="oogcontinuation">…</span>
                ⋮«}/∀»…
<span class="oogindentation">                ⋮</span><span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
    ⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
<span class="oogindentation">    ⋮</span>// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    ⋮// -----------------------------------------------------------------------
<span class="oogindentation">    ⋮</span>// -----------------------------------------------------------------------
⊏ /Ⓣ ⊐…
<span class="oogtemplatecode">⊏ /Ⓣ ⊐</span><span class="oogcontinuation">…</span>
  ⊰ ====================================================================================== ⊱…
<span class="oogcomment">⊰ ====================================================================================== ⊱</span><span class="oogcontinuation">…</span>
⊰ chooses either ImplementationType, if given, otherwise Type                            ⊱…
<span class="oogcomment">⊰ chooses either ImplementationType, if given, otherwise Type                            ⊱</span><span class="oogcontinuation">…</span>
  ⊏ Ⓣ ImplType(Object current) ⊐…
<span class="oogtemplatecode">⊏ Ⓣ ImplType(Object current) ⊐</span><span class="oogcontinuation">…</span>
  «∃(‖'✦/Logic/ImplementationType'){»◂⊙▸«}}else{{»⋖type⋗«}/∃»…
<span class="oogcode">«∃(<span class="oogpath">‖'✦/Logic/ImplementationType'</span>){»</span><span class="oogexpression">◂⊙▸</span><span class="oogcode">«}}else{{»</span><span class="oogtag">⋖type⋗</span><span class="oogcode">«}/∃»</span><span class="oogcontinuation">…</span>
⊏ /Ⓣ ⊐…
<span class="oogtemplatecode">⊏ /Ⓣ ⊐</span><span class="oogcontinuation">…</span>
⊰ ====================================================================================== ⊱…
<span class="oogcomment">⊰ ====================================================================================== ⊱</span><span class="oogcontinuation">…</span>
⊰ Operations                                                                            ⊱…
<span class="oogcomment">⊰ Operations                                                                            ⊱</span><span class="oogcontinuation">…</span>
⊏ Ⓣ Operations(Object current) ⊐…
<span class="oogtemplatecode">⊏ Ⓣ Operations(Object current) ⊐</span><span class="oogcontinuation">…</span>
    ⋮// -----------------------------------------------------------------------
<span class="oogindentation">    ⋮</span>// -----------------------------------------------------------------------
    ⋮// -- Operations ---------------------------------------------------------
<span class="oogindentation">    ⋮</span>// -- Operations ---------------------------------------------------------
                ⋮«∀(o:‖"Ⓟ/Operations"){»…
<span class="oogindentation">                ⋮</span><span class="oogcode">«∀(o:<span class="oogpath">‖"Ⓟ/Operations"</span>){»</span><span class="oogcontinuation">…</span>
    ⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
<span class="oogindentation">    ⋮</span>// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    ⋮<span class="templateinsert">⊏ ➜ this.XModelAnnotations(o, "InterfaceOperation") ⊐</span>…
<span class="oogindentation">    ⋮</span><span class="oogtemplatecode">⊏ ➜ this.XModelAnnotations(o, "InterfaceOperation") ⊐</span><span class="oogcontinuation">…</span>
    ⋮public ⋖type⋗ ◂‖"Ⓟ/Name"▸ (CallContext context«∀(‖"Ⓟ/Signature/Arguments"){», ⋖type⋗ ◂‖"Ⓟ/Name"⌘MC/LCU/JAVAID▸«}/∀»);
<span class="oogindentation">    ⋮</span>public <span class="oogtag">⋖type⋗</span> <span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Name"</span>▸</span> (CallContext context<span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/Signature/Arguments"</span>){»</span>, <span class="oogtag">⋖type⋗</span> <span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Name"</span><span class="oogencoding">⌘MC/LCU/JAVAID</span>▸</span><span class="oogcode">«}/∀»</span>);
                        ⋮«∀(-t:‖"✦/Interaction/Traits"){»…
<span class="oogindentation">                        ⋮</span><span class="oogcode">«∀(-t:<span class="oogpath">‖"✦/Interaction/Traits"</span>){»</span><span class="oogcontinuation">…</span>
    ⋮<span class="templateinsert">⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterfaceAttribute_"+t)(o) ⊐</span>…
<span class="oogindentation">    ⋮</span><span class="oogtemplatecode">⊏ ➜ ("com.sphenon.ad.adcore.model.templates.InteractionTraitInterfaceAttribute_"+t)(o) ⊐</span><span class="oogcontinuation">…</span>
                        ⋮«}/∀»…
<span class="oogindentation">                        ⋮</span><span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
                ⋮«}/∀»…
<span class="oogindentation">                ⋮</span><span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
    ⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
<span class="oogindentation">    ⋮</span>// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    ⋮// -----------------------------------------------------------------------
<span class="oogindentation">    ⋮</span>// -----------------------------------------------------------------------
⊏ /Ⓣ ⊐…
<span class="oogtemplatecode">⊏ /Ⓣ ⊐</span><span class="oogcontinuation">…</span>
⊰ ====================================================================================== ⊱…
<span class="oogcomment">⊰ ====================================================================================== ⊱</span><span class="oogcontinuation">…</span>
</div>
</div>

Latest revision as of 15:24, 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) ⊐…
                        ⋮«}/∀»…
                ⋮«}/∀»…
    ⋮// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    ⋮// -----------------------------------------------------------------------
⊏ /Ⓣ ⊐…
⊰ ====================================================================================== ⊱…