Author: tchemit Date: 2008-10-18 11:27:58 +0000 (Sat, 18 Oct 2008) New Revision: 973 Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler.java Log: catch runtime execption to add error to report add method to test if a bean was not previously attached to a validator Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler.java =================================================================== --- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler.java 2008-10-18 11:26:34 UTC (rev 972) +++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler.java 2008-10-18 11:27:58 UTC (rev 973) @@ -347,7 +347,13 @@ if (log.isDebugEnabled()) { log.debug(runnable); } - runnable.run(); + try { + runnable.run(); + } catch (Exception e) { + //TC - 20081018 report error and quit + reportError(e.getMessage()); + return; + } } initializers.clear(); } @@ -2085,7 +2091,10 @@ return false; } finally { - reset(); + //TC - 20081018 only reset when no error was detected + if (errorCount==0) { + reset(); + } } } @@ -2210,6 +2219,21 @@ } /** + * Test if a given bean is attached to a validator. + * + * @param beanId the bean to test + * @return <code>true</code> if the given bean is attached to a validator, <code>false</code> otherwise + */ + public boolean isBeanUsedByValidator(String beanId) { + for (CompiledBeanValidator validator : validators) { + if(beanId.equals(validator.getBean())) { + return true; + } + } + return false; + } + + /** * Check that a reference exists in symbol table on second compil pass * * @param tag the current tag
participants (1)
-
tchemit@users.labs.libre-entreprise.org