Eiffel.model.mustache Maven / Gradle / Ivy
class {{classname}}
inherit
ANY
redefine
out
{{#parent}}
select
out
{{/parent}}
end
{{#parent}}
{{{parent}}}
rename
out as out_{{{parentSchema}}},
is_equal as is_equal_{{{parentSchema}}},
copy as copy_{{{parentSchema}}}
select
is_equal_{{{parentSchema}}},
copy_{{{parentSchema}}}
end
{{/parent}}
feature --Access
{{#vars}}
{{^isInherited}}
{{#isPrimitiveType}}
{{name}}: {{{dataType}}}
{{#description}}-- {{{description}}}{{/description}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{#isContainer}}
{{name}}: detachable {{{datatypeWithEnum}}}
{{#description}}-- {{{description}}}{{/description}}
{{/isContainer}}
{{^isContainer}}
{{name}}: detachable {{{dataType}}}
{{#description}}-- {{{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
out: STRING
--
do
create Result.make_empty
{{#parent}}
Result.append(out_{{{parentSchema}}})
{{/parent}}
Result.append("%Nclass {{classname}}%N")
{{#vars}}
{{^isInherited}}
{{#isListContainer}}
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
{{/isListContainer}}
{{#isMapContainer}}
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
{{/isMapContainer}}
{{^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