[comment encoding = UTF-8 /] [** * The documentation of the module interfacesGenerator. */] [module InterfacesGenerator('http://www.eclipse.org/uml2/3.0.0/UML')] [query public getStereotypeValue(arg0 : Element, stereotype : String, value : String) : String = invoke('hl7template.api.generator.UmlServices', 'getStereotypeValue(org.eclipse.uml2.uml.Element, java.lang.String, java.lang.String)', Sequence{arg0, stereotype, value})/] [** * The documentation of the template generateInterface. * @param aClass */] [template public generateInterface(aClass : Class)] [comment @main/] [if (aClass.name<>'DocumentRoot')] [file (aClass.getOriginalClassName() + 'Processor.java', false, 'UTF-8')] package net.ihe.gazelle.hl7templates.api; import org.decor.art.model.*; import org.decor.art.model.DataSetConcept.Implementation; import org.decor.art.model.DataSetConcept.ValueSet; import javax.xml.namespace.QName; import java.util.List; import net.ihe.gazelle.hl7templates.utils.Processor; public interface [aClass.getOriginalClassName()/]Processor extends Processor<[aClass.getOriginalClassName()/]> { [for (attr : Property | aClass.attribute->sortedBy(name))] [if (attr.type.name<>'EFeatureMapEntry')] public void process[attr.name.toUpperFirst()/][attr.addSs()/]([attr.getListOfName()/] [attr.name/][attr.addSs()/]); [/if] [/for] } [/file] [/if] [/template] [template public addSs(prop : Property) post (trim())] [if (prop.upperBound()=-1)] s [/if] [/template] [template public getListOfName(prop : Property) post (trim())] [if (prop.upperBound()=-1)] List<[prop.type.getOriginalClassName()/]> [else] [prop.type.getOriginalClassName()/] [/if] [/template] [template public getOriginalClassName(prop : NamedElement) post (trim())] [let var : String = _getOriginalClassName(prop)] [if (var='ArbitraryProperty')] ArbitraryPropertyType [elseif (var='Example1')] Example [elseif (var='Authority')] AuthorityType [elseif (var='Designation1')] Designation [elseif (var='ValueSet1')] ValueSet [elseif (var='Issue1')] Issue [elseif (var='Transaction1')] Transaction [elseif (var='SelfReferenceTemplateId')] String [elseif (var='DataSetTimeStampPrecision')] String [else] [var/] [/if] [/let] [/template] [template public _getOriginalClassName(aTE : NamedElement) post (trim())] [if (aTE.oclIsKindOf(Class))] [if (aTE.oclAsType(Class)._package.name='DECOR')] [aTE.oclAsType(Class).name.replace('Type', '')/] [/if] [elseif (aTE.oclIsKindOf(Enumeration))] [aTE.name/] [elseif (aTE.oclIsKindOf(DataType))] String [else] [aTE.name/] [/if] [/template]