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-myrmidon/container/src/java/org/apache/myrmidon/components/property XPathPropertyResolver.java
Date Thu, 04 Jul 2002 23:53:55 GMT
donaldp     2002/07/04 16:53:55

  Modified:    container/src/java/org/apache/myrmidon/components/property
                        XPathPropertyResolver.java
  Log:
  JXPath requires that all classes that are
  dynamically handled to be explicitly registered.
  Thus we explicitly register unmodified class.
  
  Submitted By: Dmitri Plotnikov
  
  Revision  Changes    Path
  1.4       +16 -3     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/property/XPathPropertyResolver.java
  
  Index: XPathPropertyResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/property/XPathPropertyResolver.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XPathPropertyResolver.java	27 Jun 2002 11:13:08 -0000	1.3
  +++ XPathPropertyResolver.java	4 Jul 2002 23:53:54 -0000	1.4
  @@ -7,11 +7,16 @@
    */
   package org.apache.myrmidon.components.property;
   
  +import java.util.Collections;
  +import java.util.HashMap;
  +import org.apache.avalon.framework.activity.Initializable;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.commons.jxpath.JXPathContext;
  +import org.apache.commons.jxpath.JXPathIntrospector;
  +import org.apache.commons.jxpath.MapDynamicPropertyHandler;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.avalon.framework.service.ServiceManager;
  -import org.apache.avalon.framework.service.ServiceException;
   
   /**
    * A property resolver that uses JXPath to resolve values.
  @@ -23,6 +28,7 @@
    */
   public class XPathPropertyResolver
       extends DefaultPropertyResolver
  +    implements Initializable
   {
       /**
        * @avalon.dependency interface="Converter"
  @@ -30,6 +36,13 @@
       public void service( ServiceManager serviceManager ) throws ServiceException
       {
           super.service( serviceManager );
  +    }
  +
  +    public void initialize()
  +        throws Exception
  +    {
  +        final Class clazz = Collections.unmodifiableMap( new HashMap() ).getClass();
  +        JXPathIntrospector.registerDynamicClass( clazz, MapDynamicPropertyHandler.class
);
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message