This is an automated email from the git hooks/post-receive script. New commit to annotated tag v2.0.0-beta-1 in repository jaxx. See https://gitlab.nuiton.org/nuiton/jaxx.git commit 092ed9fc20fee8930c452de63305cb844af03723 Author: Tony Chemit <chemit@codelutin.com> Date: Sat Oct 24 11:34:52 2009 +0000 - Evolution #100: amélioration du design du compilateur - Evolution #99: Améliorer le code généré - Evolution #98: les objets JAXX sont serializable --- .../src/main/java/jaxx/runtime/JAXXObject.java | 3 ++- jaxx-runtime/src/main/java/jaxx/runtime/Util.java | 4 +++- .../java/org/nuiton/jaxx/plugin/GenerateMojo.java | 19 ++++++++++++++----- maven-jaxx-plugin/src/main/resources/log4j.properties | 2 +- .../test/java/org/nuiton/jaxx/plugin/Bug1750Test.java | 3 +-- .../java/org/nuiton/jaxx/plugin/CompilerTest.java | 10 ++++------ .../org/nuiton/jaxx/plugin/CompilerValidatorTest.java | 9 ++++----- .../java/org/nuiton/jaxx/plugin/Evolution74Test.java | 10 ++++------ pom.xml | 2 +- 9 files changed, 34 insertions(+), 28 deletions(-) diff --git a/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java b/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java index 54a03a1..250067b 100644 --- a/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java +++ b/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java @@ -4,13 +4,14 @@ */ package jaxx.runtime; +import java.io.Serializable; import java.util.Map; /** * The <code>JAXXObject</code> interface is implemented by all classes * produced by the JAXX compiler. */ -public interface JAXXObject extends JAXXContext { +public interface JAXXObject extends JAXXContext, Serializable { /** * Retrieves an object defined in an XML tag by its ID. diff --git a/jaxx-runtime/src/main/java/jaxx/runtime/Util.java b/jaxx-runtime/src/main/java/jaxx/runtime/Util.java index 2d8f217..e68aae2 100644 --- a/jaxx-runtime/src/main/java/jaxx/runtime/Util.java +++ b/jaxx-runtime/src/main/java/jaxx/runtime/Util.java @@ -30,7 +30,9 @@ public class Util { public static final String DEFAULT_ICON_PATH = "/icons/"; public static final String DEFAULT_ICON_PATH_PROPERTY = "default.icon.path"; - /** to use log facility, just put in your code: log.info(\"...\"); */ + /** + * Logger + */ static private final Log log = LogFactory.getLog(Util.class); // Maps root objects to lists of event listeners private static Map<Object, WeakReference<List<EventListenerDescriptor>>> eventListeners = new WeakHashMap<Object, WeakReference<List<EventListenerDescriptor>>>(); diff --git a/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java b/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java index 1b866f8..91e7048 100644 --- a/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java +++ b/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java @@ -20,7 +20,7 @@ package org.nuiton.jaxx.plugin; import jaxx.compiler.CompilerConfiguration; import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.JAXXCompilerLaunchor; +import jaxx.compiler.JAXXEngine; import jaxx.compiler.beans.BeanInfoUtil; import jaxx.compiler.decorators.CompiledObjectDecorator; import jaxx.compiler.decorators.HelpRootCompiledObjectDecorator; @@ -297,6 +297,10 @@ public class GenerateMojo extends AbstractJaxxMojo implements CompilerConfigurat * */ protected ClassLoader cl; + /** + * JAXX engine + */ + private JAXXEngine engine; @SuppressWarnings("unchecked") @Override @@ -393,10 +397,11 @@ public class GenerateMojo extends AbstractJaxxMojo implements CompilerConfigurat // force compiler init from here, not in a static block TagManager.reset(verbose); - JAXXCompilerLaunchor launchor; - launchor = JAXXCompilerLaunchor.newLaunchor(src, files, this); - boolean success = launchor.compile(); - getLog().info("Generated " + launchor.getCompilerCount() + " file(s). "); + engine = JAXXEngine.newLaunchor(src, files, this); +// JAXXEngine engine; +// engine = JAXXEngine.newLaunchor(src, files, this); + boolean success = engine.compile(); + getLog().info("Generated " + engine.getCompilerCount() + " file(s). "); if (!success) { throw new MojoExecutionException("Aborting due to errors reported by jaxxc"); @@ -512,6 +517,10 @@ public class GenerateMojo extends AbstractJaxxMojo implements CompilerConfigurat return validatorClass; } + public JAXXEngine getEngine() { + return engine; + } + @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); diff --git a/maven-jaxx-plugin/src/main/resources/log4j.properties b/maven-jaxx-plugin/src/main/resources/log4j.properties index 315f4fb..badba27 100644 --- a/maven-jaxx-plugin/src/main/resources/log4j.properties +++ b/maven-jaxx-plugin/src/main/resources/log4j.properties @@ -6,4 +6,4 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n log4j.logger.org.nuiton.i18n=ERROR -#log4j.logger.jaxx=DEBUG +log4j.logger.jaxx=INFO diff --git a/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java b/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java index 3395019..a8139e5 100644 --- a/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java +++ b/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java @@ -2,7 +2,6 @@ package org.nuiton.jaxx.plugin; import jaxx.runtime.Base64Coder; import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.JAXXCompilerLaunchor; import jaxx.runtime.JAXXObjectDescriptor; import jaxx.runtime.Util; @@ -17,7 +16,7 @@ public class Bug1750Test extends JaxxBaseTest { getMojo().execute(); assertNumberJaxxFiles(1); - JAXXCompiler compiler = JAXXCompilerLaunchor.get().getJAXXCompiler("org.nuiton.jaxx.plugin.Bug1750Test.ComboBox"); + JAXXCompiler compiler = getMojo().getEngine().getJAXXCompiler("org.nuiton.jaxx.plugin.Bug1750Test.ComboBox"); assertNotNull(compiler); JAXXObjectDescriptor descriptor = compiler.getJAXXObjectDescriptor(); diff --git a/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java b/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java index bda7928..37f199b 100644 --- a/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java +++ b/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java @@ -1,7 +1,7 @@ package org.nuiton.jaxx.plugin; import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.JAXXCompilerLaunchor; +import jaxx.compiler.JAXXEngine; import jaxx.runtime.context.DefaultJAXXContext; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.logging.SystemStreamLog; @@ -123,8 +123,8 @@ public class CompilerTest extends JaxxBaseTest { //do nothing } }); - Field fieldCompilers = JAXXCompilerLaunchor.class.getDeclaredField("compilers"); - Field fieldErrorCount = JAXXCompilerLaunchor.class.getDeclaredField("errorCount"); + Field fieldCompilers = JAXXEngine.class.getDeclaredField("compilers"); + Field fieldErrorCount = JAXXEngine.class.getDeclaredField("errorCount"); fieldCompilers.setAccessible(true); fieldErrorCount.setAccessible(true); @@ -141,11 +141,9 @@ public class CompilerTest extends JaxxBaseTest { // ok jaxx compiler failed assertTrue(true); - JAXXCompilerLaunchor launchor = JAXXCompilerLaunchor.get(); + JAXXEngine launchor = mojo.getEngine(); Map<String, JAXXCompiler> compilers = (Map<String, JAXXCompiler>) fieldCompilers.get(launchor); assertEquals(1, compilers.size()); - //JAXXCompiler compiler; - //compiler = compilers.values().iterator().next(); Integer nberrors = (Integer) fieldErrorCount.get(launchor); assertTrue(nberrors != null && nberrors > 0); } diff --git a/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java b/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java index dd0894a..dba524a 100644 --- a/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java +++ b/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java @@ -1,6 +1,6 @@ package org.nuiton.jaxx.plugin; -import jaxx.compiler.JAXXCompilerLaunchor; +import jaxx.compiler.JAXXEngine; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.logging.SystemStreamLog; @@ -49,8 +49,8 @@ public class CompilerValidatorTest extends JaxxBaseTest { //do nothing } }); - Field fieldCompilers = JAXXCompilerLaunchor.class.getDeclaredField("compilers"); - Field fieldErrorCount = JAXXCompilerLaunchor.class.getDeclaredField("errorCount"); + Field fieldCompilers = JAXXEngine.class.getDeclaredField("compilers"); + Field fieldErrorCount = JAXXEngine.class.getDeclaredField("errorCount"); fieldCompilers.setAccessible(true); fieldErrorCount.setAccessible(true); @@ -66,10 +66,9 @@ public class CompilerValidatorTest extends JaxxBaseTest { } catch (MojoExecutionException e) { // ok jaxx compiler failed assertTrue(true); - JAXXCompilerLaunchor launchor = JAXXCompilerLaunchor.get(); + JAXXEngine launchor = mojo.getEngine(); Map<String, Compiler> compilers = (Map<String, Compiler>) fieldCompilers.get(launchor); assertEquals(1, compilers.size()); - //Compiler compiler = compilers.values().iterator().next(); Integer nberrors = (Integer) fieldErrorCount.get(launchor); assertEquals(1, nberrors.intValue()); } diff --git a/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java b/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java index 92d239c..f4e3b9f 100644 --- a/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java +++ b/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java @@ -1,7 +1,7 @@ package org.nuiton.jaxx.plugin; import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.JAXXCompilerLaunchor; +import jaxx.compiler.JAXXEngine; import org.apache.maven.plugin.MojoExecutionException; import java.lang.reflect.Field; @@ -66,8 +66,8 @@ public class Evolution74Test extends JaxxBaseTest { //do nothing } }); - Field fieldCompilers = JAXXCompilerLaunchor.class.getDeclaredField("compilers"); - Field fieldErrorCount = JAXXCompilerLaunchor.class.getDeclaredField("errorCount"); + Field fieldCompilers = JAXXEngine.class.getDeclaredField("compilers"); + Field fieldErrorCount = JAXXEngine.class.getDeclaredField("errorCount"); fieldCompilers.setAccessible(true); fieldErrorCount.setAccessible(true); @@ -85,11 +85,9 @@ public class Evolution74Test extends JaxxBaseTest { // ok jaxx compiler failed assertTrue(true); - JAXXCompilerLaunchor launchor = JAXXCompilerLaunchor.get(); + JAXXEngine launchor = mojo.getEngine(); Map<String, JAXXCompiler> compilers = (Map<String, JAXXCompiler>) fieldCompilers.get(launchor); assertEquals(1, compilers.size()); - //JAXXCompiler compiler; - //compiler = compilers.values().iterator().next(); Integer nberrors = (Integer) fieldErrorCount.get(launchor); assertTrue(nberrors != null && nberrors > 0); } diff --git a/pom.xml b/pom.xml index e7794b8..c6b1fdd 100644 --- a/pom.xml +++ b/pom.xml @@ -342,7 +342,7 @@ <name>JAXX Project</name> <description>JAXX Project</description> <inceptionYear>2008</inceptionYear> - <url>http://maven-site.nuiton.org/jaxx</url> + <url>http://maven-site.nuiton.org/jaxx-2.0</url> <!-- ************************************************************* --> <!-- *** Build Settings ****************************************** --> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.