commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-commons/modeler/src/java/org/apache/commons/modeler/ant JmxSet.java
Date Mon, 07 Apr 2003 06:55:21 GMT
costin      2003/04/06 23:55:21

  Modified:    modeler/src/java/org/apache/commons/modeler/ant JmxSet.java
  Log:
  Refactoring - moved the duplicated conversion code to Registry,
  where we can support all standard types we need to support ( and maybe
  a plugin mechansim )
  
  Revision  Changes    Path
  1.7       +2 -16     jakarta-commons/modeler/src/java/org/apache/commons/modeler/ant/JmxSet.java
  
  Index: JmxSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/ant/JmxSet.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JmxSet.java	28 Feb 2003 21:24:35 -0000	1.6
  +++ JmxSet.java	7 Apr 2003 06:55:21 -0000	1.7
  @@ -140,23 +140,9 @@
                    objValue=project.getReference(valueRef);
                }
                if( objValue==null ) {
  -                 if( type==null || "java.lang.String".equals( type )) {
  -                     // string is default
  -                     objValue=value;
  -                 } else if( "javax.management.ObjectName".equals( type ) ||
  -                         "ObjectName".equals( type )) {
  -                     if( log.isTraceEnabled())
  -                        log.trace("Convert to ObjectName " + value);
  -                     objValue=new ObjectName( value );
  -                 } else if( "java.lang.Integer".equals( type ) ||
  -                         "int".equals( type )) {
  -                     objValue=new Integer( value );
  -                 } else if( "java.lang.Boolean".equals( type ) ||
  -                         "boolean".equals( type )) {
  -                     objValue=new Boolean( value );
  -                 }
  +                 objValue=registry.convertValue(type, value);
   
  -            }
  +             }
               if( log.isDebugEnabled())
                   log.debug("Setting " + oname + " " + attribute + " " +
                           objValue);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message