You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by un...@apache.org on 2003/10/31 18:03:22 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/modules/input PropertiesFileModule.java

unico       2003/10/31 09:03:22

  Modified:    src/java/org/apache/cocoon/components/modules/input
                        PropertiesFileModule.java
  Log:
  extend AbstractJXPathModule as suggested by Konstantin Piroumian
  
  Revision  Changes    Path
  1.2       +5 -18     cocoon-2.1/src/java/org/apache/cocoon/components/modules/input/PropertiesFileModule.java
  
  Index: PropertiesFileModule.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/modules/input/PropertiesFileModule.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PropertiesFileModule.java	31 Oct 2003 11:45:55 -0000	1.1
  +++ PropertiesFileModule.java	31 Oct 2003 17:03:22 -0000	1.2
  @@ -52,14 +52,12 @@
   
   import java.io.IOException;
   import java.io.InputStream;
  -import java.util.Iterator;
   import java.util.Map;
   import java.util.Properties;
   
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.Serviceable;
  @@ -77,7 +75,7 @@
    * 
    * @author <a href="mailto:unico@apache.org">Unico Hommes</a>
    */
  -public class PropertiesFileModule extends AbstractLogEnabled 
  +public class PropertiesFileModule extends AbstractJXPathModule 
   implements InputModule, Serviceable, Configurable, ThreadSafe {
       
       private SourceResolver m_resolver;
  @@ -96,6 +94,7 @@
        * </p>
        */
       public void configure(Configuration configuration) throws ConfigurationException {
  +        super.configure(configuration);
           String file = configuration.getChild("file").getAttribute("src");
           load(file);
       }
  @@ -126,22 +125,10 @@
           }
       }
       
  -    public Object getAttribute(String name,Configuration modeConf,Map objectModel)
  +    protected Object getContextObject(Configuration modeConf, Map objectModel)
           throws ConfigurationException {
           
  -        return m_properties.getProperty(name);
  +        return m_properties;
       }
  -    
  -    public Iterator getAttributeNames(Configuration modeConf, Map objectModel)
  -        throws ConfigurationException {
  -        
  -        return m_properties.keySet().iterator();
  -    }
  -    
  -    public Object[] getAttributeValues(String name,Configuration modeConf,Map objectModel)
  -        throws ConfigurationException {
  -        
  -        return new Object[] { getAttribute(name,modeConf,objectModel) };
  -    }
  -    
  +
   }