You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jm...@apache.org on 2001/03/30 19:59:18 UTC

cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/intake IntakeTool.java

jmcnally    01/03/30 09:59:18

  Modified:    src/java/org/apache/turbine/services/intake IntakeTool.java
  Log:
  added method to get group in cases where you do not care about the key and
  the group does not map to an object.
  
  Revision  Changes    Path
  1.7       +14 -2     jakarta-turbine/src/java/org/apache/turbine/services/intake/IntakeTool.java
  
  Index: IntakeTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/intake/IntakeTool.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- IntakeTool.java	2001/03/29 19:04:39	1.6
  +++ IntakeTool.java	2001/03/30 17:59:17	1.7
  @@ -74,11 +74,12 @@
    * A Pull tool to make intake objects available to a template
    *
    * @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
  - * @version $Id: IntakeTool.java,v 1.6 2001/03/29 19:04:39 jmcnally Exp $
  + * @version $Id: IntakeTool.java,v 1.7 2001/03/30 17:59:17 jmcnally Exp $
    */
   public class IntakeTool 
       implements ApplicationTool, Recyclable
   {
  +    private static final String DEFAULT_KEY = "_0";
       private HashMap groups;
       private RunData data;
       private boolean allValid;
  @@ -155,7 +156,12 @@
           {
               this.groupName = groupName;
           }
  -        
  +
  +        public Group getDefault()
  +            throws Exception
  +        {
  +            return setKey(DEFAULT_KEY);
  +        }
           
           public Group setKey(String key)
               throws Exception
  @@ -166,6 +172,12 @@
               if ( groups.containsKey(inputKey)) 
               {
                   g = (Group)groups.get(inputKey);
  +            }
  +            else 
  +            {
  +                g = TurbineIntake.getGroup(groupName); 
  +                groups.put(inputKey, g);
  +                g.init(key, data);
               }
   
               return g;
  
  
  

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