svn commit: r533692 - /jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/JdbcMessageProvider.java
Author: dflorey Date: Mon Apr 30 03:54:03 2007 New Revision: 533692 URL: http://svn.apache.org/viewvc?view=revrev=533692 Log: Applied patch Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/JdbcMessageProvider.java Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/JdbcMessageProvider.java URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/JdbcMessageProvider.java?view=diffrev=533692r1=533691r2=533692 == --- jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/JdbcMessageProvider.java (original) +++ jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/JdbcMessageProvider.java Mon Apr 30 03:54:03 2007 @@ -3,8 +3,14 @@ import javax.sql.DataSource; import java.util.*; import java.sql.*; +import java.text.MessageFormat; /** + * The codeJdbcMessageProvider/code provides messages stored in a database (or other data source) + * accessible via JDBC. The codeJdbcMessageProvider/code only has support for different languages, + * but if support for country or variant is required one could easily subclass it and override the + * codegetLocale/code method. If codegetLocale/code is overridden, the languageColumn parameter + * (or codejdbc.sql.locale.columncode Map entry) of the constructors may be null, since it will not be used. * @author Mattias Jiderhamn */ public class JdbcMessageProvider implements MessageProvider { @@ -18,6 +24,14 @@ private String languageColumn; +/** + * Create new JDBC codeMessageProvider/code using the provided connection. + * @param conn The connection to use for initialization. + * @param table The name of the table holding the messages + * @param idColumn The name of the column holding the message ID + * @param languageColumn The name of the column containing the ISO-639 language code. + * @throws SQLException If there is an error getting data from the table + */ public JdbcMessageProvider(Connection conn, String table, String idColumn, String languageColumn) throws SQLException { this.idColumn = idColumn; @@ -25,6 +39,15 @@ init(conn, table); } +/** + * Create new JDBC codeMessageProvider/code using a connection from the provided codeDataSource/code. Will + * get a connection from the codeDataSource/code, initialize and then return the connection. + * @param ds The connection to use for initialization. + * @param table The name of the table holding the messages + * @param idColumn The name of the column holding the message ID + * @param languageColumn The name of the column containing the ISO-639 language code. + * @throws SQLException If there is an error getting data from the table + */ public JdbcMessageProvider(DataSource ds, String table, String idColumn, String languageColumn) throws SQLException { this.idColumn = idColumn; @@ -41,9 +64,9 @@ } /** - * Create JDBC MessageProvider from properties in a Map, such - * as a java.util.Properties object. The following are the properties in use, which - * are the same as for JDBCResources of Jakarta Commons Resources + * Create JDBC codeMessageProvider/code from properties in a Map, such + * as a codejava.util.Properties/code object. The following are the properties in use, which + * are the same as for codeJDBCResources/code of Jakarta Commons Resources * jdbc.connect.driver = org.gjt.mm.mysql.Driver * jdbc.connect.url = jdbc:mysql://localhost/resources * jdbc.connect.login= resourcesTest @@ -91,7 +114,9 @@ Locale locale = getLocale(rs); Map entries = new HashMap(); for(int i = 0; i valueColumns.length; i++) { -entries.put(valueColumns[i], rs.getString(valueColumns[i])); +String entry = rs.getString(valueColumns[i]); +if(entry != null) +entries.put(valueColumns[i], entry); } Map localeMap = (Map)locales.get(locale); if(localeMap == null) { // If first record for this Locale @@ -105,7 +130,7 @@ if(stmt != null) stmt.close(); if(rs != null) - rs.close(); +rs.close(); } } @@ -122,7 +147,7 @@ int count = metadata.getColumnCount(); for(int i = 0; i count; i++) { String columnName = metadata.getColumnName(i+1); // (Count from 1) -if(! idColumn.equals(columnName) ! languageColumn.equals(columnName) ) +if(! columnName.equals(idColumn) ! columnName.equals(languageColumn) ) output.add(columnName
svn commit: r533694 - in /jakarta/commons/sandbox/i18n/trunk: ./ src/java/org/apache/commons/i18n/ src/resources/ src/test/ src/test/org/apache/commons/i18n/ xdocs/
Author: dflorey Date: Mon Apr 30 03:55:31 2007 New Revision: 533694 URL: http://svn.apache.org/viewvc?view=revrev=533694 Log: Applied patches from Mattias Jiderhamn. Thanks! Added: jakarta/commons/sandbox/i18n/trunk/src/test/org/apache/commons/i18n/MessageProviderTestBase.java Modified: jakarta/commons/sandbox/i18n/trunk/project.xml jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/XMLMessageProvider.java jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages.properties jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages_de.properties jakarta/commons/sandbox/i18n/trunk/src/test/messageBundle.properties jakarta/commons/sandbox/i18n/trunk/src/test/messageBundle_de.properties jakarta/commons/sandbox/i18n/trunk/src/test/org/apache/commons/i18n/JdbcMessageProviderTest.java jakarta/commons/sandbox/i18n/trunk/src/test/org/apache/commons/i18n/ResourceBundleMessageProviderTest.java jakarta/commons/sandbox/i18n/trunk/src/test/org/apache/commons/i18n/XMLMessageProviderTest.java jakarta/commons/sandbox/i18n/trunk/src/test/testMessages.xml jakarta/commons/sandbox/i18n/trunk/xdocs/examples.xml Modified: jakarta/commons/sandbox/i18n/trunk/project.xml URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/i18n/trunk/project.xml?view=diffrev=533694r1=533693r2=533694 == --- jakarta/commons/sandbox/i18n/trunk/project.xml (original) +++ jakarta/commons/sandbox/i18n/trunk/project.xml Mon Apr 30 03:55:31 2007 @@ -75,6 +75,10 @@ /contributors dependencies +dependency + idcommons-resources/id + version0.1-dev/version +/dependency !-- Please note, these depenencies are needed for unit tests only! -- dependency idhsqldb/id Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/XMLMessageProvider.java URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/XMLMessageProvider.java?view=diffrev=533694r1=533693r2=533694 == --- jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/XMLMessageProvider.java (original) +++ jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/XMLMessageProvider.java Mon Apr 30 03:55:31 2007 @@ -56,9 +56,9 @@ applicationMessages.putAll(parsedMessages); messages.putAll(applicationMessages); } catch (Exception exception) { -// TODO: Fix message without ID - logger.log(Level.SEVERE,I18nUtils.INTERNAL_MESSAGES.getString(I18nUtils.MESSAGE_PARSING_ERROR),exception); -// TODO: Consider throwing exception +String msg = I18nUtils.INTERNAL_MESSAGES.getString(I18nUtils.MESSAGE_PARSING_ERROR); +logger.log(Level.SEVERE,msg,exception); +throw new RuntimeException(msg, exception); } } @@ -85,7 +85,7 @@ } if (message == null ) throw new MessageNotFoundException( MessageFormat.format( - I18nUtils.INTERNAL_MESSAGES.getString(I18nUtils.MESSAGE_NOT_FOUND), + I18nUtils.INTERNAL_MESSAGES.getString(I18nUtils.NO_MESSAGE_ENTRIES_FOUND), new String[] { id })); return message; } Modified: jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages.properties URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages.properties?view=diffrev=533694r1=533693r2=533694 == --- jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages.properties (original) +++ jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages.properties Mon Apr 30 03:55:31 2007 @@ -1,5 +1,4 @@ -messageNotFound=Message with key {0} not found noMessageEntriesFound=No message entries found for bundle with key {0} messageEntryNotFound=Message bundle with key {0} does not contain an entry with key {1} resourceBundleNotFound=Could not find resource bundle with base name {0}, uninstalling it -messageParsingError=Error while parsing message file with id {0} \ No newline at end of file +messageParsingError=Error while parsing message file Modified: jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages_de.properties URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages_de.properties?view=diffrev=533694r1=533693r2=533694 == --- jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages_de.properties (original) +++ jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages_de.properties Mon Apr 30 03:55:31 2007 @@ -1,5 +1,4
svn commit: r178424 - in /jakarta/commons/sandbox/i18n/trunk: ./ src/java/org/apache/commons/i18n/ src/resources/ src/test/ src/test/org/apache/commons/i18n/
Author: dflorey Date: Wed May 25 05:33:45 2005 New Revision: 178424 URL: http://svn.apache.org/viewcvs?rev=178424view=rev Log: (empty) Removed: jakarta/commons/sandbox/i18n/trunk/src/resources/messages.properties jakarta/commons/sandbox/i18n/trunk/src/resources/messages_de.properties jakarta/commons/sandbox/i18n/trunk/src/test/org/apache/commons/i18n/I18nTestSuite.java Modified: jakarta/commons/sandbox/i18n/trunk/build.xml jakarta/commons/sandbox/i18n/trunk/project.xml jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageManager.java jakarta/commons/sandbox/i18n/trunk/src/test/testMessages.xml jakarta/commons/sandbox/i18n/trunk/src/test/variantTestMessages.xml Modified: jakarta/commons/sandbox/i18n/trunk/build.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/build.xml?rev=178424r1=178423r2=178424view=diff == --- jakarta/commons/sandbox/i18n/trunk/build.xml (original) +++ jakarta/commons/sandbox/i18n/trunk/build.xml Wed May 25 05:33:45 2005 @@ -1,105 +1,145 @@ ?xml version=1.0? -!-- !DOCTYPE project SYSTEM project.dtd -- - -!-- - === -WebDAV projector build file - === +!-- + And build script for Jakarta Commons i18n -- project name=commons-i18n default=jar basedir=. - !-- Give user a chance to override without editing this file - (and without typing -D each time it compiles it) -- +!-- Give user a chance to override without editing this file + (and without typing -D each time it compiles it) -- property file=build.properties/ - property file=.ant.properties / +property file=.ant.properties / - property name=debug value=true / - property name=deprecation value=true / - property name=optimize value=true / - - property name=version value=0.3 / - property name=name value=commons-i18n / - !-- - === - Set the properties related to the source tree - === - -- - property name=src.dir value=src / - property name=java.dir value=${src.dir}/java / - property name=lib.dir value=lib / - property name=docs.dir value=doc / - property name=dist.dir value=dist / - - !-- - === - Set the properties for the build area - === - -- - property name=build.dir value=build / - property name=build.classes value=${build.dir}/classes / - property name=build.lib value=${build.dir}/lib / - property name=build.javadocs value=${docs.dir}/javadoc / - - path id=classpath - pathelement location=${build.classes} / - fileset dir=${lib.dir} includes=*.jar / - /path - !-- - === - Prepare the build - === - -- - target name=prepare - tstamp / - mkdir dir=${build.dir} / - mkdir dir=${build.classes} / - mkdir dir=${build.lib} / - /target - !-- - === - Build the code - === - -- - target name=build depends=prepare - javac destdir=${build.classes} debug=${debug} deprecation=${deprecation} optimize=${optimize} - src path=${java.dir} / - classpath refid=classpath / - /javac - /target - - !-- - === - Create the jar - === - -- - target name=jar depends=build - jar jarfile=${build.lib}/${name}-${version}.jar basedir=${build.classes} - include name=org/apache/commons/i18n/** / - /jar - /target - - !-- - === - Cleans up build directories - === - -- - target name=clean - delete dir=${build.dir} / - /target - - target name=clean-javadocs - delete dir=${build.javadocs} / - /target - - target name=scrub depends=clean, clean-javadocs - /target - - !-- - === - Creates
svn commit: r178471 - /jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages.properties /jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages_de.properties
Author: dflorey Date: Wed May 25 09:10:44 2005 New Revision: 178471 URL: http://svn.apache.org/viewcvs?rev=178471view=rev Log: (empty) Added: jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages.properties jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages_de.properties Added: jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages.properties URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages.properties?rev=178471view=auto == --- jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages.properties (added) +++ jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages.properties Wed May 25 09:10:44 2005 @@ -0,0 +1,5 @@ +messageNotFound=Message with key {0} not found +noMessageEntriesFound=No message entries found for bundle with key {0} +messageEntryNotFound=Message bundle with key {0} does not contain an entry with key {1} +resourceBundleNotFound=Could not find resource bundle with base name {0}, uninstalling it +messageParsingError=Error while parsing message file with id {0} \ No newline at end of file Added: jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages_de.properties URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages_de.properties?rev=178471view=auto == --- jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages_de.properties (added) +++ jakarta/commons/sandbox/i18n/trunk/src/resources/i18n-messages_de.properties Wed May 25 09:10:44 2005 @@ -0,0 +1,5 @@ +messageNotFound=Keine Nachricht mit Schlssel {0} gefunden +noMessageEntriesFound=Keine Eintrge fr die Nachricht mit Schlssel {0} gefunden +messageEntryNotFound=Die Nachricht mit Schlssel {0} enthlt keinen Eintrag mit Schlssel {1} +resourceBundleNotFound=bersetzungsdatei mit dem Namen {0} wurde nicht gefunden und wird daher deinstalliert +messageParsingError=Fehler beim Einlesen der bersetzungsdatei mit der ID {0} \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r178484 - in /jakarta/commons/sandbox/contract/trunk: build.xml project.properties project.xml run_example.bat src/java/org/apache/commons/contract/i18n/ParameterBundle.java src/java/org/apache/commons/contract/util/InteractiveMainWrapper.java
Author: dflorey Date: Wed May 25 09:47:29 2005 New Revision: 178484 URL: http://svn.apache.org/viewcvs?rev=178484view=rev Log: (empty) Modified: jakarta/commons/sandbox/contract/trunk/build.xml jakarta/commons/sandbox/contract/trunk/project.properties jakarta/commons/sandbox/contract/trunk/project.xml jakarta/commons/sandbox/contract/trunk/run_example.bat jakarta/commons/sandbox/contract/trunk/src/java/org/apache/commons/contract/i18n/ParameterBundle.java jakarta/commons/sandbox/contract/trunk/src/java/org/apache/commons/contract/util/InteractiveMainWrapper.java Modified: jakarta/commons/sandbox/contract/trunk/build.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/contract/trunk/build.xml?rev=178484r1=178483r2=178484view=diff == --- jakarta/commons/sandbox/contract/trunk/build.xml (original) +++ jakarta/commons/sandbox/contract/trunk/build.xml Wed May 25 09:47:29 2005 @@ -18,7 +18,7 @@ property name=deprecation value=true / property name=optimize value=true / - property name=version value=0.2 / + property name=version value=20050525 / property name=name value=commons-contract / !-- === @@ -96,8 +96,8 @@ /fileset manifest attribute name=Built-By value=Daniel Florey/ - attribute name=Main-Class value=org/apache/commons/contract/example/SimpleMain/ - attribute name=Class-Path value=commons-contract-0.2.jar ../../lib/commons-xmlio-0.1pre.jar ../../lib/commons-i18n-0.2.jar/ + attribute name=Main-Class value=org/apache/commons/contract/example/TestSpeedCalculator/ + attribute name=Class-Path value=commons-contract-20050525.jar ../../lib/commons-i18n-20050525.jar/ /manifest /jar /target Modified: jakarta/commons/sandbox/contract/trunk/project.properties URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/contract/trunk/project.properties?rev=178484r1=178483r2=178484view=diff == --- jakarta/commons/sandbox/contract/trunk/project.properties (original) +++ jakarta/commons/sandbox/contract/trunk/project.properties Wed May 25 09:47:29 2005 @@ -30,5 +30,4 @@ # # Jars set explicity by path. # -maven.jar.commons-i18n = ${basedir}/lib/commons-i18n-0.4.jar -maven.jar.commons-xmlio = ${basedir}/lib/commons-xmlio-0.1pre.jar +maven.jar.commons-i18n = ${basedir}/lib/commons-i18n-20050525.jar \ No newline at end of file Modified: jakarta/commons/sandbox/contract/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/contract/trunk/project.xml?rev=178484r1=178483r2=178484view=diff == --- jakarta/commons/sandbox/contract/trunk/project.xml (original) +++ jakarta/commons/sandbox/contract/trunk/project.xml Wed May 25 09:47:29 2005 @@ -10,7 +10,7 @@ shortDescriptionCommons Contract/shortDescription descriptionContract based programming/description - currentVersion0.2/currentVersion + currentVersion20050525/currentVersion versions /versions branches @@ -42,11 +42,7 @@ dependencies dependency idcommons-i18n/id - version0.4/version -/dependency -dependency - idcommons-xmlio/id - version0.1pre/version + version20050525/version /dependency /dependencies Modified: jakarta/commons/sandbox/contract/trunk/run_example.bat URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/contract/trunk/run_example.bat?rev=178484r1=178483r2=178484view=diff == Binary files - no diff available. Modified: jakarta/commons/sandbox/contract/trunk/src/java/org/apache/commons/contract/i18n/ParameterBundle.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/contract/trunk/src/java/org/apache/commons/contract/i18n/ParameterBundle.java?rev=178484r1=178483r2=178484view=diff == --- jakarta/commons/sandbox/contract/trunk/src/java/org/apache/commons/contract/i18n/ParameterBundle.java (original) +++ jakarta/commons/sandbox/contract/trunk/src/java/org/apache/commons/contract/i18n/ParameterBundle.java Wed May 25 09:47:29 2005 @@ -20,19 +20,11 @@ super(messageId, arguments); } -public String getPrompt() { -return getEntry(PROMPT, Locale.getDefault()); -} - public String getPrompt(Locale locale) { return getEntry(PROMPT, locale); } -public String getPrompt(String
svn commit: r178485 - /jakarta/commons/sandbox/i18n/trunk/project.xml
Author: dflorey Date: Wed May 25 09:49:02 2005 New Revision: 178485 URL: http://svn.apache.org/viewcvs?rev=178485view=rev Log: (empty) Modified: jakarta/commons/sandbox/i18n/trunk/project.xml Modified: jakarta/commons/sandbox/i18n/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/project.xml?rev=178485r1=178484r2=178485view=diff == --- jakarta/commons/sandbox/i18n/trunk/project.xml (original) +++ jakarta/commons/sandbox/i18n/trunk/project.xml Wed May 25 09:49:02 2005 @@ -33,7 +33,7 @@ descriptionInternationalization package/description siteAddresscvs.apache.org/siteAddress -currentVersion20050221/currentVersion +currentVersion20050525/currentVersion versions /versions branches - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r168590 - in /jakarta/commons/sandbox/i18n/trunk: ./ src/examples/org/apache/i18n/examples/ src/java/org/apache/commons/i18n/ src/java/org/apache/commons/i18n/bundles/ src/test/org/apache/commons/i18n/ xdocs/
Author: dflorey Date: Fri May 6 03:36:38 2005 New Revision: 168590 URL: http://svn.apache.org/viewcvs?rev=168590view=rev Log: Incorporated changes proposed by Mattias J Removed: jakarta/commons/sandbox/i18n/trunk/src/test/org/apache/commons/i18n/ jakarta/commons/sandbox/i18n/trunk/xdocs/downloads.xml Modified: jakarta/commons/sandbox/i18n/trunk/project.properties jakarta/commons/sandbox/i18n/trunk/project.xml jakarta/commons/sandbox/i18n/trunk/src/examples/org/apache/i18n/examples/LocalizedExceptionExample.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedBundle.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageManager.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/ResourceBundleMessageProvider.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/XMLMessageProvider.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/bundles/ErrorBundle.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/bundles/MessageBundle.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/bundles/TextBundle.java jakarta/commons/sandbox/i18n/trunk/xdocs/index.xml Modified: jakarta/commons/sandbox/i18n/trunk/project.properties URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/project.properties?rev=168590r1=168589r2=168590view=diff == --- jakarta/commons/sandbox/i18n/trunk/project.properties (original) +++ jakarta/commons/sandbox/i18n/trunk/project.properties Fri May 6 03:36:38 2005 @@ -21,8 +21,9 @@ maven.xdoc.version=${pom.currentVersion} maven.xdoc.developmentProcessUrl=http://jakarta.apache.org/commons/charter.html maven.xdoc.includeProjectDocumentation=yes -maven.xdoc.distributionUrl=http://www.apache.org/dist/java-repository/commons-i18n/distributions +maven.xdoc.distributionUrl=http://cvs.apache.org/repository/commons-i18n/distributions maven.xdoc.distributionType=zip + # # M A V E N J A R O V E R R I D E # Modified: jakarta/commons/sandbox/i18n/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/project.xml?rev=168590r1=168589r2=168590view=diff == --- jakarta/commons/sandbox/i18n/trunk/project.xml (original) +++ jakarta/commons/sandbox/i18n/trunk/project.xml Fri May 6 03:36:38 2005 @@ -31,17 +31,10 @@ packageorg.apache.commons.i18n/package shortDescriptionCommons I18n/shortDescription descriptionInternationalization package/description + siteAddresscvs.apache.org/siteAddress - currentVersion0.4/currentVersion + currentVersion20050221/currentVersion versions - version - id1/id - name0.4/name - /version - version - id2/id - name0.3/name - /version /versions branches /branches @@ -70,6 +63,10 @@ /developers contributors +contributor + nameMattias Jiderhamn/name + email[EMAIL PROTECTED]/email +/contributor contributor nameAnaximandro (Woody)/name email[EMAIL PROTECTED]/email Modified: jakarta/commons/sandbox/i18n/trunk/src/examples/org/apache/i18n/examples/LocalizedExceptionExample.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/examples/org/apache/i18n/examples/LocalizedExceptionExample.java?rev=168590r1=168589r2=168590view=diff == --- jakarta/commons/sandbox/i18n/trunk/src/examples/org/apache/i18n/examples/LocalizedExceptionExample.java (original) +++ jakarta/commons/sandbox/i18n/trunk/src/examples/org/apache/i18n/examples/LocalizedExceptionExample.java Fri May 6 03:36:38 2005 @@ -1,22 +1,22 @@ /* -* -* -* -* Copyright 2004 The Apache Software Foundation -* -* Licensed under the Apache License, Version 2.0 (the License); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an AS IS BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -*/ + * + * + * + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the License
svn commit: r154027 - in jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n: ./ bundles/
Author: dflorey Date: Wed Feb 16 07:14:17 2005 New Revision: 154027 URL: http://svn.apache.org/viewcvs?view=revrev=154027 Log: (empty) Added: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedRuntimeException.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/bundles/ jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/bundles/ErrorBundle.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/bundles/MessageBundle.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/bundles/TextBundle.java Removed: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedMessage.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedText.java Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageManager.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/ResourceBundleMessageProvider.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/XMLMessageProvider.java Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java?view=diffr1=154026r2=154027 == --- jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java (original) +++ jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java Wed Feb 16 07:14:17 2005 @@ -22,22 +22,29 @@ */ package org.apache.commons.i18n; +import java.text.MessageFormat; import java.util.Locale; +import org.apache.commons.i18n.bundles.ErrorBundle; + public class LocalizedException extends Exception { -private LocalizedError errorMessage; +private ErrorBundle errorMessage; -public LocalizedException(LocalizedError errorMessage, Throwable throwable) { +public LocalizedException(ErrorBundle errorMessage, Throwable throwable) { super(errorMessage.getSummary(Locale.getDefault(), throwable.getMessage()), throwable); this.errorMessage = errorMessage; } -public LocalizedException(LocalizedError errorMessage) { -super(errorMessage.getSummary(Locale.getDefault(), no message available)); +public LocalizedException(ErrorBundle errorMessage) { +super(errorMessage.getSummary( +Locale.getDefault(), +MessageFormat.format( + MessageManager.INTERNAL_MESSAGES.getString(MessageManager.MESSAGE_ENTRY_NOT_FOUND), +new String[] { errorMessage.getId(), ErrorBundle.SUMMARY }))); this.errorMessage = errorMessage; } -public LocalizedError getErrorMessage() { +public ErrorBundle getErrorMessage() { return errorMessage; } } Added: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedRuntimeException.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedRuntimeException.java?view=autorev=154027 == --- jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedRuntimeException.java (added) +++ jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedRuntimeException.java Wed Feb 16 07:14:17 2005 @@ -0,0 +1,50 @@ +/* + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons-sandbox//i18n/src/java/org/apache/commons/i18n/LocalizedException.java,v 1.1 2004/10/04 13:41:09 dflorey Exp $ + * $Revision: 1.1 $ + * $Date: 2005-02-14 20:03:07 +0100 (Mo, 14 Feb 2005) $ + * + * + * + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.commons.i18n; + +import java.text.MessageFormat; +import java.util.Locale; + +import org.apache.commons.i18n.bundles.ErrorBundle; + +public class
svn commit: r154028 - jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java
Author: dflorey Date: Wed Feb 16 07:15:00 2005 New Revision: 154028 URL: http://svn.apache.org/viewcvs?view=revrev=154028 Log: Added Localized errors and exception + refactoring Added: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java Added: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java?view=autorev=154028 == --- jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java (added) +++ jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java Wed Feb 16 07:15:00 2005 @@ -0,0 +1,50 @@ +/* + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons-sandbox//i18n/src/java/org/apache/commons/i18n/LocalizedException.java,v 1.1 2004/10/04 13:41:09 dflorey Exp $ + * $Revision: 1.1 $ + * $Date: 2005-02-14 20:03:07 +0100 (Mo, 14 Feb 2005) $ + * + * + * + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.commons.i18n; + +import java.text.MessageFormat; +import java.util.Locale; + +import org.apache.commons.i18n.bundles.ErrorBundle; + +public class LocalizedError extends Error { +private ErrorBundle errorMessage; + +public LocalizedError(ErrorBundle errorMessage, Throwable throwable) { +super(errorMessage.getSummary(Locale.getDefault(), throwable.getMessage()), throwable); +this.errorMessage = errorMessage; +} + +public LocalizedError(ErrorBundle errorMessage) { +super(errorMessage.getSummary( +Locale.getDefault(), +MessageFormat.format( + MessageManager.INTERNAL_MESSAGES.getString(MessageManager.MESSAGE_ENTRY_NOT_FOUND), +new String[] { errorMessage.getId(), ErrorBundle.SUMMARY }))); +this.errorMessage = errorMessage; +} + +public ErrorBundle getErrorMessage() { +return errorMessage; +} +} \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r154031 - jakarta/commons/sandbox/i18n/trunk/project.xml
Author: dflorey Date: Wed Feb 16 07:22:16 2005 New Revision: 154031 URL: http://svn.apache.org/viewcvs?view=revrev=154031 Log: Added Localized errors and exception + refactoring Modified: jakarta/commons/sandbox/i18n/trunk/project.xml Modified: jakarta/commons/sandbox/i18n/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/project.xml?view=diffr1=154030r2=154031 == --- jakarta/commons/sandbox/i18n/trunk/project.xml (original) +++ jakarta/commons/sandbox/i18n/trunk/project.xml Wed Feb 16 07:22:16 2005 @@ -32,10 +32,14 @@ shortDescriptionCommons I18n/shortDescription descriptionInternationalization package/description - currentVersion0.3/currentVersion + currentVersion0.4/currentVersion versions version id1/id + name0.4/name + /version + version + id2/id name0.3/name /version /versions @@ -85,13 +89,18 @@ includes include**/*Test.java/include /includes -resources + resources +resource + directory${basedir}/src/test/directory +/resource + /resources +/unitTest + + resources resource -directory${basedir}/src/test/directory +directory${basedir}/src/resources/directory /resource /resources - -/unitTest /build reports - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r153937 - jakarta/commons/sandbox/i18n/trunk/project.properties jakarta/commons/sandbox/i18n/trunk/project.xml
Author: dflorey Date: Tue Feb 15 06:38:33 2005 New Revision: 153937 URL: http://svn.apache.org/viewcvs?view=revrev=153937 Log: Added JUnit-Test infrastructure Modified: jakarta/commons/sandbox/i18n/trunk/project.properties jakarta/commons/sandbox/i18n/trunk/project.xml Modified: jakarta/commons/sandbox/i18n/trunk/project.properties URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/project.properties?view=diffr1=153936r2=153937 == --- jakarta/commons/sandbox/i18n/trunk/project.properties (original) +++ jakarta/commons/sandbox/i18n/trunk/project.properties Tue Feb 15 06:38:33 2005 @@ -27,8 +27,3 @@ # M A V E N J A R O V E R R I D E # maven.jar.override = on - -# -# Jars set explicity by path. -# -maven.jar.commons-xmlio = ${basedir}/lib/commons-xmlio-0.1pre.jar Modified: jakarta/commons/sandbox/i18n/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/project.xml?view=diffr1=153936r2=153937 == --- jakarta/commons/sandbox/i18n/trunk/project.xml (original) +++ jakarta/commons/sandbox/i18n/trunk/project.xml Tue Feb 15 06:38:33 2005 @@ -32,7 +32,7 @@ shortDescriptionCommons I18n/shortDescription descriptionInternationalization package/description - currentVersion0.2/currentVersion + currentVersion0.3/currentVersion versions version id1/id @@ -73,15 +73,25 @@ /contributors dependencies -dependency - idcommons-xmlio/id - version0.1pre/version -/dependency /dependencies build nagEmailAddresscommons-dev@jakarta.apache.org/nagEmailAddress sourceDirectorysrc/java/sourceDirectory +unitTestSourceDirectorysrc/test/unitTestSourceDirectory + +!-- Unit test cases -- +unitTest + includes +include**/*Test.java/include + /includes +resources + resource +directory${basedir}/src/test/directory + /resource +/resources + +/unitTest /build reports - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r153822 - in jakarta/commons/sandbox/i18n/trunk/xdocs: navigation.xml quickstart.xml
Author: dflorey Date: Mon Feb 14 10:22:59 2005 New Revision: 153822 URL: http://svn.apache.org/viewcvs?view=revrev=153822 Log: Added download page generation Modified: jakarta/commons/sandbox/i18n/trunk/xdocs/navigation.xml jakarta/commons/sandbox/i18n/trunk/xdocs/quickstart.xml Modified: jakarta/commons/sandbox/i18n/trunk/xdocs/navigation.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/xdocs/navigation.xml?view=diffr1=153821r2=153822 == --- jakarta/commons/sandbox/i18n/trunk/xdocs/navigation.xml (original) +++ jakarta/commons/sandbox/i18n/trunk/xdocs/navigation.xml Mon Feb 14 10:22:59 2005 @@ -6,8 +6,6 @@ menu name=Commons#xA0;I18n item name=Overview href=/index.html / item name=Getting started href=/quickstart.html / -item name=API#xA0;Documentation href=/apidocs/index.html/ -item name=Downloads href=/downloads.html/ /menu common-menus; /body Modified: jakarta/commons/sandbox/i18n/trunk/xdocs/quickstart.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/xdocs/quickstart.xml?view=diffr1=153821r2=153822 == --- jakarta/commons/sandbox/i18n/trunk/xdocs/quickstart.xml (original) +++ jakarta/commons/sandbox/i18n/trunk/xdocs/quickstart.xml Mon Feb 14 10:22:59 2005 @@ -15,39 +15,6 @@ pTo get started you need at least the jar of this component and the dependent codexmlio-x.x.jar/code for reading xml documents in your classpath./p /section -section name=NEW: Pluggable message providers -pSince version 0.3 of this component you can add your own custom message providers./p -pThis is a big plus if you already have your localized messages in a database for example. - You do not have to convert them into the supported XML or property-based format, but you - can write a simple codeMessageProvider/code by implementing a single method and plug it in./p -/section -section name=NEW: ResourceBundle based message provider added - pA new message provider made it into this component: The codeResourceBundleMessageProvider/code. - This one enables you to keep your property files that may contain localized messages./p - pYou can group entries messages by adding the key at the end of the existing message key. The - following example shows how a property file should look like to work as the following XML example:/p -pAs you know you'll need two files, each containing the messages for a specific locale. This one might be - the default one calld myMessages.properties:/p - source -welcome.text=Welcome -usage.title=Usage -usage.text=The application requires the following parameters: -validationFailed.title=Parameter {0} invalid -validationFailed.text=The given value of the parameter {0} is invalid -validationFailed.summary=Value of parameter {0} invalid -validationFailed.details=The given value {1} of parameter {0} is invalid. -/source -pThe following one would contain the corresponding german translations in a file called myMessages_de.properties:/p - source -welcome.text=Willkommen -usage.title=Benutzung -usage.text=Die folgenden Parameter werden erwartet: -validationFailed.title=Parametervalidierung fehlgeschlagen. -validationFailed.text=Die Validierung des Parameters {0} ist fehlgeschlagen. -validationFailed.summary=Validierung des Parameters {0} fehlgeschlagen. -validationFailed.details=Der Wert {1} des Parameters {0} ist ungltig. -/source -/section section name=Defining the messages in an XML file pUsing XML based files has many advantages:/p ul @@ -103,7 +70,40 @@ to add as many entries to each bundle as you like. The I18n component contains a number of classes that simplify the access to entries of frequently used bundles./p /section -section name=Initializing the messages +section name=NEW: Pluggable message providers +pSince version 0.3 of this component you can add your own custom message providers./p +pThis is a big plus if you already have your localized messages in a database for example. + You do not have to convert them into the supported XML or property-based format, but you + can write a simple codeMessageProvider/code by implementing a single method and plug it in./p +/section +section name=NEW: ResourceBundle based message provider added + pA new message provider made it into this component: The codeResourceBundleMessageProvider/code. + This one enables you to keep your property files that may contain localized messages./p + pYou can group entries messages by adding the key at the end of the existing message key. The + following example shows how a property file should look
svn commit: r153827 - jakarta/commons/sandbox/i18n/trunk/project.properties
Author: dflorey Date: Mon Feb 14 10:45:26 2005 New Revision: 153827 URL: http://svn.apache.org/viewcvs?view=revrev=153827 Log: Added download page generation Modified: jakarta/commons/sandbox/i18n/trunk/project.properties Modified: jakarta/commons/sandbox/i18n/trunk/project.properties URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/project.properties?view=diffr1=153826r2=153827 == --- jakarta/commons/sandbox/i18n/trunk/project.properties (original) +++ jakarta/commons/sandbox/i18n/trunk/project.properties Mon Feb 14 10:45:26 2005 @@ -1,4 +1,4 @@ -# Copyright 2004 The Apache Software Foundation + Copyright 2004 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. @@ -21,7 +21,8 @@ maven.xdoc.version=${pom.currentVersion} maven.xdoc.developmentProcessUrl=http://jakarta.apache.org/commons/charter.html maven.xdoc.includeProjectDocumentation=yes - +maven.xdoc.distributionUrl=http://www.apache.org/dist/java-repository/commons-i18n/distributions +maven.xdoc.distributionType=zip # # M A V E N J A R O V E R R I D E # - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r153828 - jakarta/commons/sandbox/i18n/trunk/project.xml
Author: dflorey Date: Mon Feb 14 10:49:08 2005 New Revision: 153828 URL: http://svn.apache.org/viewcvs?view=revrev=153828 Log: Added download page generation Modified: jakarta/commons/sandbox/i18n/trunk/project.xml Modified: jakarta/commons/sandbox/i18n/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/project.xml?view=diffr1=153827r2=153828 == --- jakarta/commons/sandbox/i18n/trunk/project.xml (original) +++ jakarta/commons/sandbox/i18n/trunk/project.xml Mon Feb 14 10:49:08 2005 @@ -34,6 +34,10 @@ currentVersion0.2/currentVersion versions + version + id1/id + name0.3/name + /version /versions branches /branches - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r153829 - in jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n: LocalizedBundle.java LocalizedError.java LocalizedException.java LocalizedMessage.java LocalizedText.java MessageNotFoundException.java MessageProvider.java
Author: dflorey Date: Mon Feb 14 11:03:07 2005 New Revision: 153829 URL: http://svn.apache.org/viewcvs?view=revrev=153829 Log: Added download page generation Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedBundle.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedMessage.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedText.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageNotFoundException.java jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageProvider.java Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedBundle.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedBundle.java?view=diffr1=153828r2=153829 == --- jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedBundle.java (original) +++ jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedBundle.java Mon Feb 14 11:03:07 2005 @@ -1,7 +1,7 @@ /* * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons-sandbox//i18n/src/java/org/apache/commons/i18n/LocalizedBundle.java,v 1.3 2004/12/29 17:03:55 dflorey Exp $ * $Revision: 1.3 $ - * $Date: 2004/12/29 17:03:55 $ + * $Date$ * * * Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java?view=diffr1=153828r2=153829 == --- jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java (original) +++ jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java Mon Feb 14 11:03:07 2005 @@ -1,7 +1,7 @@ /* * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons-sandbox//i18n/src/java/org/apache/commons/i18n/LocalizedError.java,v 1.1 2004/10/04 13:41:09 dflorey Exp $ * $Revision: 1.1 $ - * $Date: 2004/10/04 13:41:09 $ + * $Date$ * * * Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java?view=diffr1=153828r2=153829 == --- jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java (original) +++ jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java Mon Feb 14 11:03:07 2005 @@ -1,7 +1,7 @@ /* * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons-sandbox//i18n/src/java/org/apache/commons/i18n/LocalizedException.java,v 1.1 2004/10/04 13:41:09 dflorey Exp $ * $Revision: 1.1 $ - * $Date: 2004/10/04 13:41:09 $ + * $Date$ * * * Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedMessage.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedMessage.java?view=diffr1=153828r2=153829 == --- jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedMessage.java (original) +++ jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedMessage.java Mon Feb 14 11:03:07 2005 @@ -1,7 +1,7 @@ /* * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons-sandbox//i18n/src/java/org/apache/commons/i18n/LocalizedMessage.java,v 1.1 2004/10/04 13:41:09 dflorey Exp $ * $Revision: 1.1 $ - * $Date: 2004/10/04 13:41:09 $ + * $Date$ * * * Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedText.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedText.java?view=diffr1=153828r2=153829 == --- jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedText.java (original) +++ jakarta/commons
svn commit: r149254 - jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageManager.java
Author: dflorey Date: Mon Jan 31 05:09:59 2005 New Revision: 149254 URL: http://svn.apache.org/viewcvs?view=revrev=149254 Log: Javadoc corrected Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageManager.java Modified: jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageManager.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageManager.java?view=diffr1=149253r2=149254 == --- jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageManager.java (original) +++ jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageManager.java Mon Jan 31 05:09:59 2005 @@ -29,7 +29,7 @@ /** * The codeMessageManager/code provides methods for retrieving localized * messages and adding custom message providers. This class should not be called - * directly for other purposes than registering a custom [EMAIL PROTECTED] + * directly for other purposes than registering a custom [EMAIL PROTECTED] MessageProvider} * or retrieving information about available message entries. * p * To access localized messages a subclass of the [EMAIL PROTECTED] LocalizedBundle}class - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract project.xml
dflorey 2005/01/02 04:27:43 Modified:contract project.xml Log: Migratoin to i18n 0.4 Revision ChangesPath 1.7 +1 -1 jakarta-commons-sandbox/contract/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/project.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- project.xml 18 Dec 2004 16:14:50 - 1.6 +++ project.xml 2 Jan 2005 12:27:43 - 1.7 @@ -42,7 +42,7 @@ dependencies dependency idcommons-i18n/id - version0.3/version + version0.4/version /dependency dependency idcommons-xmlio/id - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract project.properties
dflorey 2005/01/02 04:28:51 Modified:contract project.properties Log: Revision ChangesPath 1.5 +1 -1 jakarta-commons-sandbox/contract/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/contract/project.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- project.properties18 Dec 2004 16:14:50 - 1.4 +++ project.properties2 Jan 2005 12:28:51 - 1.5 @@ -28,5 +28,5 @@ # # Jars set explicity by path. # -maven.jar.commons-i18n = ${basedir}/lib/commons-i18n-0.3.jar +maven.jar.commons-i18n = ${basedir}/lib/commons-i18n-0.4.jar maven.jar.commons-xmlio = ${basedir}/lib/commons-xmlio-0.1pre.jar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n MessageManager.java
dflorey 2005/01/02 05:26:15 Modified:i18n/src/java/org/apache/commons/i18n MessageManager.java Log: Some javadoc testings Revision ChangesPath 1.5 +39 -32 jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageManager.java Index: MessageManager.java === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- MessageManager.java 29 Dec 2004 17:03:55 - 1.4 +++ MessageManager.java 2 Jan 2005 13:26:15 - 1.5 @@ -27,53 +27,60 @@ import java.util.Map; /** + * * @author Daniel Florey - * */ public class MessageManager { private static List messageProviders = new ArrayList(); static { -messageProviders.add(new XMLMessageProvider()); -messageProviders.add(new ResourceBundleMessageProvider()); + messageProviders.add(new XMLMessageProvider()); + messageProviders.add(new ResourceBundleMessageProvider()); } -public static void addMessageProvider(MessageProvider messageProvider) { -messageProviders.add(messageProvider); +/** + * Add a custom code[EMAIL PROTECTED] MessageProvider}/code to the + * codeMessageManager/code. It will be incorporated in later calls of the + * [EMAIL PROTECTED] getText} or [EMAIL PROTECTED] getEntries} methods. + * + * @param messageProvider The codeMessageProvider/code to be added. + */ +public static void addMessageProvider(MessageProvider messageProvider) { + messageProviders.add(messageProvider); } public static String getText(String id, String entry, Object[] arguments, Locale locale) throws MessageNotFoundException { -MessageNotFoundException exception = null; -for ( Iterator i = messageProviders.iterator(); i.hasNext(); ) { -try { -String text =((MessageProvider)i.next()).getText(id, entry, locale); -return MessageFormat.format(text, arguments); -} catch ( MessageNotFoundException e ) { -exception = e; -} -} -throw exception; + MessageNotFoundException exception = null; + for ( Iterator i = messageProviders.iterator(); i.hasNext(); ) { + try { + String text =((MessageProvider)i.next()).getText(id, entry, locale); + return MessageFormat.format(text, arguments); + } catch ( MessageNotFoundException e ) { + exception = e; + } + } + throw exception; } public static String getText(String id, String entry, Object[] arguments, Locale locale, String defaultText) { -try { -String text = getText(id, entry, arguments, locale); -return MessageFormat.format(text, arguments); -} catch ( MessageNotFoundException e ) { -return defaultText; -} + try { + String text = getText(id, entry, arguments, locale); + return MessageFormat.format(text, arguments); + } catch ( MessageNotFoundException e ) { + return defaultText; + } } public static Map getEntries(String id, Locale locale) throws MessageNotFoundException { -MessageNotFoundException exception = null; -for ( Iterator i = messageProviders.iterator(); i.hasNext(); ) { -try { -Map entries =((MessageProvider)i.next()).getEntries(id, locale); -return entries; -} catch ( MessageNotFoundException e ) { -exception = e; -} -} -throw exception; + MessageNotFoundException exception = null; + for ( Iterator i = messageProviders.iterator(); i.hasNext(); ) { + try { + Map entries =((MessageProvider)i.next()).getEntries(id, locale); + return entries; + } catch ( MessageNotFoundException e ) { + exception = e; + } + } + throw exception; } -} \ No newline at end of file +} - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n MessageManager.java
dflorey 2005/01/02 05:33:39 Modified:i18n/src/java/org/apache/commons/i18n MessageManager.java Log: Some javadoc testings Revision ChangesPath 1.6 +2 -1 jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageManager.java Index: MessageManager.java === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- MessageManager.java 2 Jan 2005 13:26:15 - 1.5 +++ MessageManager.java 2 Jan 2005 13:33:39 - 1.6 @@ -41,7 +41,8 @@ /** * Add a custom code[EMAIL PROTECTED] MessageProvider}/code to the * codeMessageManager/code. It will be incorporated in later calls of the - * [EMAIL PROTECTED] getText} or [EMAIL PROTECTED] getEntries} methods. + * [EMAIL PROTECTED] MessageManager#getText(String,String,Object[]) getText} or [EMAIL PROTECTED] + * #getEntries(String,Locale) getEntries} methods. * * @param messageProvider The codeMessageProvider/code to be added. */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n MessageManager.java
dflorey 2005/01/02 06:08:12 Modified:i18n/src/java/org/apache/commons/i18n MessageManager.java Log: Some javadoc testings Revision ChangesPath 1.7 +132 -63 jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageManager.java Index: MessageManager.java === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- MessageManager.java 2 Jan 2005 13:33:39 - 1.6 +++ MessageManager.java 2 Jan 2005 14:08:12 - 1.7 @@ -1,22 +1,22 @@ /* -* -* -* -* Copyright 2004 The Apache Software Foundation -* -* Licensed under the Apache License, Version 2.0 (the License); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an AS IS BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -*/ + * + * + * + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ package org.apache.commons.i18n; import java.text.MessageFormat; @@ -27,61 +27,130 @@ import java.util.Map; /** + * The codeMessageManager/code provides methods for retrieving localized + * messages and adding custom message providers. This class should not be called + * directly for other purposes than registering a custom [EMAIL PROTECTED] + * or retrieving information about available message entries. + * p + * To access localized messages a subclass of the [EMAIL PROTECTED] LocalizedBundle}class + * such as codeLocalizedText /code should be used: + * p + * codeLocalizedText welcome = new LocalizedText(welcome); // Using the + * default locale System.out.println(welcome.getText()); // Using some other + * locale System.out.println(welcome.getText(Locale.GERMAN));/code + * p + * codeYou can call [EMAIL PROTECTED] + * MessageManager#getText(String,String,Object[],Locale) getText} directly, + * but if you do so, you have to ensure that the given entry key really exists + * and to deal with the MessageNotFound exception that will be thrown if you + * try to access a not existing entry./code * * @author Daniel Florey */ public class MessageManager { private static List messageProviders = new ArrayList(); - + static { - messageProviders.add(new XMLMessageProvider()); - messageProviders.add(new ResourceBundleMessageProvider()); +messageProviders.add(new XMLMessageProvider()); +messageProviders.add(new ResourceBundleMessageProvider()); } - + /** - * Add a custom code[EMAIL PROTECTED] MessageProvider}/code to the - * codeMessageManager/code. It will be incorporated in later calls of the - * [EMAIL PROTECTED] MessageManager#getText(String,String,Object[]) getText} or [EMAIL PROTECTED] - * #getEntries(String,Locale) getEntries} methods. - * - * @param messageProvider The codeMessageProvider/code to be added. - */ -public static void addMessageProvider(MessageProvider messageProvider) { - messageProviders.add(messageProvider); + * Add a custom code[EMAIL PROTECTED] MessageProvider}/code to the + * codeMessageManager/code. It will be incorporated in later calls of + * the [EMAIL PROTECTED] MessageManager#getText(String,String,Object[],Locale) getText} + * or [EMAIL PROTECTED] #getEntries(String,Locale) getEntries}methods. + * + * @param messageProvider + *The codeMessageProvider/code to be added. + */ +public static void addMessageProvider(MessageProvider messageProvider) { +messageProviders.add(messageProvider); } - -public static String getText(String id, String entry, Object[] arguments, Locale locale
cvs commit: jakarta-commons-sandbox/i18n project.properties
dflorey 2005/01/02 06:34:17 Modified:i18n project.properties Log: Corrected javadoc link to jdk 1.4.2 Revision ChangesPath 1.9 +2 -2 jakarta-commons-sandbox/i18n/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.properties,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- project.properties17 Oct 2004 17:19:20 - 1.8 +++ project.properties2 Jan 2005 14:34:17 - 1.9 @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. maven.javadoc.author=false -maven.javadoc.links=http://java.sun.com/products/jdk/1.4/docs/api +maven.javadoc.links=http://java.sun.com/j2se/1.4.2/docs/api maven.xdoc.jsl=../../jakarta-commons/commons-build/commons-site.jsl maven.xdoc.date=bottom @@ -28,4 +28,4 @@ # # Jars set explicity by path. # -maven.jar.commons-xmlio = ${basedir}/lib/commons-xmlio-0.1pre.jar \ No newline at end of file +maven.jar.commons-xmlio = ${basedir}/lib/commons-xmlio-0.1pre.jar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n LocalizedBundle.java XMLMessageProvider.java MessageProvider.java ResourceBundleMessageProvider.java MessageManager.java
dflorey 2004/12/29 09:03:55 Modified:i18n/src/java/org/apache/commons/i18n LocalizedBundle.java XMLMessageProvider.java MessageProvider.java ResourceBundleMessageProvider.java MessageManager.java Log: Added support for getEntries()... Revision ChangesPath 1.3 +8 -5 jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/LocalizedBundle.java Index: LocalizedBundle.java === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/LocalizedBundle.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- LocalizedBundle.java 18 Dec 2004 15:08:49 - 1.2 +++ LocalizedBundle.java 29 Dec 2004 17:03:55 - 1.3 @@ -23,16 +23,19 @@ package org.apache.commons.i18n; +import java.io.Serializable; import java.util.Locale; /** * @author Daniel Florey * - * The LocalizedBundle class represents a bundle of localized messages that + * The codeLocalizedBundle/code class represents a bundle of localized messages that * belong together. + * The codeLocalizedBundle/code class itself contains the message id and the arguments + * that might be used to include dynamic values into the message text and knows nothing * */ -public class LocalizedBundle { +public class LocalizedBundle implements Serializable { public final static String ID = id; public final static String ARGUMENTS = arguments; 1.2 +2 -3 jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/XMLMessageProvider.java Index: XMLMessageProvider.java === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/XMLMessageProvider.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XMLMessageProvider.java 18 Dec 2004 15:08:49 - 1.1 +++ XMLMessageProvider.java 29 Dec 2004 17:03:55 - 1.2 @@ -20,7 +20,6 @@ package org.apache.commons.i18n; import java.io.InputStream; -import java.text.MessageFormat; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; @@ -45,9 +44,9 @@ private static Map installedMessages = new HashMap(); private static Map messages = new HashMap(); -public String getText(String id, String entry, Object[] arguments, Locale locale) throws MessageNotFoundException { +public String getText(String id, String entry, Locale locale) throws MessageNotFoundException { Message message = findMessage(id, locale); -return MessageFormat.format(message.getEntry(entry), arguments); +return message.getEntry(entry); } public Map getEntries(String id, Locale locale) throws MessageNotFoundException { 1.2 +7 -4 jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageProvider.java Index: MessageProvider.java === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageProvider.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MessageProvider.java 18 Dec 2004 15:08:49 - 1.1 +++ MessageProvider.java 29 Dec 2004 17:03:55 - 1.2 @@ -23,7 +23,10 @@ package org.apache.commons.i18n; import java.util.Locale; +import java.util.Map; public interface MessageProvider { -public String getText(String id, String entry, Object[] arguments, Locale locale) throws MessageNotFoundException; +public String getText(String id, String entry, Locale locale) throws MessageNotFoundException; + +public Map getEntries(String id, Locale locale) throws MessageNotFoundException; } 1.3 +33 -4 jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/ResourceBundleMessageProvider.java Index: ResourceBundleMessageProvider.java === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/ResourceBundleMessageProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ResourceBundleMessageProvider.java18 Dec 2004 15:23:01 - 1.2 +++ ResourceBundleMessageProvider.java29 Dec 2004 17:03:55 - 1.3 @@ -19,11 +19,13 @@ */ package org.apache.commons.i18n; -import java.text.MessageFormat; import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; +import java.util.Map; import
cvs commit: jakarta-commons-sandbox/contract/lib commons-i18n-0.4.jar commons-i18n-0.3.jar
dflorey 2004/12/29 09:10:49 Added: contract/lib commons-i18n-0.4.jar Removed: contract/lib commons-i18n-0.3.jar Log: Moved to commonsi-18n-0.4 Revision ChangesPath 1.1 jakarta-commons-sandbox/contract/lib/commons-i18n-0.4.jar Binary file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util MainWrapper.java InteractiveMainWrapper.java
dflorey 2004/12/18 05:52:16 Modified:contract/src/examples/org/apache/commons/contract/example SpeedCalculator.java contract/src/config constraints.xml example.xml contract/src/java/org/apache/commons/contract/constraints BooleanConstraints.java Unconstrained.java MapConstraints.java DateConstraints.java ArrayConstraints.java ListConstraints.java LocaleConstraints.java contract/src/java/org/apache/commons/contract/util MainWrapper.java InteractiveMainWrapper.java Added: contract/src/examples/org/apache/commons/contract/example TestLogin.java LoginProcessor.java TestSpeedCalculator.java Removed: contract/src/examples/org/apache/commons/contract/example SimpleMain.java Log: Improved constraint classes Revision ChangesPath 1.2 +21 -17 jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example/SpeedCalculator.java Index: SpeedCalculator.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example/SpeedCalculator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SpeedCalculator.java 8 Oct 2004 10:44:57 - 1.1 +++ SpeedCalculator.java 18 Dec 2004 13:52:16 - 1.2 @@ -43,35 +43,39 @@ private final static String MINUTES = min; private final static String HOURS = h; -ParameterDescriptor[] parameterDescriptors = new ParameterDescriptor[]{ -new ParameterDescriptor(DISTANCE, new ParameterMessage(computeSpeed/parameter/distance), -new NumberConstraints( +private ParameterDescriptor[] parameterDescriptors = new ParameterDescriptor[]{ +new ParameterDescriptor(DISTANCE, new ParameterMessage( +computeSpeed/parameter/distance), new NumberConstraints( new Integer(0), null, true)), -new ParameterDescriptor(UNIT, new ParameterMessage(computeSpeed/parameter/unit), -new StringConstraints( +new ParameterDescriptor(UNIT, new ParameterMessage( +computeSpeed/parameter/unit), new StringConstraints( new String[]{SECONDS, MINUTES, HOURS})), -new ParameterDescriptor(TIME, new ParameterMessage(computeSpeed/parameter/time), -NumberConstraints.POSITIVE)}; - -ResultDescriptor[] resultDescriptors = new ResultDescriptor[]{new ResultDescriptor( +new ParameterDescriptor(TIME, new ParameterMessage( +computeSpeed/parameter/time), NumberConstraints.POSITIVE)}; + +private ResultDescriptor[] resultDescriptors = new ResultDescriptor[]{new ResultDescriptor( StateDescriptor.OK_DESCRIPTOR, new ResultEntryDescriptor[]{new ResultEntryDescriptor(SPEED, new LocalizedMessage(computeSpeed/result/speed), -new NumberConstraints(new Float(0.1), new Integer(Integer.MAX_VALUE)))})}; - +new NumberConstraints(new Float(0.1), new Integer( +Integer.MAX_VALUE)))})}; + /** * Computes the speed in meter per second from the given distance and time. * The time can be given in seconds, minutes or hours, depending on the * content of timeUnit. */ public Result process(Map parameters, Context context) { -float distance = ((Number)parameters.get(DISTANCE)).floatValue(); -float time = ((Number)parameters.get(TIME)).floatValue(); -String timeUnit = (String)parameters.get(UNIT); +float distance = ((Number) parameters.get(DISTANCE)).floatValue(); +float time = ((Number) parameters.get(TIME)).floatValue(); +String timeUnit = (String) parameters.get(UNIT); float speed; -if (timeUnit.equals(s)) speed = distance / time; -else if (timeUnit.equals(min)) speed = distance*60 / time; -else speed = distance*3600 / time; +if (timeUnit.equals(s)) +speed = distance / time; +else if (timeUnit.equals(min)) +speed = distance * 60 / time; +else +speed = distance * 3600 / time; return new Result(StateDescriptor.OK, SPEED, new Float(speed)); } 1.1 jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example/TestLogin.java Index: TestLogin.java
cvs commit: jakarta-commons-sandbox/contract/lib commons-i18n-0.3.jar commons-i18n-0.2.jar
dflorey 2004/12/18 07:07:44 Added: contract/lib commons-i18n-0.3.jar Removed: contract/lib commons-i18n-0.2.jar Log: Updated contract to i18n 0.3 Revision ChangesPath 1.1 jakarta-commons-sandbox/contract/lib/commons-i18n-0.3.jar Binary file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util MainWrapper.java
dflorey 2004/12/18 07:07:54 Modified:contract/src/examples/org/apache/commons/contract/example TestLogin.java TestSpeedCalculator.java contract/src/java/org/apache/commons/contract Executor.java contract/src/java/org/apache/commons/contract/util MainWrapper.java Log: Updated contract to i18n 0.3 Revision ChangesPath 1.2 +2 -2 jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example/TestLogin.java Index: TestLogin.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example/TestLogin.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestLogin.java18 Dec 2004 13:52:16 - 1.1 +++ TestLogin.java18 Dec 2004 15:07:53 - 1.2 @@ -21,11 +21,11 @@ import org.apache.commons.contract.Result; import org.apache.commons.contract.util.InteractiveMainWrapper; -import org.apache.commons.i18n.MessageManager; +import org.apache.commons.i18n.XMLMessageProvider; public class TestLogin { public static void main(String[] args) { -MessageManager.install(contract/example, Thread.currentThread().getContextClassLoader().getResourceAsStream(example.xml)); +XMLMessageProvider.install(contract/example, Thread.currentThread().getContextClassLoader().getResourceAsStream(example.xml)); Result result = InteractiveMainWrapper.main(args, new LoginProcessor()); if ( result != Result.OK ) { System.out.println(Login ist fehlgeschlagen.); 1.2 +2 -2 jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example/TestSpeedCalculator.java Index: TestSpeedCalculator.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example/TestSpeedCalculator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestSpeedCalculator.java 18 Dec 2004 13:52:16 - 1.1 +++ TestSpeedCalculator.java 18 Dec 2004 15:07:53 - 1.2 @@ -21,11 +21,11 @@ import org.apache.commons.contract.Result; import org.apache.commons.contract.util.InteractiveMainWrapper; -import org.apache.commons.i18n.MessageManager; +import org.apache.commons.i18n.XMLMessageProvider; public class TestSpeedCalculator { public static void main(String[] args) { -MessageManager.install(contract/example, Thread.currentThread().getContextClassLoader().getResourceAsStream(example.xml)); +XMLMessageProvider.install(contract/example, Thread.currentThread().getContextClassLoader().getResourceAsStream(example.xml)); Result result = InteractiveMainWrapper.main(args, new SpeedCalculator()); if ( result != null ) { System.out.println(Speed: +result.getResultEntries().get(SpeedCalculator.SPEED)); 1.4 +3 -3 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/Executor.java Index: Executor.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/Executor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Executor.java 7 Dec 2004 20:52:18 - 1.3 +++ Executor.java 18 Dec 2004 15:07:53 - 1.4 @@ -9,12 +9,12 @@ import org.apache.commons.contract.descriptor.ResultDescriptor; import org.apache.commons.contract.descriptor.ResultEntryDescriptor; import org.apache.commons.i18n.LocalizedError; -import org.apache.commons.i18n.MessageManager; +import org.apache.commons.i18n.XMLMessageProvider; public class Executor { static { -MessageManager.install(contract/exceptions, Thread.currentThread().getContextClassLoader().getResourceAsStream(exceptions.xml)); -MessageManager.install(contract/constraints, Thread.currentThread().getContextClassLoader().getResourceAsStream(constraints.xml)); +XMLMessageProvider.install(contract/exceptions, Thread.currentThread().getContextClassLoader().getResourceAsStream(exceptions.xml)); +XMLMessageProvider.install(contract/constraints, Thread.currentThread().getContextClassLoader().getResourceAsStream(constraints.xml)); } public static void init() {}; 1.5 +2 -2 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util/MainWrapper.java Index: MainWrapper.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util/MainWrapper.java
cvs commit: jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n XMLMessageProvider.java MessageProvider.java ResourceBundleMessageProvider.java LocalizedBundle.java MessageManager.java
dflorey 2004/12/18 07:08:50 Modified:i18n/src/java/org/apache/commons/i18n LocalizedBundle.java MessageManager.java Added: i18n/src/java/org/apache/commons/i18n XMLMessageProvider.java MessageProvider.java ResourceBundleMessageProvider.java Log: Added support for pluggable MessageProviders and added ResourceBundleMessageProvider to enable migration from resource bundle based applications to i18n. Revision ChangesPath 1.2 +41 -3 jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/LocalizedBundle.java Index: LocalizedBundle.java === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/LocalizedBundle.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- LocalizedBundle.java 4 Oct 2004 13:41:09 - 1.1 +++ LocalizedBundle.java 18 Dec 2004 15:08:49 - 1.2 @@ -25,6 +25,13 @@ import java.util.Locale; +/** + * @author Daniel Florey + * + * The LocalizedBundle class represents a bundle of localized messages that + * belong together. + * + */ public class LocalizedBundle { public final static String ID = id; public final static String ARGUMENTS = arguments; @@ -32,28 +39,59 @@ protected String id; protected Object[] arguments; +/** + * @param messageId The messageId refers the corresponding bundle in the file containing + * the localized messages. The format of the message file depends on the implementation of the + * MessageManager. + */ public LocalizedBundle(String messageId) { this.id = messageId; this.arguments = new Object[0]; } +/** + * @param messageId The messageId refers the corresponding bundle in the file containing + * the localized messages. The format of the message file depends on the implementation of the + * MessageManager. + * @param arguments An array of objects containing argument for the messages. These arguments + * are used to insert dynamic values into the localized messages. + */ public LocalizedBundle(String messageId, Object[] arguments) { this.id = messageId; this.arguments = arguments; } +/** + * @return returns the id of this bundle + */ public String getId() { return id; } +/** + * @return returns the arguments associated with this message bundle + */ public Object[] getArguments() { return arguments; } +/** + * @param key the key of the specific message entry in the message bundle + * @param locale the locale for that this message should be rendered + * @return returns the localized text + * @throws MessageNotFoundException if an entry with the given key can not be found + * in this bundle + */ public String getText(String key, Locale locale) throws MessageNotFoundException { return MessageManager.getText(id, key, arguments, locale); } +/** + * @param key the key of the specific message entry in the message bundle + * @param locale the locale for that this message should be rendered + * @param defaultText the text to be returned if no entry was found for the given key + * @return returns the localized text + */ public String getText(String key, String defaultText, Locale locale) { return MessageManager.getText(id, key, arguments, locale, defaultText); } 1.3 +45 -184 jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageManager.java Index: MessageManager.java === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MessageManager.java 16 Oct 2004 17:41:16 - 1.2 +++ MessageManager.java 18 Dec 2004 15:08:49 - 1.3 @@ -1,201 +1,62 @@ /* - * $Header$ - * $Revision$ - * $Date$ - * - * - * - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
cvs commit: jakarta-commons-sandbox/i18n build.xml
dflorey 2004/12/18 07:22:42 Modified:i18n build.xml Log: Added support for pluggable MessageProviders and added ResourceBundleMessageProvider to enable migration from resource bundle based applications to i18n. Revision ChangesPath 1.3 +1 -1 jakarta-commons-sandbox/i18n/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- build.xml 16 Oct 2004 17:35:01 - 1.2 +++ build.xml 18 Dec 2004 15:22:42 - 1.3 @@ -18,7 +18,7 @@ property name=deprecation value=true / property name=optimize value=true / - property name=version value=0.2 / + property name=version value=0.3 / property name=name value=commons-i18n / !-- === - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/src/examples/org/apache - New directory
dflorey 2004/12/18 07:22:57 jakarta-commons-sandbox/i18n/src/examples/org/apache - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/src/examples - New directory
dflorey 2004/12/18 07:22:57 jakarta-commons-sandbox/i18n/src/examples - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/src/examples/org/apache/i18n - New directory
dflorey 2004/12/18 07:22:57 jakarta-commons-sandbox/i18n/src/examples/org/apache/i18n - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/src/examples/org - New directory
dflorey 2004/12/18 07:22:57 jakarta-commons-sandbox/i18n/src/examples/org - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n ResourceBundleMessageProvider.java
dflorey 2004/12/18 07:23:01 Modified:i18n/src/java/org/apache/commons/i18n ResourceBundleMessageProvider.java Added: i18n/src/examples/org/apache/i18n/examples ResourceBundleExample.java i18n/src/examples messageBundle_de.properties messageBundle.properties Log: Added support for pluggable MessageProviders and added ResourceBundleMessageProvider to enable migration from resource bundle based applications to i18n. Revision ChangesPath 1.1 jakarta-commons-sandbox/i18n/src/examples/org/apache/i18n/examples/ResourceBundleExample.java Index: ResourceBundleExample.java === /* * * * * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.i18n.examples; import org.apache.commons.i18n.LocalizedMessage; import org.apache.commons.i18n.ResourceBundleMessageProvider; /** * @author Daniel Florey * */ public class ResourceBundleExample { public static void main(String[] args) { ResourceBundleMessageProvider.install(messageBundle); LocalizedMessage testMessage = new LocalizedMessage(helloWorld); System.out.println(testMessage.getTitle()); System.out.println(testMessage.getText()); } } 1.1 jakarta-commons-sandbox/i18n/src/examples/messageBundle_de.properties Index: messageBundle_de.properties === # Example for using message bundles using a flat properties-file helloWorld.title=Hallo Welt helloWorld.text=Ich wünsche Dir alles Gute und ein frohes Fest! 1.1 jakarta-commons-sandbox/i18n/src/examples/messageBundle.properties Index: messageBundle.properties === # Example for using message bundles using a flat properties-file helloWorld.title=Hello World helloWorld.text=I wish you a merry christmas! 1.2 +1 -1 jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/ResourceBundleMessageProvider.java Index: ResourceBundleMessageProvider.java === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/ResourceBundleMessageProvider.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ResourceBundleMessageProvider.java18 Dec 2004 15:08:49 - 1.1 +++ ResourceBundleMessageProvider.java18 Dec 2004 15:23:01 - 1.2 @@ -54,7 +54,7 @@ } } catch ( MissingResourceException e ) { logger.log(Level.WARNING, Could not find resource bundle with base name '+baseName+', uninstalling it...); -uninstall(baseName); +i.remove(); } } throw new MessageNotFoundException(Message with id +id+ not found); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/src/examples/org/apache/i18n/examples - New directory
dflorey 2004/12/18 07:22:57 jakarta-commons-sandbox/i18n/src/examples/org/apache/i18n/examples - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/xdocs/images i18n-logo-white.psd
dflorey 2004/12/18 07:39:08 Modified:i18n/xdocs quickstart.xml Added: i18n/xdocs/images i18n-logo-white.psd Log: Added support for pluggable MessageProviders and added ResourceBundleMessageProvider to enable migration from resource bundle based applications to i18n. Revision ChangesPath 1.2 +43 -3 jakarta-commons-sandbox/i18n/xdocs/quickstart.xml Index: quickstart.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/xdocs/quickstart.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- quickstart.xml5 Oct 2004 17:47:55 - 1.1 +++ quickstart.xml18 Dec 2004 15:39:08 - 1.2 @@ -12,10 +12,50 @@ section name=Getting started pIn order to get an impression of how this component works, we will start with an example showing the capabilities of this package./p -pTo get started you need at least the jar of this component and the dependent xml-importer-jar for reading +pTo get started you need at least the jar of this component and the dependent xmlio-jar for reading xml documents in your classpath./p /section -section name=Defining the messages +section name=NEW: Pluggable message providers +pSince version 0.3 of this component you can add your own custom message providers./p +pThis is a big plus if you already have your localized messages in a database for example. + You do not have to convert them into the supported XML or property-based format, but you + can write a simple MessageProvider by implementing a single method and plug it in./p +/section +section name=NEW: ResourceBundle based message provider added + pA new message provider made it into this component: The ResourceBundleMessageProvider. + This one enables you to keep your property files that may contain localized messages./p + pYou can group entries messages by adding the key at the end of the existing message key. The + following example shows how a property file should look like to work as the following XML example:/p +pAs you know you'll need two files, each containing the messages for a specific locale. This one might be + the default one calld myMessages.properties:/p + source +welcome.text=Welcome +usage.title=Usage +usage.text=The application requires the following parameters: +validationFailed.title=Parameter {0} invalid +validationFailed.text=The given value of the parameter {0} is invalid +validationFailed.summary=Value of parameter {0} invalid +validationFailed.details=The given value {1} of parameter {0} is invalid. +/source +pThe following one would contain the corresponding german translations in a file called myMessages_de.properties:/p + source +welcome.text=Willkommen +usage.title=Benutzung +usage.text=Die folgenden Parameter werden erwartet: +validationFailed.title=Parametervalidierung fehlgeschlagen. +validationFailed.text=Die Validierung des Parameters {0} ist fehlgeschlagen. +validationFailed.summary=Validierung des Parameters {0} fehlgeschlagen. +validationFailed.details=Der Wert {1} des Parameters {0} ist ungültig. +/source +/section +section name=Defining the messages in an XML file + pUsing XML based files has many advantages:/p + ul + liYou can use the XML-editor of your choice to get assistance by typing the messages/li + liAll entries that belong together are grouped into a single XML element/li + liAll languages reside in a single file, so it is simpler to add a new language (matter of taste?)/li + liAs the whole file gets parsed at initialization time, the localization is much faster/li + /ul pYou have to initialize the message manager with an input stream giving access to the xml document containing the localized messages./p source @@ -70,7 +110,7 @@ ... try { FileInputStream inputStream = new FileInputStream(myMessages.xml); - MessageManager.install(myMessages, inputStream); + XMLMessageProvider.install(myMessages, inputStream); } catch ( FileNotFoundException e ) { // handle exception } 1.1 jakarta-commons-sandbox/i18n/xdocs/images/i18n-logo-white.psd Binary file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/xdocs quickstart.xml
dflorey 2004/12/18 07:56:28 Modified:i18n/xdocs quickstart.xml Log: Added docs for new ResourceBundleMessageProvider Revision ChangesPath 1.3 +18 -4 jakarta-commons-sandbox/i18n/xdocs/quickstart.xml Index: quickstart.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/xdocs/quickstart.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- quickstart.xml18 Dec 2004 15:39:08 - 1.2 +++ quickstart.xml18 Dec 2004 15:56:28 - 1.3 @@ -12,17 +12,17 @@ section name=Getting started pIn order to get an impression of how this component works, we will start with an example showing the capabilities of this package./p -pTo get started you need at least the jar of this component and the dependent xmlio-jar for reading +pTo get started you need at least the jar of this component and the dependent codexmlio-x.x.jar/code for reading xml documents in your classpath./p /section section name=NEW: Pluggable message providers pSince version 0.3 of this component you can add your own custom message providers./p pThis is a big plus if you already have your localized messages in a database for example. You do not have to convert them into the supported XML or property-based format, but you - can write a simple MessageProvider by implementing a single method and plug it in./p + can write a simple codeMessageProvider/code by implementing a single method and plug it in./p /section section name=NEW: ResourceBundle based message provider added - pA new message provider made it into this component: The ResourceBundleMessageProvider. + pA new message provider made it into this component: The codeResourceBundleMessageProvider/code. This one enables you to keep your property files that may contain localized messages./p pYou can group entries messages by adding the key at the end of the existing message key. The following example shows how a property file should look like to work as the following XML example:/p @@ -105,7 +105,9 @@ /section section name=Initializing the messages pNow that we created a file containing the desired messages, we want to make use of them. -To do so we have to initialize the codeMessageManager/code with these messages./p +To do so we have to initialize the codeMessageProvider/code with these messages./p + pInitializing messages depends on the codeMessageProvider/code that you are using. In case of + an codeXMLMessageProvider/code initialization looks like this:/p source ... try { @@ -122,6 +124,18 @@ where you want probably load messages from you .war archive. So an input stream is much more flexible, even if it is a little bit more unconvenient than using a file name in our use case./p +pIn case of the brand new codeResourceBundleMessageProvider/code initialization looks even simpler:/p +source +... +try { + ResourceBundleMessageProvider.install(myMessages); +} catch ( FileNotFoundException e ) { + // handle exception +} +... +/source +pIt's this simple, because the codeResourceBundleMessageProvider/code uses the build-in features of Java to locate + and load the appropriate property files or resource bundle classes./p /section section name=Using message bundles pNow we are ready to go! First of all we want to print out a simple localized welcome - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/xdocs index.xml
dflorey 2004/12/18 07:58:12 Modified:i18n/xdocs index.xml Log: Added docs for new ResourceBundleMessageProvider Revision ChangesPath 1.3 +5 -4 jakarta-commons-sandbox/i18n/xdocs/index.xml Index: index.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/xdocs/index.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- index.xml 5 Oct 2004 17:47:55 - 1.2 +++ index.xml 18 Dec 2004 15:58:12 - 1.3 @@ -14,10 +14,11 @@ This package adds the feature of localized message bundles that consist of one or many localized texts that belong together. Think of an error message that consists of title, text, summary and error details. These localized texts are bundled to a localized error and can be referenced easily./p - pBased on this concept localized exceptions are introduced that make dealing with internationalization a pleasure.../p - pA message manager takes care of initializing the messages from an XML document. - It can handle a number of different message resource so that you can quickly reload messages based - on a single resource./p +pTo get started go a href=quickstart.htmlhere/a./p +pBased on this concept localized exceptions are introduced that make dealing with internationalization a pleasure.../p +pA message manager takes care of handling different pluggable message providers that enable you to easily migrate to the i18n-component./p +pIt can handle a number of different message resources so that you can quickly reload messages based +on a single resource./p /section section name=Releases - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/xdocs quickstart.xml
dflorey 2004/12/18 08:00:37 Modified:i18n/xdocs quickstart.xml Log: Added docs for new ResourceBundleMessageProvider Revision ChangesPath 1.4 +1 -5 jakarta-commons-sandbox/i18n/xdocs/quickstart.xml Index: quickstart.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/xdocs/quickstart.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- quickstart.xml18 Dec 2004 15:56:28 - 1.3 +++ quickstart.xml18 Dec 2004 16:00:37 - 1.4 @@ -127,11 +127,7 @@ pIn case of the brand new codeResourceBundleMessageProvider/code initialization looks even simpler:/p source ... -try { - ResourceBundleMessageProvider.install(myMessages); -} catch ( FileNotFoundException e ) { - // handle exception -} +ResourceBundleMessageProvider.install(myMessages); ... /source pIt's this simple, because the codeResourceBundleMessageProvider/code uses the build-in features of Java to locate - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract project.properties project.xml
dflorey 2004/12/18 08:14:50 Modified:contract project.properties project.xml Log: Moved to i18n-0.3 Revision ChangesPath 1.4 +2 -2 jakarta-commons-sandbox/contract/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/contract/project.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- project.properties17 Oct 2004 17:18:06 - 1.3 +++ project.properties18 Dec 2004 16:14:50 - 1.4 @@ -28,5 +28,5 @@ # # Jars set explicity by path. # -maven.jar.commons-i18n = ${basedir}/lib/commons-i18n-0.2.jar -maven.jar.commons-xmlio = ${basedir}/lib/commons-xmlio-0.1pre.jar \ No newline at end of file +maven.jar.commons-i18n = ${basedir}/lib/commons-i18n-0.3.jar +maven.jar.commons-xmlio = ${basedir}/lib/commons-xmlio-0.1pre.jar 1.6 +1 -1 jakarta-commons-sandbox/contract/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/project.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- project.xml 7 Dec 2004 20:52:17 - 1.5 +++ project.xml 18 Dec 2004 16:14:50 - 1.6 @@ -42,7 +42,7 @@ dependencies dependency idcommons-i18n/id - version0.2/version + version0.3/version /dependency dependency idcommons-xmlio/id - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/context VMContext.java
dflorey 2004/12/07 12:52:18 Modified:contract/lib commons-i18n-0.2.jar contract project.xml contract/src/java/org/apache/commons/contract/util InteractiveMainWrapper.java MainWrapper.java contract/src/java/org/apache/commons/contract Context.java Executor.java Processor.java contract/src/java/org/apache/commons/contract/i18n ParameterMessage.java contract/src/java/org/apache/commons/contract/context VMContext.java Added: contract run_example.bat contract/src/java/org/apache/commons/contract Information.java Log: Added information class Revision ChangesPath 1.3 +47 -49jakarta-commons-sandbox/contract/lib/commons-i18n-0.2.jar Binary file 1.5 +1 -1 jakarta-commons-sandbox/contract/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/project.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- project.xml 3 Nov 2004 12:21:16 - 1.4 +++ project.xml 7 Dec 2004 20:52:17 - 1.5 @@ -8,7 +8,7 @@ inceptionYear2004/inceptionYear packageorg.apache.commons.contract/package shortDescriptionCommons Contract/shortDescription - descriptionContract based programming core/description + descriptionContract based programming/description currentVersion0.2/currentVersion versions 1.1 jakarta-commons-sandbox/contract/run_example.bat Index: run_example.bat === java -jar build/lib/commons-contract-example-0.2.jar 1.2 +2 -0 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util/InteractiveMainWrapper.java Index: InteractiveMainWrapper.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util/InteractiveMainWrapper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- InteractiveMainWrapper.java 8 Oct 2004 09:36:20 - 1.1 +++ InteractiveMainWrapper.java 7 Dec 2004 20:52:17 - 1.2 @@ -65,6 +65,8 @@ printException(exception); System.out.println(); printUsage(processor); +} catch ( Exception exception ) { +exception.printStackTrace(); } return null; } 1.3 +2 -0 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util/MainWrapper.java Index: MainWrapper.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util/MainWrapper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MainWrapper.java 15 Oct 2004 17:15:37 - 1.2 +++ MainWrapper.java 7 Dec 2004 20:52:18 - 1.3 @@ -66,6 +66,8 @@ System.out.println(); System.out.println(); printUsage(processor); +} catch ( Exception exception ) { +exception.printStackTrace(); } return null; } 1.2 +6 -0 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/Context.java Index: Context.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/Context.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Context.java 8 Oct 2004 09:36:20 - 1.1 +++ Context.java 7 Dec 2004 20:52:18 - 1.2 @@ -1,6 +1,12 @@ package org.apache.commons.contract; +import java.util.List; public interface Context { public Store getStore(String id); + +void addInformation(Information information); + +public List getInformations(); + } 1.3 +1 -1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/Executor.java Index: Executor.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/Executor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Executor.java 15 Oct 2004 17:15:37 - 1.2 +++ Executor.java 7 Dec 2004 20:52:18 - 1.3 @@ -19,7 +19,7 @@ public static void init() {}; -public static Result process(Processor
cvs commit: jakarta-commons/transaction project.xml
dflorey 2004/11/21 01:50:18 Modified:transaction project.xml Log: Removed organization name Revision ChangesPath 1.3 +1 -1 jakarta-commons/transaction/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons/transaction/project.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- project.xml 19 Nov 2004 23:57:19 - 1.2 +++ project.xml 21 Nov 2004 09:50:18 - 1.3 @@ -90,7 +90,7 @@ nameDaniel Florey/name iddflorey/id email[EMAIL PROTECTED]/email - organizationApache Software Foundation/organization + organization/organization timezone+1/timezone roles roleJava Developer/role - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/xdocs quickstart.xml index.xml
dflorey 2004/10/30 03:20:06 Modified:contract/xdocs quickstart.xml index.xml Log: Improved documentation Revision ChangesPath 1.4 +16 -5 jakarta-commons-sandbox/contract/xdocs/quickstart.xml Index: quickstart.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/xdocs/quickstart.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- quickstart.xml17 Oct 2004 17:03:56 - 1.3 +++ quickstart.xml30 Oct 2004 10:20:06 - 1.4 @@ -30,14 +30,20 @@ pSo your method will accept two floats that pass the distance and the time to the method. Additionally the method requires the unit in which the time was measured. You can tell this by using the appropriated types, that reflect the desired values./p -pBut you cannot declare, which value ranges are valid for the parameters of your method. +pThis example is incomplete, as no error handling is done. What happens if the method will be called + with time=0? What if the user enters an invalid unit? As this part is not much fun, many programmers + don't care much about handling errors in an appropriate way and by doing so cause much pain./p +pIn the java world, you cannot declare which value ranges are valid for the parameters of your method. You might only accept values larger than zero for the time and only s, min and h for the - measuring unit. Imagine that you want to provide a simple program, that allows the user to enter + measuring unit./p + pImagine that you want to provide a simple program, that allows the user to enter these three parameters and you want to provide the calculated speed. To calculate the speed is the very easy task, but as you might already know it is a lot more work to handle all possible errors, to display the user in a localized way which values are accepted and so on./p +/section +section name=The speed calculator example pThis is the moment where the contract component comes into play! You have to declare the possible - values that are accepted by your method and the result that will be provided, but this effort + values that are accepted by your method and the result that will be provided. This additional effort will be donated by handling all the rest. Let's have a look at the sources of the SpeedCalculator that is provided as an example in the sources of this component:/p source @@ -91,10 +97,15 @@ of code than in the classical java method example. But on the other hand you'll gain a lot! Launch the example that is included in this component by invoking the contrac-example.jar:/p sourcejava -jar contract-example.jar/source -pAs you can see, you have to define constraints for all the parameters that your method will accept. +pThis example is using the InteractiveMailWrapper to build a multilingual application that + handles the user input and ensures that the implemented method will only be called, + when all input parameters match the defined needs./p +/section +section name=Constraints +pAs you can see in the example, you have to define constraints for all the parameters that your method will accept. You even have the possibility to provide a default value that will be used when no parameter value is provided. This means, that the parameter is optional./p +pYou also provide constraints for the results that your processor provides./p /section - /body /document 1.3 +1 -1 jakarta-commons-sandbox/contract/xdocs/index.xml Index: index.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/xdocs/index.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- index.xml 15 Oct 2004 17:34:12 - 1.2 +++ index.xml 30 Oct 2004 10:20:06 - 1.3 @@ -16,7 +16,7 @@ /p p This component makes all the nice features available to the java programming language that -come along with contract based programming. +come along with contract based programming. To get started go a href=quickstart.htmlhere/a. /p /section - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/xdocs/style project.css project-colburne.css maven.css tigris.css print.css
dflorey 2004/10/17 10:03:56 Modified:contract/xdocs quickstart.xml Removed: contract/xdocs/style project.css project-colburne.css maven.css tigris.css print.css Log: Removed styles Revision ChangesPath 1.3 +9 -2 jakarta-commons-sandbox/contract/xdocs/quickstart.xml Index: quickstart.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/xdocs/quickstart.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- quickstart.xml15 Oct 2004 17:57:27 - 1.2 +++ quickstart.xml17 Oct 2004 17:03:56 - 1.3 @@ -19,8 +19,11 @@ a contract that defines which types of parameters are accepted by your method and you specify the type of tbe return value. This is how a method might look like that calcalutes speed:/p source - public float calculateSpeed(float distance, float time, String unit) { - ...calculate speed... + public float calculateSpeed(float distance, float time, String timeUnit) { + float speed; +if (timeUnit.equals(s)) speed = distance / time; +else if (timeUnit.equals(min)) speed = distance*60 / time; +else speed = distance*3600 / time; return speed; } /source @@ -84,6 +87,10 @@ } } /source +pYou'll be shocked at this moment as you have to write down a lot more lines + of code than in the classical java method example. But on the other hand you'll gain + a lot! Launch the example that is included in this component by invoking the contrac-example.jar:/p + sourcejava -jar contract-example.jar/source pAs you can see, you have to define constraints for all the parameters that your method will accept. You even have the possibility to provide a default value that will be used when no parameter value is provided. This means, that the parameter is optional./p - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/xdocs/style tigris.css maven.css project.css print.css project-colburne.css
dflorey 2004/10/17 10:04:28 Removed: i18n/xdocs/style tigris.css maven.css project.css print.css project-colburne.css Log: Removed stylesheets - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract build.xml
dflorey 2004/10/17 10:06:18 Modified:contract build.xml Log: Changes project name to commons-... Revision ChangesPath 1.2 +24 -3 jakarta-commons-sandbox/contract/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- build.xml 8 Oct 2004 09:36:20 - 1.1 +++ build.xml 17 Oct 2004 17:06:18 - 1.2 @@ -7,7 +7,7 @@ WebDAV projector build file === -- -project name=contract default=jar basedir=. +project name=commons-contract default=jar basedir=. !-- Give user a chance to override without editing this file (and without typing -D each time it compiles it) -- @@ -19,7 +19,7 @@ property name=optimize value=true / property name=version value=0.2 / - property name=name value=contract / + property name=name value=commons-contract / !-- === Set the properties related to the source tree @@ -27,6 +27,7 @@ -- property name=src.dir value=src / property name=java.dir value=${src.dir}/java / + property name=examples.dir value=${src.dir}/examples / property name=lib.dir value=lib / property name=docs.dir value=doc / property name=dist.dir value=dist / @@ -67,6 +68,10 @@ src path=${java.dir} / classpath refid=classpath / /javac + javac destdir=${build.classes} debug=${debug} deprecation=${deprecation} optimize=${optimize} + src path=${examples.dir} / + classpath refid=classpath / + /javac /target !-- @@ -77,7 +82,23 @@ target name=jar depends=build jar jarfile=${build.lib}/${name}-${version}.jar basedir=${build.classes} include name=org/apache/commons/contract/** / - fileset dir=${conf.dir}/ + exclude name=org/apache/commons/contract/example/** / + fileset dir=${conf.dir} + include name=constraints.xml / + include name=exceptions.xml / + include name=util.xml / + /fileset + /jar + jar jarfile=${build.lib}/${name}-examples-${version}.jar basedir=${build.classes} + include name=org/apache/commons/contract/example/** / + fileset dir=${conf.dir} + include name=example.xml / + /fileset +manifest + attribute name=Built-By value=Daniel Florey/ + attribute name=Main-Class value=org/apache/commons/contract/example/SimpleMain/ + attribute name=Class-Path value=commons-contract-0.2.jar ../../lib/commons-xmlio-0.1pre.jar ../../lib/commons-i18n-0.2.jar/ +/manifest /jar /target - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract project.xml project.properties
dflorey 2004/10/17 10:18:06 Modified:contract project.xml project.properties Log: Moved to commons-xmlio Revision ChangesPath 1.3 +4 -5 jakarta-commons-sandbox/contract/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/project.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- project.xml 15 Oct 2004 11:24:32 - 1.2 +++ project.xml 17 Oct 2004 17:18:06 - 1.3 @@ -34,11 +34,10 @@ idcommons-i18n/id version0.2/version /dependency - -!-- these two are required by maven -- -dependencyidxml-apis/idversion2.0.2/version/dependency -dependencyidxerces/idversion2.0.2/version/dependency -!-- /these two are required by maven -- +dependency + idcommons-xmlio/id + version0.1pre/version +/dependency /dependencies build 1.3 +2 -1 jakarta-commons-sandbox/contract/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/contract/project.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- project.properties15 Oct 2004 11:20:22 - 1.2 +++ project.properties17 Oct 2004 17:18:06 - 1.3 @@ -28,4 +28,5 @@ # # Jars set explicity by path. # -maven.jar.commons-i18n = ${basedir}/lib/commons-i18n-0.2.jar \ No newline at end of file +maven.jar.commons-i18n = ${basedir}/lib/commons-i18n-0.2.jar +maven.jar.commons-xmlio = ${basedir}/lib/commons-xmlio-0.1pre.jar \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n project.xml project.properties
dflorey 2004/10/17 10:19:20 Modified:i18n project.xml project.properties Log: Revision ChangesPath 1.9 +5 -7 jakarta-commons-sandbox/i18n/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- project.xml 9 Oct 2004 14:28:47 - 1.8 +++ project.xml 17 Oct 2004 17:19:20 - 1.9 @@ -53,10 +53,8 @@ dependencies dependency - groupIdxml-im-exporter/groupId - artifactIdxml-im-exporter/artifactId - version1.1/version - urlhttp://sourceforge.net/projects/xml-im-exporter/index.html/url + idcommons-xmlio/id + version0.1pre/version /dependency /dependencies 1.8 +1 -1 jakarta-commons-sandbox/i18n/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.properties,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- project.properties13 Oct 2004 16:11:12 - 1.7 +++ project.properties17 Oct 2004 17:19:20 - 1.8 @@ -28,4 +28,4 @@ # # Jars set explicity by path. # -maven.jar.xml-im-exporter = ${basedir}/lib/xml-im-exporter1.1.jar \ No newline at end of file +maven.jar.commons-xmlio = ${basedir}/lib/commons-xmlio-0.1pre.jar \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/lib commons-xmlio-0.1pre.jar xml-im-exporter.license xml-im-exporter1.1.jar
dflorey 2004/10/16 10:34:43 Added: i18n/lib commons-xmlio-0.1pre.jar Removed: i18n/lib xml-im-exporter.license xml-im-exporter1.1.jar Log: Moved to commons-xmlio Revision ChangesPath 1.1 jakarta-commons-sandbox/i18n/lib/commons-xmlio-0.1pre.jar Binary file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n build.xml
dflorey 2004/10/16 10:35:01 Modified:i18n build.xml Log: Changes project name to commons-... Revision ChangesPath 1.2 +2 -2 jakarta-commons-sandbox/i18n/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- build.xml 4 Oct 2004 13:41:10 - 1.1 +++ build.xml 16 Oct 2004 17:35:01 - 1.2 @@ -7,7 +7,7 @@ WebDAV projector build file === -- -project name=i18n default=jar basedir=. +project name=commons-i18n default=jar basedir=. !-- Give user a chance to override without editing this file (and without typing -D each time it compiles it) -- @@ -19,7 +19,7 @@ property name=optimize value=true / property name=version value=0.2 / - property name=name value=i18n / + property name=name value=commons-i18n / !-- === Set the properties related to the source tree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/lib commons-xmlio-0.1pre.jar commons-i18n-0.2.jar
dflorey 2004/10/16 10:35:17 Modified:contract/lib commons-i18n-0.2.jar Added: contract/lib commons-xmlio-0.1pre.jar Log: Moved to commons-xmlio Revision ChangesPath 1.2 +70 -67jakarta-commons-sandbox/contract/lib/commons-i18n-0.2.jar Binary file 1.1 jakarta-commons-sandbox/contract/lib/commons-xmlio-0.1pre.jar Binary file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n MessageManager.java
dflorey 2004/10/16 10:41:16 Modified:i18n/src/java/org/apache/commons/i18n MessageManager.java Log: Moved to commons-xmlio Revision ChangesPath 1.2 +7 -7 jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageManager.java Index: MessageManager.java === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18n/MessageManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MessageManager.java 4 Oct 2004 13:41:09 - 1.1 +++ MessageManager.java 16 Oct 2004 17:41:16 - 1.2 @@ -32,12 +32,12 @@ import java.util.logging.Level; import java.util.logging.Logger; +import org.apache.commons.i18n.MessageNotFoundException; +import org.apache.commons.xmlio.in.DefaultSimpleImportHandler; +import org.apache.commons.xmlio.in.SimpleImporter; +import org.apache.commons.xmlio.in.SimplePath; import org.xml.sax.InputSource; import org.xml.sax.helpers.AttributesImpl; - -import de.zeigermann.xml.simpleImporter.DefaultSimpleImportHandler; -import de.zeigermann.xml.simpleImporter.SimpleImporter; -import de.zeigermann.xml.simpleImporter.SimplePath; public class MessageManager { private static Logger logger = Logger.getLogger(MessageManager.class.getName()); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox buildall.sh
dflorey 2004/10/15 04:02:32 Modified:.buildall.sh Log: Added i18n Revision ChangesPath 1.2 +2 -2 jakarta-commons-sandbox/buildall.sh Index: buildall.sh === RCS file: /home/cvs/jakarta-commons-sandbox/buildall.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- buildall.sh 30 May 2004 22:58:56 - 1.1 +++ buildall.sh 15 Oct 2004 11:02:32 - 1.2 @@ -1,4 +1,4 @@ -#!/usr/local/bin/bash +#!/bin/bash # # Copyright 2003-2004 The Apache Software Foundation # @@ -18,7 +18,7 @@ ROOT=`pwd` LOGDIR=$ROOT/logs SITEDIR=$ROOT/site -COMPONENTS=attributes/site cache chain clazz compress convert email events feedparser functor id jjar mapper messenger resources scaffold sql threadpool transaction vfs workflow +COMPONENTS=attributes/site cache chain clazz compress convert email events feedparser functor id i18n jjar mapper messenger resources scaffold sql threadpool transaction vfs workflow rm -rf $LOGDIR mkdir -p $LOGDIR - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/xdocs/style - New directory
dflorey 2004/10/15 04:11:36 jakarta-commons-sandbox/contract/xdocs/style - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/xdocs navigation.xml
dflorey 2004/10/15 04:11:41 Modified:contract/xdocs navigation.xml Added: contract/xdocs/style project.css project-colburne.css maven.css tigris.css print.css Log: Added stylesheets Revision ChangesPath 1.1 jakarta-commons-sandbox/contract/xdocs/style/project.css Index: project.css === /* Copyright 2001-2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #banner, #banner td { background: #fff; color: #000; } #banner td { height: 100%; vertical-align: middle; } #banner img { max-height=100px; } 1.1 jakarta-commons-sandbox/contract/xdocs/style/project-colburne.css Index: project-colburne.css === /* Copyright 2001-2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* == */ /* XDOC 1.4 */ #banner, #banner td { background: #fff; color: #000; border: 0px; } #banner td { height: 100%; vertical-align: middle; } div#banner { border: 0px; } #bodycol h3 { padding: 4px 4px 4px 6px; border: 1px solid #999; color: #000; background-color: #aaf; margin-top: 2px; margin-bottom: 4px; font-size: 14px; font-weight: bold; } #bodycol h4 { padding: 4px 4px 4px 6px; border: 1px solid #999; color: #000; background-color: #ccf; margin-top: 2px; margin-bottom: 4px; font-size: 14px; font-weight: normal; } .app h3, .app h4, .tabs td, .tabs th, .functnbar { background-image: none; } /* == */ /* XDOC 1.5 */ /* Controls font size on left */ body, td, th, select, input, li{ font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; } /* Logo position */ #organizationLogo img, #projectLogo img { position: static; clear: both; } #organizationLogo img { margin-top: 20px; } #projectLogo img { margin-top: 5px; } /* Hyperlinks */ a { text-decoration: none; } a:link { color:#44f; } a:visited { color:#47a; } #navcolumn a:visited, #breadcrumbs a:visited { color:#44f; } a:active, a:hover { color:#69c; } /* Titles */ h2 { padding: 4px 4px 4px 6px; border: 1px solid #999; color: #000; background-color: #aaf; margin-top: 2px; margin-bottom: 4px; font-size: 14px; font-weight: bold; } h3 { padding: 4px 4px 4px 6px; border: 1px solid #999; color: #000; background-color: #ccf; margin-top: 2px; margin-bottom: 4px; font-size: 14px; font-weight: normal; } #bodycolumn p, #bodycolumn ul, #bodycolumn ol, #bodycolumn dl, #bodycolumn table { margin-top: .67em; margin-bottom: .67em; font-size: 13px; } #breadcrumbs { border-top: 1px solid #aaa; border-bottom: 1px solid #aaa; background-color: #ccc; } #leftColumn { margin: 0 0 0 0; width: 19%; border-right: 1px solid #999; border-bottom: 1px solid #999; background-color: #eee; } #navcolumn h5 { font-size: smaller; border-bottom: 1px solid #aa; padding-top: 2px; } table.bodyTable { border: 1px solid #000; } table.bodyTable th { color: white; background-color: #bbb; text-align: left; font-weight: bold; } table.bodyTable tr.a { background-color: #ddd; } table.bodyTable tr.b { background-color: #eee; } .source { border: 1px solid #999; } 1.1 jakarta-commons-sandbox/contract/xdocs/style/maven.css Index: maven.css
cvs commit: jakarta-commons-sandbox/contract project.properties
dflorey 2004/10/15 04:20:22 Modified:contract project.properties Log: Added style to project.properties Revision ChangesPath 1.2 +19 -0 jakarta-commons-sandbox/contract/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/contract/project.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.properties8 Oct 2004 09:36:20 - 1.1 +++ project.properties15 Oct 2004 11:20:22 - 1.2 @@ -1,5 +1,24 @@ +# Copyright 2004 The Apache Software Foundation +# +# Licensed under the Apache License, Version 2.0 (the License); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an AS IS BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. maven.javadoc.author=false maven.javadoc.links=http://java.sun.com/products/jdk/1.4/docs/api + +maven.xdoc.jsl=../../jakarta-commons/commons-build/commons-site.jsl +maven.xdoc.date=bottom +maven.xdoc.poweredby.image=maven-feather.png +maven.xdoc.version=${pom.currentVersion} +maven.xdoc.developmentProcessUrl=http://jakarta.apache.org/commons/charter.html # # M A V E N J A R O V E R R I D E - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract project.xml
dflorey 2004/10/15 04:24:32 Modified:contract project.xml Log: Added package declaration to project.xml Revision ChangesPath 1.2 +1 -0 jakarta-commons-sandbox/contract/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/project.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.xml 8 Oct 2004 09:36:20 - 1.1 +++ project.xml 15 Oct 2004 11:24:32 - 1.2 @@ -6,6 +6,7 @@ logo/images/contract-logo-white.png/logo urlhttp://jakarta.apache.org/commons/sandbox/contract//url inceptionYear2004/inceptionYear + packageorg.apache.commons.contract/package shortDescriptionCommons Contract/shortDescription descriptionContract based programming core/description - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox buildall.sh
dflorey 2004/10/15 04:27:40 Modified:.buildall.sh Log: added contract component Revision ChangesPath 1.3 +1 -1 jakarta-commons-sandbox/buildall.sh Index: buildall.sh === RCS file: /home/cvs/jakarta-commons-sandbox/buildall.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- buildall.sh 15 Oct 2004 11:02:32 - 1.2 +++ buildall.sh 15 Oct 2004 11:27:40 - 1.3 @@ -18,7 +18,7 @@ ROOT=`pwd` LOGDIR=$ROOT/logs SITEDIR=$ROOT/site -COMPONENTS=attributes/site cache chain clazz compress convert email events feedparser functor id i18n jjar mapper messenger resources scaffold sql threadpool transaction vfs workflow +COMPONENTS=attributes/site cache chain clazz compress contract convert email events feedparser functor id i18n jjar mapper messenger resources scaffold sql threadpool transaction vfs workflow rm -rf $LOGDIR mkdir -p $LOGDIR - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util MainWrapper.java
dflorey 2004/10/15 10:15:37 Modified:contract/src/java/org/apache/commons/contract/descriptor RequiredEnvironmentDescriptor.java ParameterDescriptor.java contract/src/java/org/apache/commons/contract Executor.java contract/src/java/org/apache/commons/contract/util MainWrapper.java Log: Modified build.xml to include examples Revision ChangesPath 1.2 +0 -1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/descriptor/RequiredEnvironmentDescriptor.java Index: RequiredEnvironmentDescriptor.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/descriptor/RequiredEnvironmentDescriptor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- RequiredEnvironmentDescriptor.java8 Oct 2004 09:36:20 - 1.1 +++ RequiredEnvironmentDescriptor.java15 Oct 2004 17:15:37 - 1.2 @@ -2,7 +2,6 @@ import org.apache.commons.contract.constraints.Constraints; import org.apache.commons.contract.i18n.ParameterMessage; -import org.apache.commons.i18n.LocalizedMessage; public class RequiredEnvironmentDescriptor extends ParameterDescriptor { protected String store; 1.2 +0 -1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/descriptor/ParameterDescriptor.java Index: ParameterDescriptor.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/descriptor/ParameterDescriptor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ParameterDescriptor.java 8 Oct 2004 09:36:20 - 1.1 +++ ParameterDescriptor.java 15 Oct 2004 17:15:37 - 1.2 @@ -2,7 +2,6 @@ import org.apache.commons.contract.constraints.Constraints; import org.apache.commons.contract.i18n.ParameterMessage; -import org.apache.commons.i18n.LocalizedMessage; public class ParameterDescriptor extends Descriptor { public final static ParameterDescriptor[] NO_PARAMETERS = new ParameterDescriptor[0]; 1.2 +0 -4 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/Executor.java Index: Executor.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/Executor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Executor.java 8 Oct 2004 09:36:20 - 1.1 +++ Executor.java 15 Oct 2004 17:15:37 - 1.2 @@ -2,9 +2,6 @@ import java.util.Map; -import org.apache.commons.contract.Context; -import org.apache.commons.contract.Processor; -import org.apache.commons.contract.Result; import org.apache.commons.contract.constraints.Constraints; import org.apache.commons.contract.constraints.ValidationException; import org.apache.commons.contract.descriptor.ParameterDescriptor; @@ -12,7 +9,6 @@ import org.apache.commons.contract.descriptor.ResultDescriptor; import org.apache.commons.contract.descriptor.ResultEntryDescriptor; import org.apache.commons.i18n.LocalizedError; -import org.apache.commons.i18n.LocalizedException; import org.apache.commons.i18n.MessageManager; public class Executor { 1.2 +0 -1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util/MainWrapper.java Index: MainWrapper.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util/MainWrapper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MainWrapper.java 8 Oct 2004 09:36:20 - 1.1 +++ MainWrapper.java 15 Oct 2004 17:15:37 - 1.2 @@ -20,7 +20,6 @@ package org.apache.commons.contract.util; import java.util.HashMap; -import java.util.Locale; import java.util.Map; import org.apache.commons.contract.Context; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example SimpleMain.java
dflorey 2004/10/15 10:33:52 Modified:contract/src/examples/org/apache/commons/contract/example SimpleMain.java Log: Organized imports Revision ChangesPath 1.2 +0 -1 jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example/SimpleMain.java Index: SimpleMain.java === RCS file: /home/cvs/jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example/SimpleMain.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SimpleMain.java 8 Oct 2004 10:44:57 - 1.1 +++ SimpleMain.java 15 Oct 2004 17:33:52 - 1.2 @@ -21,7 +21,6 @@ import org.apache.commons.contract.Result; import org.apache.commons.contract.util.InteractiveMainWrapper; -import org.apache.commons.contract.util.MainWrapper; import org.apache.commons.i18n.MessageManager; public class SimpleMain { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/xdocs quickstart.xml navigation.xml index.xml
dflorey 2004/10/15 10:34:12 Modified:contract/xdocs navigation.xml index.xml Added: contract/xdocs quickstart.xml Log: Started documentation Revision ChangesPath 1.3 +1 -1 jakarta-commons-sandbox/contract/xdocs/navigation.xml Index: navigation.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/xdocs/navigation.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- navigation.xml15 Oct 2004 11:11:41 - 1.2 +++ navigation.xml15 Oct 2004 17:34:12 - 1.3 @@ -5,7 +5,7 @@ body menu name=Commons#xA0;Transaction item name=Overview href=/index.html / -!--item name=Quickstart href=/quickstart.html /-- +item name=Getting started href=/quickstart.html / !--item name=Configuration href=/configuration.html / -- !-- item name=Developers#xA0;Guide href=/guide/index.html collapse=true 1.2 +4 -0 jakarta-commons-sandbox/contract/xdocs/index.xml Index: index.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/xdocs/index.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- index.xml 8 Oct 2004 09:36:18 - 1.1 +++ index.xml 15 Oct 2004 17:34:12 - 1.2 @@ -14,6 +14,10 @@ The contract component delivers the contract based programming core that is currently used in the Slide Projector project. /p +p +This component makes all the nice features available to the java programming language that +come along with contract based programming. +/p /section section name=Releases 1.1 jakarta-commons-sandbox/contract/xdocs/quickstart.xml Index: quickstart.xml === ?xml version=1.0? document properties titleGetting started/title author email=[EMAIL PROTECTED]Commons Documentation Team/author /properties body section name=Getting started pIn order to get an impression of how this component works, we will start with an example showing the capabilities of this package./p pTo get started you need at least the jar of this component and the dependent i18n.jar in your classpath./p /section section name=What is contract based programming? pYou already know contract based programming if you've ever implemented a java method: You specify a contract that defines which types of parameters are accepted by your method. This is how a method might look like:/p source public float calculateSpeed(float distance, float time, String unit) { ...calculate speed... return speed; } /source pSo your method will accept two floats that pass the distance and the time to the method. Additionally the method requires the unit in which the time was measured. You can tell this by using the appropriated types, that reflect the desired values. But you cannot declare, which value ranges are valid for your method. You might only accept values larger than zero for the time and only s, min and h for the unit./p pTo get started you need at least the jar of this component and the dependent i18n.jar in your classpath./p /section /body /document - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/xdocs quickstart.xml navigation.xml
dflorey 2004/10/15 10:57:27 Modified:contract/xdocs quickstart.xml navigation.xml Log: Revision ChangesPath 1.2 +63 -6 jakarta-commons-sandbox/contract/xdocs/quickstart.xml Index: quickstart.xml === RCS file: /home/cvs/jakarta-commons-sandbox/contract/xdocs/quickstart.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- quickstart.xml15 Oct 2004 17:34:12 - 1.1 +++ quickstart.xml15 Oct 2004 17:57:27 - 1.2 @@ -16,8 +16,8 @@ /section section name=What is contract based programming? pYou already know contract based programming if you've ever implemented a java method: You specify -a contract that defines which types of parameters are accepted by your method. This is how a method -might look like:/p +a contract that defines which types of parameters are accepted by your method and you specify the +type of tbe return value. This is how a method might look like that calcalutes speed:/p source public float calculateSpeed(float distance, float time, String unit) { ...calculate speed... @@ -26,10 +26,67 @@ /source pSo your method will accept two floats that pass the distance and the time to the method. Additionally the method requires the unit in which the time was measured. You can tell this by using the appropriated - types, that reflect the desired values. But you cannot declare, which value ranges are valid for your - method. You might only accept values larger than zero for the time and only s, min and h for the - unit./p - pTo get started you need at least the jar of this component and the dependent i18n.jar in your classpath./p + types, that reflect the desired values./p +pBut you cannot declare, which value ranges are valid for the parameters of your method. + You might only accept values larger than zero for the time and only s, min and h for the + measuring unit. Imagine that you want to provide a simple program, that allows the user to enter + these three parameters and you want to provide the calculated speed. To calculate the speed is + the very easy task, but as you might already know it is a lot more work to handle all possible errors, + to display the user in a localized way which values are accepted and so on./p + pThis is the moment where the contract component comes into play! You have to declare the possible + values that are accepted by your method and the result that will be provided, but this effort + will be donated by handling all the rest. Let's have a look at the sources of the SpeedCalculator that + is provided as an example in the sources of this component:/p + source +public class SpeedCalculator implements Processor { +public final static String SPEED = speed; + +private final static String DISTANCE = distance; +private final static String TIME = time; +private final static String UNIT = unit; +private final static String SECONDS = s; +private final static String MINUTES = min; +private final static String HOURS = h; + +ParameterDescriptor[] parameterDescriptors = new ParameterDescriptor[]{ +new ParameterDescriptor(DISTANCE, new ParameterMessage(computeSpeed/parameter/distance), +new NumberConstraints( +new Integer(0), null, true)), +new ParameterDescriptor(UNIT, new ParameterMessage(computeSpeed/parameter/unit), +new StringConstraints( +new String[]{SECONDS, MINUTES, HOURS})), +new ParameterDescriptor(TIME, new ParameterMessage(computeSpeed/parameter/time), +NumberConstraints.POSITIVE)}; + +ResultDescriptor[] resultDescriptors = new ResultDescriptor[]{new ResultDescriptor( +StateDescriptor.OK_DESCRIPTOR, +new ResultEntryDescriptor[]{new ResultEntryDescriptor(SPEED, +new LocalizedMessage(computeSpeed/result/speed), +new NumberConstraints(new Float(0.1), new Integer(Integer.MAX_VALUE)))})}; + +public Result process(Map parameters, Context context) { +float distance = ((Number)parameters.get(DISTANCE)).floatValue(); +float time = ((Number)parameters.get(TIME)).floatValue(); +String timeUnit = (String)parameters.get(UNIT); +float speed; +if (timeUnit.equals(s)) speed = distance / time; +else if (timeUnit.equals(min)) speed = distance*60 / time; +else speed = distance*3600 / time; +return new Result(StateDescriptor.OK, SPEED, new Float(speed)); +} + +public ParameterDescriptor[] getParameterDescriptors
cvs commit: jakarta-commons-sandbox/i18n/xdocs/style - New directory
dflorey 2004/10/13 09:09:47 jakarta-commons-sandbox/i18n/xdocs/style - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/xdocs/style maven.css print.css project-colburne.css project.css tigris.css
dflorey 2004/10/13 09:10:17 Added: i18n/xdocs/style maven.css print.css project-colburne.css project.css tigris.css Log: Added missing stylesheets Revision ChangesPath 1.1 jakarta-commons-sandbox/i18n/xdocs/style/maven.css Index: maven.css === body { background: #fff; color: #000; } .app h3 { color: #fff; background-color: #036; } .app h4 { color: #fff; background-color: #888; } .a td { background: #ddd; color: #000; } .b td { background: #efefef; color: #000; } .app th { background-color: #bbb; color: #fff; } div#banner { border-top: 1px solid #369; border-bottom: 1px solid #003; } #banner, #banner td { background: #036; color: #fff; } #leftcol { background: #eee; color: #000; border-right: 1px solid #aaa; border-bottom: 1px solid #aaa; border-top: 1px solid #fff; } #navcolumn { background: #eee; color: #000; border-right: none; border-bottom: none; border-top: none; } #breadcrumbs { background-color: #ddd; color: #000; border-top: 1px solid #fff; border-bottom: 1px solid #aaa; } #source { background-color: #fff; color: #000; border-right: 1px solid #888; border-left: 1px solid #888; border-top: 1px solid #888; border-bottom: 1px solid #888; margin-right: 7px; margin-left: 7px; margin-top: 1em; } #source pre { margin-right: 7px; margin-left: 7px; } a[name]:hover, #leftcol a[name]:hover { color: inherit !important; } a:link, #breadcrumbs a:visited, #navcolumn a:visited, .app a:visited, .tasknav a:visited { color: blue; } a:active, a:hover, #leftcol a:active, #leftcol a:hover { color: #f30 !important; } a:link.selfref, a:visited.selfref { color: #555 !important; } h3, h4 { margin-top: 1em; margin-bottom: 0; } img.handle { border: 0; padding-right: 2px; } #navcolumn div div { background-image: none; background-repeat: no-repeat; } #navcolumn div div { padding-left: 10px; } 1.1 jakarta-commons-sandbox/i18n/xdocs/style/print.css Index: print.css === #banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn { display: none; } #bodyColumn, body.docs div.docs { margin: 0 !important; border: none !important } 1.1 jakarta-commons-sandbox/i18n/xdocs/style/project-colburne.css Index: project-colburne.css === /* Copyright 2001-2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* == */ /* XDOC 1.4 */ #banner, #banner td { background: #fff; color: #000; border: 0px; } #banner td { height: 100%; vertical-align: middle; } div#banner { border: 0px; } #bodycol h3 { padding: 4px 4px 4px 6px; border: 1px solid #999; color: #000; background-color: #aaf; margin-top: 2px; margin-bottom: 4px; font-size: 14px; font-weight: bold; } #bodycol h4 { padding: 4px 4px 4px 6px; border: 1px solid #999; color: #000; background-color: #ccf; margin-top: 2px; margin-bottom: 4px; font-size: 14px; font-weight: normal; } .app h3, .app h4, .tabs td, .tabs th, .functnbar { background-image: none; } /* == */ /* XDOC 1.5 */ /* Controls font size on left */ body, td, th, select, input, li{ font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; } /* Logo position */ #organizationLogo img, #projectLogo img { position: static; clear: both; } #organizationLogo img { margin-top: 20px; } #projectLogo img { margin-top: 5px; } /* Hyperlinks */ a { text-decoration: none; } a:link { color:#44f; } a:visited { color:#47a; } #navcolumn a:visited, #breadcrumbs a:visited
cvs commit: jakarta-commons-sandbox/i18n project.properties
dflorey 2004/10/13 09:11:12 Modified:i18n project.properties Log: Added properties for javadocs Revision ChangesPath 1.7 +2 -0 jakarta-commons-sandbox/i18n/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- project.properties9 Oct 2004 14:40:38 - 1.6 +++ project.properties13 Oct 2004 16:11:12 - 1.7 @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +maven.javadoc.author=false +maven.javadoc.links=http://java.sun.com/products/jdk/1.4/docs/api maven.xdoc.jsl=../../jakarta-commons/commons-build/commons-site.jsl maven.xdoc.date=bottom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n project.xml project.properties
dflorey 2004/10/09 04:12:36 Modified:i18n project.xml project.properties Log: Modifications recommended by Tim Rilley Revision ChangesPath 1.5 +25 -2 jakarta-commons-sandbox/i18n/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- project.xml 6 Oct 2004 08:48:07 - 1.4 +++ project.xml 9 Oct 2004 11:12:36 - 1.5 @@ -1,7 +1,30 @@ +/* + * $Header$ + * $Revision$ + * $Date$ + * + * + * + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + ?xml version=1.0? project - extend../sandbox-build/project.xml/extend - nameCommons I18n/name + extend${commons.project.extendsUri}project.xml/extend + nameCommons i18n/name idcommons-i18n/id logo/images/i18n-logo-white.png/logo urlhttp://jakarta.apache.org/commons/sandbox/i18n//url 1.4 +1 -1 jakarta-commons-sandbox/i18n/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- project.properties6 Oct 2004 08:48:07 - 1.3 +++ project.properties9 Oct 2004 11:12:36 - 1.4 @@ -2,11 +2,11 @@ # uncomment the next line to work in offline mode (no jar download no linkcheck) #maven.mode.online= +commons.project.extendsUri=../sandbox-build/ maven.javadoc.debug=yes maven.javadoc.author=false maven.javadoc.links=http://java.sun.com/products/jdk/1.4/docs/api - maven.xdoc.jsl=../../jakarta-commons/commons-build/commons-site.jsl maven.xdoc.date=bottom maven.xdoc.poweredby.image=maven-feather.png - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n project.xml
dflorey 2004/10/09 04:19:49 Modified:i18n project.xml Log: Added ASL-2.0 Revision ChangesPath 1.6 +22 -23jakarta-commons-sandbox/i18n/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- project.xml 9 Oct 2004 11:12:36 - 1.5 +++ project.xml 9 Oct 2004 11:19:49 - 1.6 @@ -1,27 +1,26 @@ -/* - * $Header$ - * $Revision$ - * $Date$ - * - * - * - * Copyright 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - ?xml version=1.0? +!-- + $Header$ + $Revision$ + $Date$ + + + + Copyright 2004 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the License); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an AS IS BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-- + project extend${commons.project.extendsUri}project.xml/extend nameCommons i18n/name - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n project.xml
dflorey 2004/10/09 07:15:02 Modified:i18n project.xml Log: Next try to get it work. Thanks to Jörg Schaible Revision ChangesPath 1.7 +4 -3 jakarta-commons-sandbox/i18n/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- project.xml 9 Oct 2004 11:19:49 - 1.6 +++ project.xml 9 Oct 2004 14:15:02 - 1.7 @@ -28,6 +28,7 @@ logo/images/i18n-logo-white.png/logo urlhttp://jakarta.apache.org/commons/sandbox/i18n//url inceptionYear2004/inceptionYear + packageorg.apache.commons.i18n/package shortDescriptionCommons I18n/shortDescription descriptionInternationalization package/description - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n project.xml project.properties
dflorey 2004/10/09 07:28:47 Modified:i18n project.xml project.properties Log: Simplify project properties Revision ChangesPath 1.8 +5 -5 jakarta-commons-sandbox/i18n/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- project.xml 9 Oct 2004 14:15:02 - 1.7 +++ project.xml 9 Oct 2004 14:28:47 - 1.8 @@ -22,8 +22,8 @@ -- project - extend${commons.project.extendsUri}project.xml/extend - nameCommons i18n/name + extend../sandbox-build/project.xml/extend + nameCommons I18n/name idcommons-i18n/id logo/images/i18n-logo-white.png/logo urlhttp://jakarta.apache.org/commons/sandbox/i18n//url 1.5 +1 -28 jakarta-commons-sandbox/i18n/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- project.properties9 Oct 2004 11:12:36 - 1.4 +++ project.properties9 Oct 2004 14:28:47 - 1.5 @@ -1,30 +1,3 @@ -maven.checkstyle.properties = checkstyle.xml - -# uncomment the next line to work in offline mode (no jar download no linkcheck) -#maven.mode.online= -commons.project.extendsUri=../sandbox-build/ - -maven.javadoc.debug=yes -maven.javadoc.author=false -maven.javadoc.links=http://java.sun.com/products/jdk/1.4/docs/api -maven.xdoc.jsl=../../jakarta-commons/commons-build/commons-site.jsl -maven.xdoc.date=bottom -maven.xdoc.poweredby.image=maven-feather.png -maven.xdoc.version=${pom.currentVersion} -maven.xdoc.developmentProcessUrl=http://jakarta.apache.org/commons/charter.html - -maven.compile.debug=on -maven.compile.deprecation=off -maven.compile.optimize=off - -maven.jarResources.basedir=src/java -maven.jar.excludes=**/package.html -maven.junit.fork=true -maven.junit.sysproperties=org.xml.sax.driver -org.xml.sax.driver=org.apache.xerces.parsers.SAXParser - -clover.excludes=**/Test*.java - # # M A V E N J A R O V E R R I D E # @@ -33,4 +6,4 @@ # # Jars set explicity by path. # -maven.jar.xml-im-exporter = ${basedir}/lib/xml-im-exporter1.1.jar +maven.jar.xml-im-exporter = ${basedir}/lib/xml-im-exporter1.1.jar \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n/xdocs navigation.xml
dflorey 2004/10/09 07:36:46 Modified:i18n/xdocs navigation.xml Log: Copy paste bug fixed... Revision ChangesPath 1.4 +1 -1 jakarta-commons-sandbox/i18n/xdocs/navigation.xml Index: navigation.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/xdocs/navigation.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- navigation.xml5 Oct 2004 18:05:50 - 1.3 +++ navigation.xml9 Oct 2004 14:36:46 - 1.4 @@ -3,7 +3,7 @@ project name=Commons#xA0;I18n titleCommons#xA0;I18n/title body -menu name=Commons#xA0;Transaction +menu name=Commons#xA0;I18n item name=Overview href=/index.html / item name=Getting startedhref=/quickstart.html / item name=API#xA0;Documentationhref=/apidocs/index.html/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n project.properties
dflorey 2004/10/09 07:40:38 Modified:i18n project.properties Log: Simplify project properties Revision ChangesPath 1.6 +20 -0 jakarta-commons-sandbox/i18n/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- project.properties9 Oct 2004 14:28:47 - 1.5 +++ project.properties9 Oct 2004 14:40:38 - 1.6 @@ -1,3 +1,23 @@ +# Copyright 2004 The Apache Software Foundation +# +# Licensed under the Apache License, Version 2.0 (the License); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an AS IS BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +maven.xdoc.jsl=../../jakarta-commons/commons-build/commons-site.jsl +maven.xdoc.date=bottom +maven.xdoc.poweredby.image=maven-feather.png +maven.xdoc.version=${pom.currentVersion} +maven.xdoc.developmentProcessUrl=http://jakarta.apache.org/commons/charter.html + # # M A V E N J A R O V E R R I D E # - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/descriptor - New directory
dflorey 2004/10/08 02:36:08 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/descriptor - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/example - New directory
dflorey 2004/10/08 02:36:08 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/example - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/xdocs/images - New directory
dflorey 2004/10/08 02:36:08 jakarta-commons-sandbox/contract/xdocs/images - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/context - New directory
dflorey 2004/10/08 02:36:07 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/context - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache - New directory
dflorey 2004/10/08 02:36:07 jakarta-commons-sandbox/contract/src/java/org/apache - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints - New directory
dflorey 2004/10/08 02:36:07 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src - New directory
dflorey 2004/10/08 02:36:07 jakarta-commons-sandbox/contract/src - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/config - New directory
dflorey 2004/10/08 02:36:07 jakarta-commons-sandbox/contract/src/config - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/i18n - New directory
dflorey 2004/10/08 02:36:08 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/i18n - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java - New directory
dflorey 2004/10/08 02:36:07 jakarta-commons-sandbox/contract/src/java - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract - New directory
dflorey 2004/10/08 02:36:07 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/xdocs - New directory
dflorey 2004/10/08 02:36:08 jakarta-commons-sandbox/contract/xdocs - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util - New directory
dflorey 2004/10/08 02:36:08 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/util - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract - New directory
dflorey 2004/10/08 02:36:07 jakarta-commons-sandbox/contract - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org - New directory
dflorey 2004/10/08 02:36:07 jakarta-commons-sandbox/contract/src/java/org - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/store - New directory
dflorey 2004/10/08 02:36:08 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/store - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/java/org/apache/commons - New directory
dflorey 2004/10/08 02:36:07 jakarta-commons-sandbox/contract/src/java/org/apache/commons - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/lib - New directory
dflorey 2004/10/08 02:36:07 jakarta-commons-sandbox/contract/lib - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/xdocs/images contract-logo-white.png
dflorey 2004/10/08 02:36:21 Added: contract/xdocs index.xml downloads.xml navigation.xml contract/src/java/org/apache/commons/contract/constraints NumberConstraints.java CastException.java Constraints.java ArrayConstraints.java MapConstraints.java ListConstraints.java Castable.java DateConstraints.java TreeConstraints.java ValidationException.java BooleanConstraints.java LocaleConstraints.java Unconstrained.java StringConstraints.java Validatable.java contract project.properties NOTICE.txt project.xml build.xml LICENSE.txt contract/src/java/org/apache/commons/contract/util InteractiveMainWrapper.java MainWrapper.java contract/src/config constraints.xml example.xml util.xml exceptions.xml contract/src/java/org/apache/commons/contract Result.java Context.java Processor.java Executor.java EnvironmentProvider.java Store.java EnvironmentConsumer.java StoreException.java ContractViolationException.java contract/src/java/org/apache/commons/contract/context VMContext.java contract/src/java/org/apache/commons/contract/example SimpleMain.java SpeedCalculator.java contract/src/java/org/apache/commons/contract/descriptor Descriptor.java ResultDescriptor.java RequiredEnvironmentDescriptor.java ResultEntryDescriptor.java ParameterDescriptor.java ProvidedEnvironmentDescriptor.java StateDescriptor.java contract/src/java/org/apache/commons/contract/i18n ParameterMessage.java contract/lib commons-i18n-0.2.jar contract/src/java/org/apache/commons/contract/store Environment.java contract/xdocs/images contract-logo-white.png Log: Extracted contract based programming core from Slide Projector to commons sandbox Revision ChangesPath 1.1 jakarta-commons-sandbox/contract/xdocs/index.xml http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/contract/xdocs/index.xml?rev=1.1 1.1 jakarta-commons-sandbox/contract/xdocs/downloads.xml http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/contract/xdocs/downloads.xml?rev=1.1 1.1 jakarta-commons-sandbox/contract/xdocs/navigation.xml http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/contract/xdocs/navigation.xml?rev=1.1 1.1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/NumberConstraints.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/NumberConstraints.java?rev=1.1 1.1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/CastException.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/CastException.java?rev=1.1 1.1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/Constraints.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/Constraints.java?rev=1.1 1.1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/ArrayConstraints.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/ArrayConstraints.java?rev=1.1 1.1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/MapConstraints.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/MapConstraints.java?rev=1.1 1.1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/ListConstraints.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/ListConstraints.java?rev=1.1 1.1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/Castable.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints/Castable.java?rev=1.1 1.1 jakarta-commons-sandbox/contract/src/java/org/apache/commons/contract/constraints
cvs commit: jakarta-commons-sandbox/contract/src/examples - New directory
dflorey 2004/10/08 03:44:53 jakarta-commons-sandbox/contract/src/examples - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/examples/org - New directory
dflorey 2004/10/08 03:44:53 jakarta-commons-sandbox/contract/src/examples/org - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/examples/org/apache/commons - New directory
dflorey 2004/10/08 03:44:53 jakarta-commons-sandbox/contract/src/examples/org/apache/commons - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/examples/org/apache - New directory
dflorey 2004/10/08 03:44:53 jakarta-commons-sandbox/contract/src/examples/org/apache - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example SpeedCalculator.java SimpleMain.java
dflorey 2004/10/08 03:44:57 Added: contract/src/examples/org/apache/commons/contract/example SpeedCalculator.java SimpleMain.java Removed: contract/src/java/org/apache/commons/contract/example SpeedCalculator.java SimpleMain.java Log: Moven examples from main jar to examples jar Revision ChangesPath 1.1 jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example/SpeedCalculator.java Index: SpeedCalculator.java === /* * * * * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the License); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. * */ package org.apache.commons.contract.example; import java.util.Map; import org.apache.commons.contract.Context; import org.apache.commons.contract.Processor; import org.apache.commons.contract.Result; import org.apache.commons.contract.constraints.NumberConstraints; import org.apache.commons.contract.constraints.StringConstraints; import org.apache.commons.contract.descriptor.ParameterDescriptor; import org.apache.commons.contract.descriptor.ResultDescriptor; import org.apache.commons.contract.descriptor.ResultEntryDescriptor; import org.apache.commons.contract.descriptor.StateDescriptor; import org.apache.commons.contract.i18n.ParameterMessage; import org.apache.commons.i18n.LocalizedMessage; public class SpeedCalculator implements Processor { public final static String SPEED = speed; private final static String DISTANCE = distance; private final static String TIME = time; private final static String UNIT = unit; private final static String SECONDS = s; private final static String MINUTES = min; private final static String HOURS = h; ParameterDescriptor[] parameterDescriptors = new ParameterDescriptor[]{ new ParameterDescriptor(DISTANCE, new ParameterMessage(computeSpeed/parameter/distance), new NumberConstraints( new Integer(0), null, true)), new ParameterDescriptor(UNIT, new ParameterMessage(computeSpeed/parameter/unit), new StringConstraints( new String[]{SECONDS, MINUTES, HOURS})), new ParameterDescriptor(TIME, new ParameterMessage(computeSpeed/parameter/time), NumberConstraints.POSITIVE)}; ResultDescriptor[] resultDescriptors = new ResultDescriptor[]{new ResultDescriptor( StateDescriptor.OK_DESCRIPTOR, new ResultEntryDescriptor[]{new ResultEntryDescriptor(SPEED, new LocalizedMessage(computeSpeed/result/speed), new NumberConstraints(new Float(0.1), new Integer(Integer.MAX_VALUE)))})}; /** * Computes the speed in meter per second from the given distance and time. * The time can be given in seconds, minutes or hours, depending on the * content of timeUnit. */ public Result process(Map parameters, Context context) { float distance = ((Number)parameters.get(DISTANCE)).floatValue(); float time = ((Number)parameters.get(TIME)).floatValue(); String timeUnit = (String)parameters.get(UNIT); float speed; if (timeUnit.equals(s)) speed = distance / time; else if (timeUnit.equals(min)) speed = distance*60 / time; else speed = distance*3600 / time; return new Result(StateDescriptor.OK, SPEED, new Float(speed)); } public ParameterDescriptor[] getParameterDescriptors() { return parameterDescriptors; } public ResultDescriptor[] getResultDescriptors() { return resultDescriptors; } } 1.1 jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example/SimpleMain.java Index: SimpleMain.java === /* * * * * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may
cvs commit: jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract - New directory
dflorey 2004/10/08 03:44:53 jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example - New directory
dflorey 2004/10/08 03:44:53 jakarta-commons-sandbox/contract/src/examples/org/apache/commons/contract/example - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n project.properties
dflorey 2004/10/06 01:38:29 Modified:i18n project.properties Log: Revision ChangesPath 1.2 +24 -0 jakarta-commons-sandbox/i18n/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.properties4 Oct 2004 13:41:10 - 1.1 +++ project.properties6 Oct 2004 08:38:29 - 1.2 @@ -1,5 +1,29 @@ +maven.checkstyle.properties = checkstyle.xml + +# uncomment the next line to work in offline mode (no jar download no linkcheck) +#maven.mode.online= + +maven.javadoc.debug=yes maven.javadoc.author=false maven.javadoc.links=http://java.sun.com/products/jdk/1.4/docs/api + +maven.xdoc.jsl=../../jakarta-commons/commons-build/commons-site.jsl +maven.xdoc.date=bottom +maven.xdoc.poweredby.image=maven-feather.png +maven.xdoc.version=${pom.currentVersion} +maven.xdoc.developmentProcessUrl=http://jakarta.apache.org/commons/charter.html + +maven.compile.debug=on +maven.compile.deprecation=off +maven.compile.optimize=off + +maven.jarResources.basedir=src/java +maven.jar.excludes=**/package.html +maven.junit.fork=true +maven.junit.sysproperties=org.xml.sax.driver +org.xml.sax.driver=org.apache.xerces.parsers.SAXParser + +clover.excludes=**/Test*.java # # M A V E N J A R O V E R R I D E - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n project.xml
dflorey 2004/10/06 01:44:01 Modified:i18n project.xml Log: Revision ChangesPath 1.3 +5 -0 jakarta-commons-sandbox/i18n/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- project.xml 5 Oct 2004 21:05:44 - 1.2 +++ project.xml 6 Oct 2004 08:44:01 - 1.3 @@ -34,6 +34,11 @@ version1.1/version urlhttp://sourceforge.net/projects/xml-im-exporter/index.html/url /dependency + +!-- these two are required by maven -- +dependencyidxml-apis/idversion2.0.2/version/dependency +dependencyidxerces/idversion2.0.2/version/dependency +!-- /these two are required by maven -- /dependencies build - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/i18n project.properties project.xml
dflorey 2004/10/06 01:48:08 Modified:i18n project.properties project.xml Log: Makes them look like in sandbox-transaction Revision ChangesPath 1.3 +1 -1 jakarta-commons-sandbox/i18n/project.properties Index: project.properties === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- project.properties6 Oct 2004 08:38:29 - 1.2 +++ project.properties6 Oct 2004 08:48:07 - 1.3 @@ -33,4 +33,4 @@ # # Jars set explicity by path. # -maven.jar.xml-im-exporter = ${basedir}/lib/xml-im-exporter1.1.jar \ No newline at end of file +maven.jar.xml-im-exporter = ${basedir}/lib/xml-im-exporter1.1.jar 1.4 +1 -5 jakarta-commons-sandbox/i18n/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons-sandbox/i18n/project.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- project.xml 6 Oct 2004 08:44:01 - 1.3 +++ project.xml 6 Oct 2004 08:48:07 - 1.4 @@ -1,5 +1,6 @@ ?xml version=1.0? project + extend../sandbox-build/project.xml/extend nameCommons I18n/name idcommons-i18n/id logo/images/i18n-logo-white.png/logo @@ -34,11 +35,6 @@ version1.1/version urlhttp://sourceforge.net/projects/xml-im-exporter/index.html/url /dependency - -!-- these two are required by maven -- -dependencyidxml-apis/idversion2.0.2/version/dependency -dependencyidxerces/idversion2.0.2/version/dependency -!-- /these two are required by maven -- /dependencies build - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]