
header position 0..108
module templateCallMultiLinesWithIndentationWithInlinedStatement
  metamodel http://www.eclipse.org/emf/2002/Ecore (67..105)
  [comment @main  (119..125) /] (110..127)
  
  public template myTemplate(pkg : EPackage (156..177))
  @main
    [file url .add(.aqlFeatureAccess(pkg, 'name'), '.txt') (189..206) mode overwrite
      [for cls : null = .aqlFeatureAccess(pkg, 'eClassifiers') (237..253) (231..253)
        [.generateClassifier(cls) (263..287)/] (newLineNeeded (262..290) (255..294)
      [/for] (224..300)
       (newLineNeeded) (300..301) (219..303)
    [/file] (182..310)
     (newLineNeeded) (310..311) (179..311)
  [/template] (128..322)
  
 * Generates the Python class for the given EClassifier.
 * @param cls the classifier
 * (418..416)
  cls the classifier (395..413)[comment cls the classifier (395..413) /] (395..413)[comment 
 * Generates the Python class for the given EClassifier.
 * @param cls the classifier
 * (418..416) /] (324..418)
  
 * Generates the Python class for the given EClassifier.
 * @param cls the classifier
 * (418..416)
  cls the classifier (395..413)[comment cls the classifier (395..413) /] (395..413)[comment 
 * Generates the Python class for the given EClassifier.
 * @param cls the classifier
 * (418..416) /] (324..418)
  public template generateClassifier(cls : EClassifier (455..479))
    # TODO generateClassifier( (484..510)
    [.aqlFeatureAccess(.eClass(cls), 'name') (511..528)/] (510..530)
    ) (newLineNeeded) (530..532) (481..532)
  [/template] (419..543)
  
 * Generates the Python class for the given EClass.
 * @param cls the class
 * (629..627)
  cls the class (611..624)[comment cls the class (611..624) /] (611..624)[comment 
 * Generates the Python class for the given EClass.
 * @param cls the class
 * (629..627) /] (545..629)
  
 * Generates the Python class for the given EClass.
 * @param cls the class
 * (629..627)
  cls the class (611..624)[comment cls the class (611..624) /] (611..624)[comment 
 * Generates the Python class for the given EClass.
 * @param cls the class
 * (629..627) /] (545..629)
  public template generateClassifier(cls : EClass (666..685))
    class  (690..696)
    [.aqlFeatureAccess(cls, 'name') (697..705)/] (696..707)
    ( (707..708)
    [if .not(->isEmpty(.aqlFeatureAccess(cls, 'eSuperTypes'))) (713..743)
      [->sep(.aqlFeatureAccess(.aqlFeatureAccess(cls, 'eSuperTypes'), 'name'), ', ') (746..777)/] (745..779) (745..779)
    [else]
      EObject (785..792) (785..792)
    [/if] (708..797)
    ): (newLineNeeded) (797..800)
        """ (newLineNeeded) (802..810)
        Java class:  (812..828)
    [.aqlFeatureAccess(cls, 'name') (829..837)/] (newLineNeeded (828..840)
        """ (newLineNeeded) (842..850)
         (852..856)
    [.generateConstructor(cls) (857..882)/] (newLineNeeded (856..885) (687..885)
  [/template] (630..896)
  
 * Generates the Python class constructor for the given EClass.
 * @param cls the class
 * (994..992)
  cls the class (976..989)[comment cls the class (976..989) /] (976..989)[comment 
 * Generates the Python class constructor for the given EClass.
 * @param cls the class
 * (994..992) /] (898..994)
  
 * Generates the Python class constructor for the given EClass.
 * @param cls the class
 * (994..992)
  cls the class (976..989)[comment cls the class (976..989) /] (976..989)[comment 
 * Generates the Python class constructor for the given EClass.
 * @param cls the class
 * (994..992) /] (898..994)
  public template generateConstructor(cls : EClass (1032..1051))
    e_class = get_e_classifier(" (1056..1084)
    [.aqlFeatureAccess(.aqlFeatureAccess(cls, 'ePackage'), 'nsURI') (1085..1103)/] (1084..1105)
    ", " (1105..1109)
    [.aqlFeatureAccess(cls, 'name') (1110..1118)/] (1109..1120)
    ") (newLineNeeded) (1120..1123)
    def __init__(self, java_object = None): (newLineNeeded) (1125..1165)
        if java_object is None: (newLineNeeded) (1167..1195)
            JavaObject.__init__(self, create_e_object_from_e_classifier(self.e_class)) (newLineNeeded) (1197..1280)
        elif isinstance(java_object, CapellaElement): (newLineNeeded) (1282..1332)
            JavaObject.__init__(self, java_object.get_java_object()) (newLineNeeded) (1334..1399)
        elif self.e_class.isInstance(java_object): (newLineNeeded) (1401..1448)
            JavaObject.__init__(self, java_object) (newLineNeeded) (1450..1497)
        else: (newLineNeeded) (1499..1509)
            raise AttributeError("Passed object is not compatible with " + self.__class__.__name__ + ": " + str(java_object)) (newLineNeeded) (1511..1633) (1053..1633)
  [/template] (995..1644) (0..1645)