|
| 1 | +/* |
| 2 | + * WARNING: GENERATED FILE - DO NOT EDIT |
| 3 | + * Module: CamelDesigner v0.1.06 |
| 4 | +
|
| 5 | + * This file was generated on 11/30/20 8:06 PM by Modelio Studio. |
| 6 | + */ |
| 7 | +package fr.softeam.toscadesigner.handlers.propertypages; |
| 8 | + |
| 9 | + |
| 10 | +import com.modeliosoft.modelio.javadesigner.annotations.objid; |
| 11 | + |
| 12 | +import fr.softeam.toscadesigner.api.IToscaDesignerPeerModule; |
| 13 | + |
| 14 | +import org.modelio.metamodel.diagrams.ClassDiagram; |
| 15 | +import org.modelio.metamodel.mda.ModuleComponent; |
| 16 | +import org.modelio.metamodel.uml.infrastructure.Dependency; |
| 17 | +import org.modelio.metamodel.uml.infrastructure.Element; |
| 18 | +import org.modelio.metamodel.uml.infrastructure.ModelElement; |
| 19 | +import org.modelio.metamodel.uml.infrastructure.Stereotype; |
| 20 | +import org.modelio.metamodel.uml.statik.Artifact; |
| 21 | +import org.modelio.metamodel.uml.statik.Attribute; |
| 22 | +import org.modelio.metamodel.uml.statik.AttributeLink; |
| 23 | +import org.modelio.metamodel.uml.statik.Class; |
| 24 | +import org.modelio.metamodel.uml.statik.Component; |
| 25 | +import org.modelio.metamodel.uml.statik.Connector; |
| 26 | +import org.modelio.metamodel.uml.statik.DataType; |
| 27 | +import org.modelio.metamodel.uml.statik.Enumeration; |
| 28 | +import org.modelio.metamodel.uml.statik.GeneralClass; |
| 29 | +import org.modelio.metamodel.uml.statik.Instance; |
| 30 | +import org.modelio.metamodel.uml.statik.Package; |
| 31 | +import org.modelio.metamodel.uml.statik.Port; |
| 32 | +import org.modelio.metamodel.visitors.IDefaultInfrastructureVisitor; |
| 33 | +import org.modelio.metamodel.visitors.IDefaultModelVisitor; |
| 34 | +import org.modelio.metamodel.visitors.IInfrastructureVisitor; |
| 35 | + |
| 36 | + |
| 37 | +public class ToscaDesignerPropertyPageFactory { |
| 38 | + private static final PropertyPageVisitor propertyVisitor = new PropertyPageVisitor(); |
| 39 | + |
| 40 | + /** |
| 41 | + * Instantiates the right proxy class the given element. |
| 42 | + * <br/>The model element must be stereotyped by a 'CamelDesigner' module stereotype. |
| 43 | + * <br/>In the other case the method will return <i>null</i>. |
| 44 | + * |
| 45 | + * @param e A model element |
| 46 | + * @return the right proxy or <i>null</i>. |
| 47 | + */ |
| 48 | + @objid ("421d5784-c31b-41f2-8e84-fb05df25016b") |
| 49 | + public static final Object instantiatePropertyPage(final ModelElement e) { |
| 50 | + for (Stereotype s : e.getExtension()) { |
| 51 | + ModuleComponent module = s.getModule(); |
| 52 | + if (module != null && module.getName().equals(IToscaDesignerPeerModule.MODULE_NAME)) { |
| 53 | + return instantiatePropertyPage(e, s.getName()); |
| 54 | + } |
| 55 | + } |
| 56 | + return null; |
| 57 | + } |
| 58 | + |
| 59 | + /** |
| 60 | + * Instantiates the right proxy class the given element with a stereotype name. |
| 61 | + * The stereotype must be one of the 'CamelDesigner' module stereotypes. |
| 62 | + * In the other case the method will return <i>null</i>. |
| 63 | + * |
| 64 | + * @param e A model element. |
| 65 | + * @param stName A stereotype name. |
| 66 | + * @return the right proxy or <i>null</i>. |
| 67 | + */ |
| 68 | + @objid ("33aeb9ea-d643-4b55-8c5b-11c7df82eec4") |
| 69 | + public static final Object instantiatePropertyPage(final Element e, final String stName) { |
| 70 | + propertyVisitor.setStereotype(stName); |
| 71 | + return e.accept(propertyVisitor); |
| 72 | + } |
| 73 | + |
| 74 | + @objid ("18563f46-96b0-4137-bf2c-f82a64e467d9") |
| 75 | + private static class PropertyPageVisitor implements IDefaultModelVisitor, IDefaultInfrastructureVisitor { |
| 76 | + @objid ("8bbd6a2f-ed17-4779-a468-d61617ab0386") |
| 77 | + private String stName; |
| 78 | + |
| 79 | + @objid ("978eac80-3ce0-45b6-ae6f-e6916b1cd570") |
| 80 | + @Override |
| 81 | + public final Object visitGeneralClass(GeneralClass obj) { |
| 82 | + switch (this.stName) { |
| 83 | + default: |
| 84 | + break; |
| 85 | + } |
| 86 | + return IDefaultModelVisitor.super.visitGeneralClass(obj); |
| 87 | + } |
| 88 | + |
| 89 | + @Override |
| 90 | + public final Object visitDependency(Dependency obj) { |
| 91 | + switch (this.stName) { |
| 92 | + default: |
| 93 | + break; |
| 94 | + } |
| 95 | + return IDefaultInfrastructureVisitor.super.visitDependency(obj); |
| 96 | + } |
| 97 | + |
| 98 | + @Override |
| 99 | + public final Object visitComponent(Component obj) { |
| 100 | + switch (this.stName) { |
| 101 | + default: |
| 102 | + break; |
| 103 | + } |
| 104 | + return IDefaultModelVisitor.super.visitComponent(obj); |
| 105 | + } |
| 106 | + |
| 107 | + @Override |
| 108 | + public final Object visitInstance(Instance obj) { |
| 109 | + switch (this.stName) { |
| 110 | + default: |
| 111 | + break; |
| 112 | + } |
| 113 | + return IDefaultModelVisitor.super.visitInstance(obj); |
| 114 | + } |
| 115 | + |
| 116 | + @Override |
| 117 | + public final Object visitClass(Class obj) { |
| 118 | + switch (this.stName) { |
| 119 | + default: |
| 120 | + break; |
| 121 | + } |
| 122 | + return IDefaultModelVisitor.super.visitClass(obj); |
| 123 | + } |
| 124 | + |
| 125 | + @Override |
| 126 | + public final Object visitEnumeration(Enumeration obj) { |
| 127 | + switch (this.stName) { |
| 128 | + default: |
| 129 | + break; |
| 130 | + } |
| 131 | + return IDefaultModelVisitor.super.visitEnumeration(obj); |
| 132 | + } |
| 133 | + |
| 134 | + @Override |
| 135 | + public final Object visitModelElement(ModelElement obj) { |
| 136 | + switch (this.stName) { |
| 137 | + default: |
| 138 | + break; |
| 139 | + } |
| 140 | + return IDefaultInfrastructureVisitor.super.visitModelElement(obj); |
| 141 | + } |
| 142 | + |
| 143 | + @Override |
| 144 | + public final Object visitArtifact(Artifact obj) { |
| 145 | + switch (this.stName) { |
| 146 | + default: |
| 147 | + break; |
| 148 | + } |
| 149 | + return IDefaultModelVisitor.super.visitArtifact(obj); |
| 150 | + } |
| 151 | + |
| 152 | + @Override |
| 153 | + public final Object visitAttribute(Attribute obj) { |
| 154 | + switch (this.stName) { |
| 155 | + default: |
| 156 | + break; |
| 157 | + } |
| 158 | + return IDefaultModelVisitor.super.visitAttribute(obj); |
| 159 | + } |
| 160 | + |
| 161 | + @Override |
| 162 | + public final Object visitAttributeLink(AttributeLink obj) { |
| 163 | + switch (this.stName) { |
| 164 | + default: |
| 165 | + break; |
| 166 | + } |
| 167 | + return IDefaultModelVisitor.super.visitAttributeLink(obj); |
| 168 | + } |
| 169 | + |
| 170 | + @Override |
| 171 | + public final Object visitClassDiagram(ClassDiagram obj) { |
| 172 | + switch (this.stName) { |
| 173 | + default: |
| 174 | + break; |
| 175 | + } |
| 176 | + return IDefaultModelVisitor.super.visitClassDiagram(obj); |
| 177 | + } |
| 178 | + |
| 179 | + @Override |
| 180 | + public final Object visitPackage(Package obj) { |
| 181 | + switch (this.stName) { |
| 182 | + default: |
| 183 | + break; |
| 184 | + } |
| 185 | + return IDefaultModelVisitor.super.visitPackage(obj); |
| 186 | + } |
| 187 | + |
| 188 | + @Override |
| 189 | + public final Object visitConnector(Connector obj) { |
| 190 | + switch (this.stName) { |
| 191 | + default: |
| 192 | + break; |
| 193 | + } |
| 194 | + return IDefaultModelVisitor.super.visitConnector(obj); |
| 195 | + } |
| 196 | + |
| 197 | + @Override |
| 198 | + public final Object visitDataType(DataType obj) { |
| 199 | + switch (this.stName) { |
| 200 | + default: |
| 201 | + break; |
| 202 | + } |
| 203 | + return IDefaultModelVisitor.super.visitDataType(obj); |
| 204 | + } |
| 205 | + |
| 206 | + @Override |
| 207 | + public final Object visitPort(Port obj) { |
| 208 | + switch (this.stName) { |
| 209 | + default: |
| 210 | + break; |
| 211 | + } |
| 212 | + return IDefaultModelVisitor.super.visitPort(obj); |
| 213 | + } |
| 214 | + |
| 215 | + /** |
| 216 | + * Get the visitor to delegate to when a {@link IInfrastructureVisitor} is needed. |
| 217 | + * <p>If null is returned the caller will return null. |
| 218 | + * |
| 219 | + * @return the {@link IInfrastructureVisitor} visitor or <i>null</i>. |
| 220 | + */ |
| 221 | + @objid ("65ba04d7-dcfb-43d5-8619-e88870f03f28") |
| 222 | + @Override |
| 223 | + public IInfrastructureVisitor getInfrastructureVisitor() { |
| 224 | + return this; |
| 225 | + } |
| 226 | + |
| 227 | + @objid ("1dcbce9d-01c0-42b6-89e6-797da0dadd2c") |
| 228 | + public final void setStereotype(final String stName) { |
| 229 | + this.stName = stName; |
| 230 | + } |
| 231 | + |
| 232 | + } |
| 233 | + |
| 234 | +} |
0 commit comments