You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by hl...@apache.org on 2003/10/14 17:33:18 UTC

cvs commit: jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/parse DescriptorParser.java

hlship      2003/10/14 08:33:18

  Modified:    hivemind/framework/src/test/hivemind/test/rules
                        TestNumericTranslators.java
                        TestObjectTranslator.java
               hivemind/framework/src/java/org/apache/commons/hivemind/schema/rules
                        ObjectTranslator.java
               hivemind/framework/src/java/org/apache/commons/hivemind
                        HiveMindMessages.properties
               hivemind/xdocs rules.xml
               hivemind/framework/src/java/org/apache/commons/hivemind/parse
                        DescriptorParser.java
  Added:       hivemind/framework/src/test/hivemind/test/rules
                        PrivateObject.java
               hivemind/framework/src/java/org/apache/commons/hivemind/schema/rules
                        DoubleTranslator.java ClassTranslator.java
  Log:
  Add two new translators: double and class.
  
  Revision  Changes    Path
  1.3       +57 -1     jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/rules/TestNumericTranslators.java
  
  Index: TestNumericTranslators.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/rules/TestNumericTranslators.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestNumericTranslators.java	12 Oct 2003 09:55:31 -0000	1.2
  +++ TestNumericTranslators.java	14 Oct 2003 15:33:17 -0000	1.3
  @@ -62,6 +62,7 @@
   import org.apache.commons.hivemind.Element;
   import org.apache.commons.hivemind.impl.ElementImpl;
   import org.apache.commons.hivemind.schema.SchemaProcessor;
  +import org.apache.commons.hivemind.schema.rules.DoubleTranslator;
   import org.apache.commons.hivemind.schema.rules.IntTranslator;
   import org.apache.commons.hivemind.schema.rules.LongTranslator;
   
  @@ -182,6 +183,61 @@
               t.translate(new MockSchemaProcessor(), new ElementImpl(), "qbert"));
   
           assertLoggedMessage("'qbert' (in element foo/bar/baz at null) is not a long value.");
  +    }
  +
  +    /**
  +     * Tests {@link org.apache.commons.hivemind.schema.rules.IntTranslator} with
  +     * the default constructor.
  +     */
  +    public void testDoubleTranslator()
  +    {
  +        DoubleTranslator t = new DoubleTranslator();
  +
  +        assertEquals(new Double(10.7), t.translate(null, null, "10.7"));
  +    }
  +
  +    public void testDoubleDefault()
  +    {
  +        DoubleTranslator t = new DoubleTranslator();
  +
  +        assertEquals(new Double(0), t.translate(null, null, null));
  +    }
  +
  +    public void testDoubleRange()
  +    {
  +        DoubleTranslator t = new DoubleTranslator("min=5.25,max=200");
  +        SchemaProcessor p = new MockSchemaProcessor();
  +        Element e = new ElementImpl();
  +
  +        interceptLogging();
  +
  +        assertEquals(new Double(5.25), t.translate(p, e, "3"));
  +
  +        assertLoggedMessage("Value 3 (at null) is less than minimum value 5.25.");
  +
  +        assertEquals(new Double(200), t.translate(p, e, "50900.30"));
  +
  +        assertLoggedMessage("Value 50900.30 (at null) is greater than maximum value 200.");
  +    }
  +
  +    public void testDoubleDefaultValue()
  +    {
  +        DoubleTranslator t = new DoubleTranslator("default=7.77");
  +
  +        assertEquals(new Double(7.77), t.translate(null, null, null));
  +    }
  +
  +    public void testDoubleInvalid()
  +    {
  +        DoubleTranslator t = new DoubleTranslator("default=13");
  +
  +        interceptLogging();
  +
  +        assertEquals(
  +            new Double(13),
  +            t.translate(new MockSchemaProcessor(), new ElementImpl(), "qbert"));
  +
  +        assertLoggedMessage("'qbert' (in element foo/bar/baz at null) is not a double value.");
       }
   
   }
  
  
  
  1.3       +39 -2     jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/rules/TestObjectTranslator.java
  
  Index: TestObjectTranslator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/rules/TestObjectTranslator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestObjectTranslator.java	12 Oct 2003 09:55:31 -0000	1.2
  +++ TestObjectTranslator.java	14 Oct 2003 15:33:17 -0000	1.3
  @@ -61,17 +61,20 @@
   
   import java.util.List;
   
  +import org.apache.commons.hivemind.ApplicationRuntimeException;
   import org.apache.commons.hivemind.Location;
   import org.apache.commons.hivemind.Registry;
   import org.apache.commons.hivemind.impl.BaseLocatable;
   import org.apache.commons.hivemind.impl.ElementImpl;
   import org.apache.commons.hivemind.impl.LocationImpl;
   import org.apache.commons.hivemind.schema.SchemaProcessor;
  +import org.apache.commons.hivemind.schema.rules.ClassTranslator;
   import org.apache.commons.hivemind.schema.rules.ObjectTranslator;
   
   /**
    * Fill in some gaps in
  - * {@link org.apache.commons.hivemind.schema.rules.ObjectTranslator}.
  + * {@link org.apache.commons.hivemind.schema.rules.ObjectTranslator} and
  + * {@link org.apache.commons.hivemind.schema.rules.ClassTranslator}.
    *
    * @author Howard Lewis Ship
    * @version $Id$
  @@ -109,6 +112,29 @@
           assertLoggedMessagePattern("'bad.class.Name' is not a valid class name \\(at .*\\): Could not load class bad.class.Name");
       }
   
  +    public void testPrivateObject() throws Exception
  +    {
  +        ObjectTranslator t = new ObjectTranslator();
  +        ElementImpl e = new ElementImpl();
  +        Location l = new LocationImpl(getResource("TestObjectTranslator.class"), 50);
  +        e.setLocation(l);
  +
  +        SchemaProcessor p = new MockSchemaProcessor();
  +
  +        try
  +        {
  +            t.translate(p, e, PrivateObject.class.getName());
  +            unreachable();
  +        }
  +        catch (ApplicationRuntimeException ex)
  +        {
  +            assertExceptionSubstring(
  +                ex,
  +                "Class org.apache.commons.hivemind.schema.rules.ObjectTranslator can not access a member "
  +                    + "of class hivemind.test.rules.PrivateObject");
  +        }
  +    }
  +
       public void testLocatable() throws Exception
       {
           ObjectTranslator t = new ObjectTranslator();
  @@ -140,5 +166,16 @@
           l.size();
   
           assertLoggedMessagePattern("Unable to set property value of hivemind\\.test\\.config\\.impl\\.Datum@.* to {} \\(at datum/value\\): ");
  +    }
  +    
  +    public void testClassTranslator() throws Exception
  +    {
  +    	ClassTranslator t = new ClassTranslator();
  +		SchemaProcessor p = new MockSchemaProcessor();
  +
  +		Class c = (Class)t.translate(p, null, getClass().getName());
  +		
  +		assertEquals(getClass(), c);
  +   	
       }
   }
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/rules/PrivateObject.java
  
  Index: PrivateObject.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowledgement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgement may appear in the software itself,
   *    if and wherever such third-party acknowledgements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package hivemind.test.rules;
  
  
  /**
   * Used to test failure when creating an object 
   * (by {@link org.apache.commons.hivemind.schema.rules.ObjectTranslator}.
   *
   * @author Howard Lewis Ship
   * @version $Id: PrivateObject.java,v 1.1 2003/10/14 15:33:17 hlship Exp $
   */
  public class PrivateObject
  {
  	private PrivateObject()
  	{
  	}
  }
  
  
  
  1.3       +7 -27     jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/schema/rules/ObjectTranslator.java
  
  Index: ObjectTranslator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/schema/rules/ObjectTranslator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ObjectTranslator.java	12 Oct 2003 10:13:55 -0000	1.2
  +++ ObjectTranslator.java	14 Oct 2003 15:33:18 -0000	1.3
  @@ -57,15 +57,10 @@
   
   package org.apache.commons.hivemind.schema.rules;
   
  +import org.apache.commons.hivemind.ApplicationRuntimeException;
   import org.apache.commons.hivemind.Element;
  -import org.apache.commons.hivemind.HiveMind;
  -import org.apache.commons.hivemind.ClassResolver;
   import org.apache.commons.hivemind.LocationHolder;
   import org.apache.commons.hivemind.schema.SchemaProcessor;
  -import org.apache.commons.hivemind.schema.Translator;
  -import org.apache.commons.lang.StringUtils;
  -import org.apache.commons.logging.Log;
  -import org.apache.commons.logging.LogFactory;
   
   /**
    * Used to translate from a class name to an instance of the class.
  @@ -73,24 +68,17 @@
    * @author Howard Lewis Ship
    * @version $Id$
    */
  -public class ObjectTranslator implements Translator
  +public class ObjectTranslator extends ClassTranslator
   {
  -    private static final Log LOG = LogFactory.getLog(ObjectTranslator.class);
  -
  -    /**
  -     * Converts the value from a class name to an instance of the class.  Null input
  -     * returns null.  If an exception is thrown, then it is logged and null is returned.
  -     */
       public Object translate(SchemaProcessor processor, Element element, String inputValue)
       {
  -        if (StringUtils.isBlank(inputValue))
  +        Class objectClass = extractClass(processor, element, inputValue);
  +
  +        if (objectClass == null)
               return null;
   
           try
           {
  -            ClassResolver resolver = processor.getContributingModule().getClassResolver();
  -
  -            Class objectClass = resolver.findClass(inputValue);
   
               Object result = objectClass.newInstance();
   
  @@ -104,15 +92,7 @@
           }
           catch (Exception ex)
           {
  -            LOG.error(
  -                HiveMind.format(
  -                    "ClassTranslator.bad-class-name",
  -                    inputValue,
  -                    element.getLocation(),
  -                    ex.getMessage()),
  -                ex);
  -
  -            return null;
  +            throw new ApplicationRuntimeException(ex.getMessage(), element.getLocation(), ex);
           }
       }
   
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/schema/rules/DoubleTranslator.java
  
  Index: DoubleTranslator.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowledgement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgement may appear in the software itself,
   *    if and wherever such third-party acknowledgements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.commons.hivemind.schema.rules;
  
  import java.util.Map;
  
  import org.apache.commons.hivemind.Element;
  import org.apache.commons.hivemind.HiveMind;
  import org.apache.commons.hivemind.schema.SchemaProcessor;
  import org.apache.commons.hivemind.schema.Translator;
  import org.apache.commons.lang.StringUtils;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  
  /**
   * Translates strings to integer values.
   *
   * @author Howard Lewis Ship
   * @version $Id: DoubleTranslator.java,v 1.1 2003/10/14 15:33:18 hlship Exp $
   */
  public class DoubleTranslator implements Translator
  {
      private static final Log LOG = LogFactory.getLog(DoubleTranslator.class);
  
      private double _minValue;
      private boolean _isMinValue;
      private double _maxValue;
      private boolean _isMaxValue;
      private double _defaultValue = 0;
  
      public DoubleTranslator()
      {
      }
  
      /**
       * Initializers:
       * <ul>
       * <li>default: default value for empty or invalid input
       * <li>min: minimum acceptible value
       * <li>max: maximum acceptible value
       */
      public DoubleTranslator(String initializer)
      {
          Map m = RuleUtils.convertInitializer(initializer);
  
          String defaultInit = (String) m.get("default");
  
          if (defaultInit != null)
              _defaultValue = Double.parseDouble(defaultInit);
  
          String minInit = (String) m.get("min");
          if (minInit != null)
          {
              _isMinValue = true;
              _minValue = Double.parseDouble(minInit);
          }
  
          String maxInit = (String) m.get("max");
          if (maxInit != null)
          {
              _isMaxValue = true;
              _maxValue = Double.parseDouble(maxInit);
          }
      }
  
      /**
       * Converts the string to an Double.  The empty string is returned as zero.
       * On failure, an error is logged and the method returns zero.
       */
      public Object translate(SchemaProcessor processor, Element element, String inputValue)
      {
          if (StringUtils.isBlank(inputValue))
              return new Double(_defaultValue);
  
          double value;
  
          try
          {
              value = Double.parseDouble(inputValue);
  
              if (_isMinValue && value < _minValue)
              {
                  LOG.error(
                      HiveMind.format(
                          "DoubleTranslator.min-value",
                          inputValue,
                          element.getLocation(),
                          Double.toString(_minValue)));
  
                  value = _minValue;
              }
  
              if (_isMaxValue && value > _maxValue)
              {
                  LOG.error(
                      HiveMind.format(
                          "DoubleTranslator.max-value",
                          inputValue,
                          element.getLocation(),
                          Double.toString(_maxValue)));
  
                  value = _maxValue;
              }
          }
          catch (Exception ex)
          {
              LOG.error(
                  HiveMind.format(
                      "DoubleTranslator.invalid-value",
                      inputValue,
                      processor.getElementPath(),
                      element.getLocation()));
              value = _defaultValue;
          }
  
          return new Double(value);
      }
  
  }
  
  
  
  1.3       +14 -20    jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/schema/rules/ClassTranslator.java
  
  
  
  
  1.6       +5 -1      jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/HiveMindMessages.properties
  
  Index: HiveMindMessages.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/HiveMindMessages.properties,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HiveMindMessages.properties	2 Oct 2003 18:42:06 -0000	1.5
  +++ HiveMindMessages.properties	14 Oct 2003 15:33:18 -0000	1.6
  @@ -117,6 +117,10 @@
   LongTranslator.min-value=Value {0} (at {1}) is less than minimum value {2}.
   LongTranslator.max-value=Value {0} (at {1}) is greater than maximum value {2}.
   
  +DoubleTranslator.invalid-value=''{0}'' (in element {1} at {2}) is not a double value.
  +DoubleTranslator.min-value=Value {0} (at {1}) is less than minimum value {2}.
  +DoubleTranslator.max-value=Value {0} (at {1}) is greater than maximum value {2}.
  +
   ServiceTranslator.invalid-value=Error resolving service {0} (in element {1} at {2}): {3}
   
   EnumerationTranslator.not-recognized=''{0}'' (at {1}) is not a recognized enumerated value.
  
  
  
  1.12      +55 -19    jakarta-commons-sandbox/hivemind/xdocs/rules.xml
  
  Index: rules.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/rules.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- rules.xml	10 Oct 2003 19:25:41 -0000	1.11
  +++ rules.xml	14 Oct 2003 15:33:18 -0000	1.12
  @@ -327,6 +327,49 @@
   </subsection>
   
   
  +<subsection name="class">
  +
  +<p>
  +The class translator converts a class name into a Class object.  The value must be a fully
  +qualified class name. A null input value returns null.
  +</p>
  +
  +	
  +</subsection>
  +
  +
  +<subsection name="configuration">
  +
  +<p>
  +The configuration translator converts an input value into an configuration point id, then obtains
  +the elements for that configuration point as the value.  The id may be fully qualified, or a local id within
  +the contributing module.	
  +</p>	
  +
  +<p>
  +A null input value returns null.  Invalid input, such as an unknown configuration point id, will be logged as an error and
  +null will be returned.	
  +</p>
  +	
  +</subsection>
  +
  +<subsection name="double">
  +
  +<p>
  +The double translator converts the input into an double precision floating point value.  
  +It recognizes three initializer values:
  +<ul>
  +<li>default: the default value (normally 0) to use when the input is null or invalid</li>
  +<li>min: a minimum acceptible value</li>
  +<li>max: a maximum acceptible value</li>
  +</ul>	
  +</p>
  +
  +<p>
  +If the value is outside of the range defined by the min and max initializer keys, it is constrained into the range.	
  +</p>
  +
  +</subsection>
   
   <subsection name="enumeration">
   
  @@ -357,21 +400,6 @@
   	
   </subsection>
   
  -<subsection name="configuration">
  -
  -<p>
  -The configuration translator converts an input value into an configuration point id, then obtains
  -the elements for that configuration point as the value.  The id may be fully qualified, or a local id within
  -the contributing module.	
  -</p>	
  -
  -<p>
  -A null input value returns null.  Invalid input, such as an unknown configuration point id, will be logged as an error and
  -null will be returned.	
  -</p>
  -	
  -</subsection>
  -
   <subsection name="int">
   
   <p>
  @@ -392,10 +420,18 @@
   <subsection name="long">
   
   <p>
  -The long translator is identitical to the int translator, except that the input is converted to a long (64 bit) integer.	
  +The long translator converts the input into an long integer (64 bit) value.  It recognizes three initializer values:
  +<ul>
  +<li>default: the default value (normally 0) to use when the input is null or invalid</li>
  +<li>min: a minimum acceptible value</li>
  +<li>max: a maximum acceptible value</li>
  +</ul>	
  +</p>
  +
  +<p>
  +If the value is outside of the range defined by the min and max initializer keys, it is constrained into the range.	
   </p>
  -	
  -	
  +
   </subsection>
   
   <subsection name="object">
  
  
  
  1.11      +5 -1      jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/parse/DescriptorParser.java
  
  Index: DescriptorParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/parse/DescriptorParser.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DescriptorParser.java	12 Oct 2003 10:13:54 -0000	1.10
  +++ DescriptorParser.java	14 Oct 2003 15:33:18 -0000	1.11
  @@ -89,6 +89,8 @@
   import org.apache.commons.hivemind.schema.impl.ElementModelImpl;
   import org.apache.commons.hivemind.schema.impl.SchemaImpl;
   import org.apache.commons.hivemind.schema.rules.BooleanTranslator;
  +import org.apache.commons.hivemind.schema.rules.ClassTranslator;
  +import org.apache.commons.hivemind.schema.rules.DoubleTranslator;
   import org.apache.commons.hivemind.schema.rules.ObjectTranslator;
   import org.apache.commons.hivemind.schema.rules.ConfigurationTranslator;
   import org.apache.commons.hivemind.schema.rules.CreateObjectRule;
  @@ -358,6 +360,8 @@
           _translatorClasses.put("configuration", ConfigurationTranslator.class);
           _translatorClasses.put("resource", ResourceTranslator.class);
           _translatorClasses.put("long", LongTranslator.class);
  +        _translatorClasses.put("double", DoubleTranslator.class);
  +        _translatorClasses.put("class", ClassTranslator.class);
       }
   
       /**
  
  
  

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


Re: cvs commit: jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/parse DescriptorParser.java

Posted by Knut Wannheden <kn...@paranor.ch>.
Some minor xdoc fixes / clarifications.

--knut


begin 666 hivemind-docs-patch.txt
M26YD97@Z(&-O;F9I9W5R871I;VYS+GAM; T*/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/0T*4D-3(&9I;&4Z("]H;VUE+V-V<W!U8FQI8R]J86MA<G1A+6-O;6UO
M;G,M<V%N9&)O>"]H:79E;6EN9"]X9&]C<R]C;VYF:6=U<F%T:6]N<RYX;6PL
M=@T*<F5T<FEE=FEN9R!R979I<VEO;B Q+C0-"F1I9F8@+74@+7(Q+C0@8V]N
M9FEG=7)A=&EO;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 P,# -"D! 
M("TS-#$L." K,S0Q+#@@0$ -"B \<W5B<V5C=&EO;B!N86UE/2)C;VYF:6=U
M<F%T:6]N(CX-"B -"B \<#X-"BU4:&4@8V]N9FEG=7)A=&EO;B!T<F%N<VQA
M=&]R(&-O;G9E<G1S(&%N(&EN<'5T('9A;'5E(&EN=&\@86X@8V]N9FEG=7)A
M=&EO;B!P;VEN="!I9"P@=&AE;B!O8G1A:6YS#0HM=&AE(&5L96UE;G1S(&9O
M<B!T:&%T(&-O;F9I9W5R871I;VX@<&]I;G0@87,@=&AE('9A;'5E+B @5&AE
M(&ED(&UA>2!B92!F=6QL>2!Q=6%L:69I960L(&]R(&$@;&]C86P@:60@=VET
M:&EN#0HK5&AE(&-O;F9I9W5R871I;VX@=')A;G-L871O<B!C;VYV97)T<R!A
M;B!I;G!U="!V86QU92!I;G1O(&$@8V]N9FEG=7)A=&EO;B!P;VEN="!I9"P@
M=&AE;B!O8G1A:6YS#0HK=&AE(&5L96UE;G1S(&9O<B!T:&%T(&-O;F9I9W5R
M871I;VX@<&]I;G0@87,@82!,:7-T+B @5&AE(&ED(&UA>2!B92!F=6QL>2!Q
M=6%L:69I960L(&]R(&$@;&]C86P@:60@=VET:&EN#0H@=&AE(&-O;G1R:6)U
:=&EN9R!M;V1U;&4N"0T*(#PO<#X)#0H@#0H`
`
end



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