ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework Resources.properties AbstractContainerTask.java AbstractTypeDef.java Condition.java Pattern.java TypeInstanceTask.java
Date Thu, 30 Aug 2001 03:34:36 GMT
donaldp     01/08/29 20:34:36

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/framework
                        AbstractContainerTask.java AbstractTypeDef.java
                        Condition.java Pattern.java TypeInstanceTask.java
  Added:       proposal/myrmidon/src/java/org/apache/myrmidon/framework
                        Resources.properties
  Log:
  i18n'ed most of framework.
  
  Revision  Changes    Path
  1.4       +16 -9     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/AbstractContainerTask.java
  
  Index: AbstractContainerTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/AbstractContainerTask.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractContainerTask.java	2001/07/08 07:16:38	1.3
  +++ AbstractContainerTask.java	2001/08/30 03:34:36	1.4
  @@ -7,6 +7,10 @@
    */
   package org.apache.myrmidon.framework;
   
  +import org.apache.avalon.excalibur.i18n.ResourceManager;
  +import org.apache.avalon.excalibur.i18n.Resources;
  +import org.apache.avalon.excalibur.property.PropertyException;
  +import org.apache.avalon.excalibur.property.PropertyUtil;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  @@ -14,13 +18,11 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.myrmidon.converter.Converter;
  -import org.apache.myrmidon.converter.ConverterException;
   import org.apache.myrmidon.components.configurer.Configurer;
   import org.apache.myrmidon.components.converter.MasterConverter;
   import org.apache.myrmidon.components.executor.Executor;
  -import org.apache.avalon.excalibur.property.PropertyException;
  -import org.apache.avalon.excalibur.property.PropertyUtil;
  +import org.apache.myrmidon.converter.Converter;
  +import org.apache.myrmidon.converter.ConverterException;
   
   /**
    * This is the class that Task writers should extend to provide custom tasks.
  @@ -31,6 +33,9 @@
       extends AbstractTask
       implements Composable
   {
  +    private static final Resources REZ =
  +        ResourceManager.getPackageResources( AbstractContainerTask.class );
  +
       ///For converting own attributes
       private MasterConverter     m_converter;
   
  @@ -60,20 +65,21 @@
       {
           try
           {
  -            final Object object = 
  +            final Object object =
                   PropertyUtil.resolveProperty( value, getContext(), false );
   
               if( null == object )
               {
  -                throw new ConfigurationException( "Value (" + value +
  -                                                  ") resolved to null" );
  +                final String message = REZ.getString( "container.null-value.error", value
);
  +                throw new ConfigurationException( message );
               }
   
               return object;
           }
           catch( final PropertyException pe )
           {
  -            throw new ConfigurationException( "Error resolving value: " + value, pe );
  +            final String message = REZ.getString( "container.bad-resolve.error", value
);
  +            throw new ConfigurationException( message, pe );
           }
       }
   
  @@ -94,7 +100,8 @@
           }
           catch( final ConverterException ce )
           {
  -            throw new ConfigurationException( "Error converting value", ce );
  +            final String message = REZ.getString( "container.bad-config.error" );
  +            throw new ConfigurationException( message, ce );
           }
       }
   
  
  
  
  1.5       +13 -4     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/AbstractTypeDef.java
  
  Index: AbstractTypeDef.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/AbstractTypeDef.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractTypeDef.java	2001/07/08 07:17:38	1.4
  +++ AbstractTypeDef.java	2001/08/30 03:34:36	1.5
  @@ -10,6 +10,8 @@
   import java.io.File;
   import java.net.URL;
   import java.net.URLClassLoader;
  +import org.apache.avalon.excalibur.i18n.ResourceManager;
  +import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  @@ -31,6 +33,9 @@
       extends AbstractTask
       implements Composable
   {
  +    private static final Resources REZ =
  +        ResourceManager.getPackageResources( AbstractTypeDef.class );
  +
       private File                m_lib;
       private String              m_name;
       private String              m_className;
  @@ -65,11 +70,13 @@
       {
           if( null == m_name )
           {
  -            throw new TaskException( "Must specify name parameter" );
  +            final String message = REZ.getString( "typedef.no-name.error" );
  +            throw new TaskException( message );
           }
           else if( null == m_className )
           {
  -            throw new TaskException( "Must specify classname parameter" );
  +            final String message = REZ.getString( "typedef.no-classname.error" );
  +            throw new TaskException( message );
           }
   
           final String typeName = getTypeName();
  @@ -82,7 +89,8 @@
           try { m_typeManager.registerType( role, m_name, factory ); }
           catch( final TypeException te )
           {
  -            throw new TaskException( "Failed to register type", te );
  +            final String message = REZ.getString( "typedef.no-register.error" );
  +            throw new TaskException( message, te );
           }
       }
   
  @@ -100,7 +108,8 @@
           }
           catch( final Exception e )
           {
  -            throw new TaskException( "Failed to build classLoader due to: " + e, e );
  +            final String message = REZ.getString( "typedef.bad-classloader.error", e );
  +            throw new TaskException( message, e );
           }
       }
   
  
  
  
  1.4       +7 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/Condition.java
  
  Index: Condition.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/Condition.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Condition.java	2001/07/08 07:23:14	1.3
  +++ Condition.java	2001/08/30 03:34:36	1.4
  @@ -7,6 +7,8 @@
    */
   package org.apache.myrmidon.framework;
   
  +import org.apache.avalon.excalibur.i18n.ResourceManager;
  +import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.excalibur.property.PropertyException;
   import org.apache.avalon.excalibur.property.PropertyUtil;
   import org.apache.avalon.framework.component.Component;
  @@ -22,6 +24,9 @@
   public class Condition
       implements Component
   {
  +    private static final Resources REZ =
  +        ResourceManager.getPackageResources( Condition.class );
  +
       private String            m_condition;
       private boolean           m_isIfCondition;
   
  @@ -66,7 +71,8 @@
           }
           catch( final PropertyException pe )
           {
  -            throw new ContextException( "Error resolving " + m_condition, pe );
  +            final String message = REZ.getString( "condition.no-resolve.error", m_condition
);
  +            throw new ContextException( message, pe );
           }
   
           if( !m_isIfCondition )
  
  
  
  1.6       +7 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/Pattern.java
  
  Index: Pattern.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/Pattern.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Pattern.java	2001/07/08 07:22:01	1.5
  +++ Pattern.java	2001/08/30 03:34:36	1.6
  @@ -7,6 +7,8 @@
    */
   package org.apache.myrmidon.framework;
   
  +import org.apache.avalon.excalibur.i18n.ResourceManager;
  +import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.myrmidon.api.TaskException;
   
   /**
  @@ -17,6 +19,9 @@
   public class Pattern
       implements DataType
   {
  +    private static final Resources REZ =
  +        ResourceManager.getPackageResources( Pattern.class );
  +
       private String         m_value;
       private Condition      m_condition;
   
  @@ -95,7 +100,8 @@
       {
           if( null != m_condition )
           {
  -            throw new TaskException( "Can only set one of if/else for pattern data type"
);
  +            final String message = REZ.getString( "pattern.ifelse-duplicate.error" );
  +            throw new TaskException( message );
           }
       }
   }
  
  
  
  1.3       +11 -3     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/TypeInstanceTask.java
  
  Index: TypeInstanceTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/TypeInstanceTask.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TypeInstanceTask.java	2001/06/17 10:35:41	1.2
  +++ TypeInstanceTask.java	2001/08/30 03:34:36	1.3
  @@ -7,6 +7,8 @@
    */
   package org.apache.myrmidon.framework;
   
  +import org.apache.avalon.excalibur.i18n.ResourceManager;
  +import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  @@ -29,6 +31,9 @@
       extends AbstractContainerTask
       implements Configurable
   {
  +    private static final Resources REZ =
  +        ResourceManager.getPackageResources( TypeInstanceTask.class );
  +
       private String              m_id;
       private Object              m_value;
       private boolean             m_localScope     = true;
  @@ -43,7 +48,8 @@
           try { m_factory = typeManager.getFactory( DataType.ROLE ); }
           catch( final TypeException te )
           {
  -            throw new ComponentException( "Unable to retrieve factory from TypeManager",
te );
  +            final String message = REZ.getString( "type.no-factory.error" );
  +            throw new ComponentException( message, te );
           }
       }
   
  @@ -81,7 +87,8 @@
           }
           catch( final Exception e )
           {
  -            throw new ConfigurationException( "Unable to create datatype", e );
  +            final String message = REZ.getString( "type.no-create.error" );
  +            throw new ConfigurationException( message, e );
           }
   
           configure( m_value, newConfiguration );
  @@ -102,7 +109,8 @@
       {
           if( null == m_id )
           {
  -            throw new TaskException( "Id must be specified" );
  +            final String message = REZ.getString( "type.no-id.error" );
  +            throw new TaskException( message );
           }
   
           if( m_localScope )
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  container.null-value.error=Value ({0}) resolved to null.
  container.bad-resolve.error=Error resolving value ({0}).
  container.bad-config.error=Error converting value.
  
  typedef.no-name.error=Must specify name parameter.
  typedef.no-classname.error=Must specify classname parameter.
  typedef.no-register.error=Failed to register type.
  typedef.bad-classloader.error=Failed to build classLoader due to: {0}.
  
  condition.no-resolve.error=Error resolving {0}.
  
  pattern.ifelse-duplicate.error=Can only set one of if/else for pattern data type.
  
  type.no-factory.error=Unable to retrieve DataType factory from TypeManager.
  type.no-create.error=Unable to create datatype.
  type.no-id.error=Id must be specified.
  
  

Mime
View raw message