<%@ jet package="org.eclipse.emf.examples.generator.validator.templates.model" class="ModelDescription" imports="org.eclipse.emf.codegen.ecore.genmodel.* org.eclipse.emf.examples.generator.validator.ValidatorGeneratorUtil"%>
<%GenModel genModel = (GenModel)argument;%>
Model <%=genModel.getModelName()%>

This model description is not a real EMF artifact. It was generated by the
org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's
code generator can be extended.
This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false.

<%if (genModel.getGenPackages().size() > 1) {%>
Contains packages:
  <%for (GenPackage genPackage : genModel.getGenPackages()) {%>
  <%=genPackage.getPackageName()%> <<%=genPackage.getNSURI()%>>
  <%}%>

<%}%>
<%for (GenPackage genPackage : genModel.getGenPackages()) {%>
Package <%=genPackage.getPackageName()%> <<%=genPackage.getNSURI()%>>

  <%for (GenClassifier genClassifier : genPackage.getGenClassifiers()) {%>
    <%if (genClassifier instanceof GenClass) { GenClass genClass = (GenClass)genClassifier;%>
  Class <%=genClass.getName()%><%=ValidatorGeneratorUtil.getSuperTypesExpression(genClass)%>
      <%for (GenFeature genFeature : genClass.getGenFeatures()) {%>
        <%String keyword = genFeature.isReferenceType() ? "Reference" : "Attribute";%>
    <%=keyword%> <%if (genFeature.isDerived()) {%>/<%}%><%=genFeature.getName()%> : <%=ValidatorGeneratorUtil.getTypeExpression(genFeature)%>
      <%}%>
      <%for (GenOperation genOperation : genClass.getGenOperations()) {%>
    Operation <%=genOperation.getName()%><%=ValidatorGeneratorUtil.getParameterExpression(genOperation)%> : <%=ValidatorGeneratorUtil.getTypeExpression(genOperation)%>
      <%}%>

    <%} else if (genClassifier instanceof GenEnum) { GenEnum genEnum = (GenEnum)genClassifier;%>
  Enum <%=genEnum.getName()%>
      <%for (GenEnumLiteral genEnumLiteral : genEnum.getGenEnumLiterals()) {%>
    Literal <%=genEnumLiteral.getName()%> = <%=genEnumLiteral.getValue()%>
      <%}%>

    <%} else if (genClassifier instanceof GenDataType) { GenDataType genDataType = (GenDataType)genClassifier;%>
  DataType <%=genDataType.getName()%> <<%=genDataType.getEcoreDataType().getInstanceClassName()%>>

    <%}%>
  <%}%>
<%}%>