All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Eiffel.model.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
class {{classname}}

{{#parent}}
inherit
{{/parent}}


{{#parent}}
  {{{parent}}}
     {{^isPrimitiveType}}
      {{^isMap}}
      {{^isArray}}
      rename
          output as out_{{{parentSchema}}}
      end
     {{/isArray}}
     {{/isMap}}
     {{/isPrimitiveType}}
{{/parent}}

feature --Access

{{#vars}}
    {{^isInherited}}
    {{#isPrimitiveType}}
    {{^isContainer}}
    {{name}}: {{{dataType}}}
      {{#description}}-- {{{.}}}{{/description}}
    {{/isContainer}}
    {{/isPrimitiveType}}
    {{#isPrimitiveType}}
    {{#isContainer}}
    {{name}}: detachable {{{datatypeWithEnum}}}
      {{#description}}-- {{{.}}}{{/description}}
    {{/isContainer}}
    {{/isPrimitiveType}}
    {{^isPrimitiveType}}
    {{#isContainer}}
    {{name}}: detachable {{{datatypeWithEnum}}}
      {{#description}}-- {{{.}}}{{/description}}
    {{/isContainer}}
    {{^isContainer}}
    {{name}}: detachable {{{dataType}}}
      {{#description}}-- {{{.}}}{{/description}}
    {{/isContainer}}
    {{/isPrimitiveType}}
    {{/isInherited}}
{{/vars}}

feature -- Change Element

  {{#vars}}
    {{^isInherited}}
    set_{{name}} (a_name: like {{name}})
        -- Set '{{name}}' with 'a_name'.
      do
        {{name}} := a_name
      ensure
        {{name}}_set: {{name}} = a_name
      end

    {{/isInherited}}
  {{/vars}}

 feature -- Status Report

    output: STRING
          -- 
      do
        create Result.make_empty
        {{#parent}}
        Result.append(out_{{{parentSchema}}})
        {{/parent}}
        Result.append("%Nclass {{classname}}%N")
        {{#vars}}
        {{^isInherited}}
        {{#isArray}}
        if attached {{name}} as l_{{name}} then
          across l_{{name}} as ic loop
            Result.append ("%N {{name}}:")
            Result.append (ic.item.out)
            Result.append ("%N")
          end
        end
        {{/isArray}}
        {{#isMap}}
        if attached {{name}} as l_{{name}} then
          Result.append ("%N{{name}}:")
          across l_{{name}} as ic loop
            Result.append ("%N")
            Result.append ("key:")
            Result.append (ic.key.out)
            Result.append (" - ")
            Result.append ("val:")
            Result.append (ic.item.out)
            Result.append ("%N")
          end
        end
        {{/isMap}}
        {{^isContainer}}
        if attached {{name}} as l_{{name}} then
          Result.append ("%N{{name}}:")
          Result.append (l_{{name}}.out)
          Result.append ("%N")
        end
        {{/isContainer}}
        {{/isInherited}}
        {{/vars}}
      end
end




© 2015 - 2024 Weber Informatics LLC | Privacy Policy