[jaxx] branch develop updated (d8f9bf6 -> e45ddd0)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository jaxx. See http://git.nuiton.org/jaxx.git from d8f9bf6 fixes #3458: Remove the autoCssImport option + renmae treatEFile method new ffa6786 fixes #3469: Use nuiton-converter API instead of nuiton-utils new e45ddd0 fixes #3457: Improve error message when css are not well formed The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit e45ddd0dc24e78f0c92e3673e7a402a4de4526da Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Aug 24 14:32:01 2014 +0200 fixes #3457: Improve error message when css are not well formed commit ffa6786bf6b4385de82476727dc92ad5214ebe59 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Aug 24 14:28:13 2014 +0200 fixes #3469: Use nuiton-converter API instead of nuiton-utils Summary of changes: .../src/main/java/jaxx/compiler/JAXXCompiler.java | 14 +++++++++++--- .../src/main/java/jaxx/compiler/tags/StyleHandler.java | 15 ++++++++++++--- jaxx-widgets/pom.xml | 5 +++++ .../runtime/swing/editor/gis/DmdCoordinateConverter.java | 11 ++++++----- .../runtime/swing/editor/gis/DmsCoordinateConverter.java | 11 ++++++----- ...ils.Converter => org.nuiton.converter.NuitonConverter} | 0 .../swing/editor/gis/DmdCoordinateConverterTest.java | 2 +- .../swing/editor/gis/DmsCoordinateConverterTest.java | 2 +- pom.xml | 6 ++++++ 9 files changed, 48 insertions(+), 18 deletions(-) rename jaxx-widgets/src/main/resources/META-INF/services/{org.apache.commons.beanutils.Converter => org.nuiton.converter.NuitonConverter} (100%) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jaxx. See http://git.nuiton.org/jaxx.git commit ffa6786bf6b4385de82476727dc92ad5214ebe59 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Aug 24 14:28:13 2014 +0200 fixes #3469: Use nuiton-converter API instead of nuiton-utils --- jaxx-widgets/pom.xml | 5 +++++ .../jaxx/runtime/swing/editor/gis/DmdCoordinateConverter.java | 11 ++++++----- .../jaxx/runtime/swing/editor/gis/DmsCoordinateConverter.java | 11 ++++++----- ...anutils.Converter => org.nuiton.converter.NuitonConverter} | 0 .../runtime/swing/editor/gis/DmdCoordinateConverterTest.java | 2 +- .../runtime/swing/editor/gis/DmsCoordinateConverterTest.java | 2 +- pom.xml | 6 ++++++ 7 files changed, 25 insertions(+), 12 deletions(-) diff --git a/jaxx-widgets/pom.xml b/jaxx-widgets/pom.xml index 8c9ae09..531f7a6 100644 --- a/jaxx-widgets/pom.xml +++ b/jaxx-widgets/pom.xml @@ -89,6 +89,11 @@ </dependency> <dependency> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-converter</artifactId> + </dependency> + + <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> </dependency> diff --git a/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverter.java b/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverter.java index bc3b409..05395fd 100644 --- a/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverter.java +++ b/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverter.java @@ -23,8 +23,8 @@ package jaxx.runtime.swing.editor.gis; */ import org.apache.commons.beanutils.ConversionException; -import org.apache.commons.beanutils.Converter; import org.apache.commons.lang3.StringUtils; +import org.nuiton.converter.NuitonConverter; import java.util.regex.Matcher; @@ -36,7 +36,7 @@ import static org.nuiton.i18n.I18n.t; * @author Tony Chemit - chemit@codelutin.com * @since 2.6 */ -public class DmdCoordinateConverter implements Converter { +public class DmdCoordinateConverter implements NuitonConverter<DmdCoordinate> { protected boolean useSign; @@ -51,7 +51,7 @@ public class DmdCoordinateConverter implements Converter { } @Override - public Object convert(Class aClass, Object value) { + public <T> T convert(Class<T> aClass, Object value) { if (!isEnabled(aClass)) { throw new ConversionException( @@ -126,7 +126,7 @@ public class DmdCoordinateConverter implements Converter { StringUtils.leftPad(decimalStr, 2, ' ')); } } - return result; + return aClass.cast(result); } protected boolean isEnabled(Class<?> aClass) { @@ -134,7 +134,8 @@ public class DmdCoordinateConverter implements Converter { DmdCoordinate.class.isAssignableFrom(aClass); } - public Class<?> getType() { + @Override + public Class<DmdCoordinate> getType() { return DmdCoordinate.class; } diff --git a/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverter.java b/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverter.java index 6263f29..1b6814a 100644 --- a/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverter.java +++ b/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverter.java @@ -23,8 +23,8 @@ package jaxx.runtime.swing.editor.gis; */ import org.apache.commons.beanutils.ConversionException; -import org.apache.commons.beanutils.Converter; import org.apache.commons.lang3.StringUtils; +import org.nuiton.converter.NuitonConverter; import java.util.regex.Matcher; @@ -36,7 +36,7 @@ import static org.nuiton.i18n.I18n.t; * @author Tony Chemit - chemit@codelutin.com * @since 2.6 */ -public class DmsCoordinateConverter implements Converter { +public class DmsCoordinateConverter implements NuitonConverter<DmsCoordinate> { protected boolean useSign; @@ -51,7 +51,7 @@ public class DmsCoordinateConverter implements Converter { } @Override - public Object convert(Class aClass, Object value) { + public <T> T convert(Class<T> aClass, Object value) { if (!isEnabled(aClass)) { throw new ConversionException( @@ -126,7 +126,7 @@ public class DmsCoordinateConverter implements Converter { StringUtils.leftPad(secondStr, 2, ' ')); } } - return result; + return aClass.cast(result); } @@ -135,7 +135,8 @@ public class DmsCoordinateConverter implements Converter { DmsCoordinate.class.isAssignableFrom(aClass); } - public Class<?> getType() { + @Override + public Class<DmsCoordinate> getType() { return DmsCoordinate.class; } diff --git a/jaxx-widgets/src/main/resources/META-INF/services/org.apache.commons.beanutils.Converter b/jaxx-widgets/src/main/resources/META-INF/services/org.nuiton.converter.NuitonConverter similarity index 100% rename from jaxx-widgets/src/main/resources/META-INF/services/org.apache.commons.beanutils.Converter rename to jaxx-widgets/src/main/resources/META-INF/services/org.nuiton.converter.NuitonConverter diff --git a/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverterTest.java b/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverterTest.java index 11969eb..e8d58f5 100644 --- a/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverterTest.java +++ b/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverterTest.java @@ -24,7 +24,7 @@ package jaxx.runtime.swing.editor.gis; import org.junit.Assert; import org.junit.Test; -import org.nuiton.util.converter.ConverterUtil; +import org.nuiton.converter.ConverterUtil; /** * Created on 11/25/13. diff --git a/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverterTest.java b/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverterTest.java index a72c128..2f80a08 100644 --- a/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverterTest.java +++ b/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverterTest.java @@ -24,7 +24,7 @@ package jaxx.runtime.swing.editor.gis; import org.junit.Assert; import org.junit.Test; -import org.nuiton.util.converter.ConverterUtil; +import org.nuiton.converter.ConverterUtil; /** * Created on 11/25/13. diff --git a/pom.xml b/pom.xml index 26ed92d..464ac3b 100644 --- a/pom.xml +++ b/pom.xml @@ -246,6 +246,12 @@ <dependency> <groupId>org.nuiton</groupId> + <artifactId>nuiton-converter</artifactId> + <version>1.0</version> + </dependency> + + <dependency> + <groupId>org.nuiton</groupId> <artifactId>nuiton-validator</artifactId> <version>${nuitonValidatorVersion}</version> </dependency> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jaxx. See http://git.nuiton.org/jaxx.git commit e45ddd0dc24e78f0c92e3673e7a402a4de4526da Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Aug 24 14:32:01 2014 +0200 fixes #3457: Improve error message when css are not well formed --- .../src/main/java/jaxx/compiler/JAXXCompiler.java | 14 +++++++++++--- .../src/main/java/jaxx/compiler/tags/StyleHandler.java | 15 ++++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java b/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java index e848a18..9e8c241 100644 --- a/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java +++ b/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java @@ -1003,7 +1003,7 @@ public class JAXXCompiler { if (warnAutoCssImport) { - reportWarning("The css file "+styleFile+" can be automaticly imported since it is named as his jaxx file."); + reportWarning("The css file " + styleFile + " can be automaticly imported since it is named as his jaxx file."); } @@ -1013,8 +1013,16 @@ public class JAXXCompiler { String content = loadFile(styleFile); getSourceFiles().push(styleFile); try { - Stylesheet stylesheet = StylesheetHelper.processStylesheet(content); - registerStylesheet(stylesheet); + Stylesheet style = StylesheetHelper.processStylesheet(content); + registerStylesheet(style); + } catch (CompilerException e) { + String message= "Css file content is not valid :" + styleFile; + if (e instanceof jaxx.compiler.css.parser.ParseException) { + jaxx.compiler.css.parser.ParseException parseException = (jaxx.compiler.css.parser.ParseException) e; + + message += " (line: " + parseException.getLine() + " - col:" + parseException.getColumn() + ") "; + } + reportError(message, e); } finally { // whatever could be result, must pop this source file diff --git a/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java b/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java index c96ce5c..6dfe719 100644 --- a/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java +++ b/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java @@ -88,9 +88,18 @@ public class StyleHandler implements TagHandler { if (source) { compiler.reportError("<style> tag has both a source attribute and an inline stylesheet"); } - Stylesheet stylesheet = - StylesheetHelper.processStylesheet(style.toString()); - compiler.registerStylesheet(stylesheet); + try { + Stylesheet stylesheet = StylesheetHelper.processStylesheet(style.toString()); + compiler.registerStylesheet(stylesheet); + } catch (CompilerException e) { + String message = "Inline Css content is not valid"; + if (e instanceof jaxx.compiler.css.parser.ParseException) { + jaxx.compiler.css.parser.ParseException parseException = (jaxx.compiler.css.parser.ParseException) e; + + message += " (line: " + parseException.getLine() + " - col:" + parseException.getColumn() + ") "; + } + compiler.reportError(message, e); + } } } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm