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
Line 13: Line 13:
  package <span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/ModelParent/Path"</span>▸</span>;
  package <span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/ModelParent/Path"</span>▸</span>;


<span class="oogtemplatecode">⊏ ➜ this.Imports(current) ⊐</span><span class="oogcontinuation">…</span>
<span class="oogtemplatecode">⊏ ➜ this.Annotations(current) ⊐</span><span class="oogcontinuation">…</span>
public interface <span class="oogexpression">◂<span class="oogpath">‖"Ⓟ/Name"</span>▸</span> <span class="oogcontinuation">…</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="oogindentation">  ⋮</span><span class="oogtemplatecode">⊏ ➜ this.Attributes(current) ⊐</span><span class="oogcontinuation">…</span>
<span class="oogindentation">  ⋮</span><span class="oogtemplatecode">⊏ ➜ this.Operations(current) ⊐</span><span class="oogcontinuation">…</span>
<span class="oogindentation">  ⋮</span><span class="oogcode">«∀(-t:<span class="oogpath">‖"✦/Interaction/Traits"</span>){»</span><span class="oogcontinuation">…</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>
}
<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>
<span class="oogtemplatecode">⊏ Ⓣ Imports(Object current) ⊐</span><span class="oogcontinuation">…</span>
import com.sphenon.basics.context.*;
import com.sphenon.basics.tracking.annotations.*;
<span class="oogcode">«∀(parentpackage:<span class="oogpath">‖"Ⓟ/ModelParent/Packages"</span>){»</span><span class="oogcontinuation">…</span>
<span class="oogcode">«⁇(<span class="oogpath">‖"✦/Dependencies/IsEnclosed"</span>){»</span><span class="oogcontinuation">…</span>
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>
<span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/ModelParent/ExternalImports"</span>){»</span><span class="oogcontinuation">…</span>
import <span class="oogexpression">◂⊙▸</span>;
<span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
<span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/ModelParent/ModelImports"</span>){»</span><span class="oogcontinuation">…</span>
import <span class="oogexpression">◂⊙▸</span>;
<span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
<span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/ExternalImports"</span>){»</span><span class="oogcontinuation">…</span>
import <span class="oogexpression">◂⊙▸</span>;
<span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
<span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/ModelImports"</span>){»</span><span class="oogcontinuation">…</span>
import <span class="oogexpression">◂⊙▸</span>;
<span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
<span class="oogcode">«∀(<span class="oogpath">‖"✦/Dependencies/Imports"</span>){»</span><span class="oogcontinuation">…</span>
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>
<span class="oogtemplatecode">⊏ Ⓣ TemplateDeclaration(Object current) ⊐</span><span class="oogcontinuation">…</span>
<span class="oogcode">« ⇾(⊙,UMLClassTemplate) {
    ¬∅(<span class="oogpath">‖"Ⓟ/TemplateParameters"</span>) {
»</span><span class="oogcontinuation">…</span>
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>
<span class="oogtemplatecode">⊏ Ⓣ Annotations(Object current) ⊐</span><span class="oogcontinuation">…</span>
<span class="oogcode">« Object uml_element = current; »</span><span class="oogcontinuation">…</span>
@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="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>
<span class="oogtemplatecode">⊏ Ⓣ XModelAnnotations(Object current, String property) ⊐</span><span class="oogcontinuation">…</span>
<span class="oogcode">«∃(-code:<span class="oogpath">‖'✦/Annotations/" + property + "'</span>){»</span><span class="oogcontinuation">…</span>
<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>
<span class="oogcomment">⊰ creates the "extends ...." List of the interface                                      ⊱</span><span class="oogcontinuation">…</span>
<span class="oogtemplatecode">⊏ Ⓣ Bases(Object current) ⊐</span><span class="oogcontinuation">…</span>
<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>
<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            ⊱</span><span class="oogcontinuation">…</span>
<span class="oogindentation">      ⋮</span><span class="oogcode">«∀(<span class="oogpath">‖"Ⓟ/Bases"</span>){ ⁇(<span class="oogpath">‖"✦/Generalization/Interface"</span>){ »</span><span class="oogcontinuation">…</span>
<span class="oogindentation">          ⋮</span><span class="oogcode">«if(first){first=false;»</span>
    extends <span class="oogcode">«}else{»</span>,
            <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>
<span class="oogindentation">      ⋮</span><span class="oogcomment">⊰ list of all Bases implicitly specfied via a Stereotype                        ⊱</span><span class="oogcontinuation">…</span>
<span class="oogindentation">      ⋮</span><span class="oogcode">«∀(<span class="oogpath">‖"✦/CoreClasses/InterfaceBases"</span>){»</span><span class="oogcontinuation">…</span>
<span class="oogindentation">          ⋮</span><span class="oogcode">«if(first){first=false;»</span>
    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>
<span class="oogcomment">⊰ Attributes                                                                            ⊱</span><span class="oogcontinuation">…</span>
<span class="oogtemplatecode">⊏ Ⓣ Attributes(Object current) ⊐</span><span class="oogcontinuation">…</span>
<span class="oogindentation">    ⋮</span>// -----------------------------------------------------------------------
<span class="oogindentation">    ⋮</span>// -- Attributes ---------------------------------------------------------
<span class="oogindentation">                ⋮</span><span class="oogcode">«∀(a:<span class="oogpath">‖"Ⓟ/Attributes"</span>){»</span><span class="oogcontinuation">…</span>
<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="oogindentation">    ⋮</span><span class="oogtemplatecode">⊏ ➜ this.XModelAnnotations(a, "InterfaceGet") ⊐</span><span class="oogcontinuation">…</span>
<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);
<span class="oogindentation">                        ⋮</span><span class="oogcode">«¬⁇(-:<span class="oogpath">‖"Ⓟ/IsReadOnly"</span>){»</span><span class="oogcontinuation">…</span>
<span class="oogindentation">                            ⋮</span><span class="oogcode">«∃(-:<span class="oogpath">‖"✦/Logic/DefaultValue"</span>){»</span><span class="oogcontinuation">…</span>
<span class="oogindentation">    ⋮</span><span class="oogtemplatecode">⊏ ➜ this.XModelAnnotations(a, "InterfaceDefault") ⊐</span><span class="oogcontinuation">…</span>
<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="oogindentation">    ⋮</span><span class="oogtemplatecode">⊏ ➜ this.XModelAnnotations(a, "InterfaceSet") ⊐</span><span class="oogcontinuation">…</span>
<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>
<span class="oogindentation">                        ⋮</span><span class="oogcode">«∀(-t:<span class="oogpath">‖"✦/Interaction/Traits"</span>){»</span><span class="oogcontinuation">…</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>
<span class="oogcomment">⊰ chooses either ImplementationType, if given, otherwise Type                            ⊱</span><span class="oogcontinuation">…</span>
<span class="oogtemplatecode">⊏ Ⓣ ImplType(Object current) ⊐</span><span class="oogcontinuation">…</span>
<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>
<span class="oogcomment">⊰ Operations                                                                            ⊱</span><span class="oogcontinuation">…</span>
<span class="oogtemplatecode">⊏ Ⓣ Operations(Object current) ⊐</span><span class="oogcontinuation">…</span>
<span class="oogindentation">    ⋮</span>// -----------------------------------------------------------------------
<span class="oogindentation">    ⋮</span>// -- 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="oogindentation">    ⋮</span><span class="oogtemplatecode">⊏ ➜ this.XModelAnnotations(o, "InterfaceOperation") ⊐</span><span class="oogcontinuation">…</span>
<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>);
<span class="oogindentation">                        ⋮</span><span class="oogcode">«∀(-t:<span class="oogpath">‖"✦/Interaction/Traits"</span>){»</span><span class="oogcontinuation">…</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>

Revision as of 15:20, 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";