Index: topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToEntityDOClassGenerator.java diff -u topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToEntityDOClassGenerator.java:1.25 topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToEntityDOClassGenerator.java:1.26 --- topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToEntityDOClassGenerator.java:1.25 Tue Jun 22 19:01:06 2004 +++ topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToEntityDOClassGenerator.java Wed Jun 30 12:31:53 2004 @@ -119,6 +119,68 @@ } /** + * Ajout de la generation des operations des interfaces de la classe + * car on connait l'implantation des corps de methode puisqu'elles sont + * interdite. + */ + public void generateFromClass(Writer output, ObjectModelClass clazz) + throws IOException { + + // Consider only entities, return immediately if not an entity + if (! Util.isEntity(clazz)) return; + + // ------------- File Header + generatePackageStatement(output, clazz); + + // ------------- Imports + generateImportStatement(output, clazz); + + // ------------- Class start + generateClassDeclaration(output, clazz); +/*{ { +}*/ + + // ------------- Attributes + + // ------------- Accessors + for (Iterator i=clazz.getAttributes().iterator(); i.hasNext();) { + ObjectModelAttribute attribute = (ObjectModelAttribute) i.next(); + generateAttributeDeclaration(output, attribute); + generateGetAttributeAccessor(output, attribute); + generateSetAttributeAccessor(output, attribute); + } + + // ------------- Operations declarations + for(Iterator i=clazz.getOperations().iterator(); i.hasNext();){ + ObjectModelOperation operation = (ObjectModelOperation) i.next(); + generateOperationDeclaration(output, operation); + generateOperationBody(output, operation); + } + + // parcours les operations des interfaces + // si la classe n'implante pas la methode de l'interface, alors + // on l'implante. + for(Iterator i=clazz.getInterfaces().iterator(); i.hasNext();){ + ObjectModelInterface interfacez = (ObjectModelInterface) i.next(); + for(Iterator o=interfacez.getOperations().iterator(); o.hasNext();){ + ObjectModelOperation operation = (ObjectModelOperation) o.next(); + if(!Util.implementOperation(clazz, operation)){ + generateOperationDeclaration(output, operation); + generateOperationBody(output, operation); + } + } + } + + // ---------------- All that framework used + generateOther(output, clazz); +/*{ +} +}*/ + + } + + + /** * Les DO ne sont jamais abstrait car il n'y a pas de methode dessus */ public boolean isAbstract(ObjectModelClass clazz){