Author: tchemit Date: 2009-11-27 02:29:37 +0100 (Fri, 27 Nov 2009) New Revision: 1659 Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java Log: - This MUST be a convention in JAXX : all specialized constructor must a second constructor with extra first parameter as parentContext - add toString of FieldDescriptor Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java 2009-11-26 20:41:21 UTC (rev 1658) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java 2009-11-27 01:29:37 UTC (rev 1659) @@ -20,17 +20,14 @@ */ package jaxx.compiler.finalizers; -import jaxx.compiler.JAXXCompilerFinalizer; -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.CompiledObjectDecorator; +import jaxx.compiler.*; import jaxx.compiler.binding.DataBinding; -import jaxx.compiler.EventHandler; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.java.JavaMethod; import jaxx.compiler.java.JavaArgument; import jaxx.compiler.java.JavaField; import jaxx.compiler.java.JavaFile; +import static jaxx.compiler.java.JavaFileGenerator.newField; +import static jaxx.compiler.java.JavaFileGenerator.newMethod; +import jaxx.compiler.java.JavaMethod; import jaxx.compiler.reflect.ClassDescriptor; import jaxx.compiler.reflect.ClassDescriptorLoader; import jaxx.compiler.reflect.FieldDescriptor; @@ -45,8 +42,6 @@ import java.util.List; import java.util.Map; -import static jaxx.compiler.java.JavaFileGenerator.*; - /** * This class is a refactoring of the {@link jaxx.compiler.JAXXCompiler}. * <p/> @@ -525,6 +520,11 @@ String constructorParams = compiler.getRootObject().getConstructorParams(); String eol = JAXXCompiler.getLineSeparator(); if (constructorParams != null) { + if (superclassIsJAXXObject) { + //TODO-TC20091127 This MUST be a convention in JAXX : all specialized constructor must a second + //TODO constructor with extra first parameter as parentContext + constructorParams = "parentContext, " + constructorParams; + } code.append(" super(").append(constructorParams).append(");").append(eol); } else { if (superclassIsJAXXObject) { Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java 2009-11-26 20:41:21 UTC (rev 1658) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java 2009-11-27 01:29:37 UTC (rev 1659) @@ -1,23 +1,23 @@ -/* - * *##% - * JAXX Compiler - * Copyright (C) 2008 - 2009 CodeLutin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * ##%* - */ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 CodeLutin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* + */ package jaxx.compiler.reflect; /** @@ -42,4 +42,9 @@ throw new RuntimeException(e); } } + + @Override + public String toString() { + return super.toString() + " type : [" + type + "]"; + } }