View Javadoc

1   package org.apache.commons.jelly.tags.ant;
2   
3   /*
4    * Copyright 1999-2001,2004 The Apache Software Foundation.
5    * 
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * 
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   * 
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import java.util.Hashtable;
20  
21  import org.apache.tools.ant.Project;
22  
23  /*** Interface for delegates supporting property management
24   *  for a<code>GrantProject</code>.
25   *
26   *  @see org.apache.commons.jelly.tags.ant.GrantProject#setProperty
27   *  @see org.apache.commons.jelly.tags.ant.GrantProject#setNewProperty
28   *  @see org.apache.commons.jelly.tags.ant.GrantProject#setUserProperty
29   *  @see org.apache.commons.jelly.tags.ant.GrantProject#setInheritedProperty
30   *  @see org.apache.commons.jelly.tags.ant.GrantProject#getProperty
31   *  @see org.apache.commons.jelly.tags.ant.GrantProject#getUserProperty
32   *  @see org.apache.commons.jelly.tags.ant.GrantProject#getProperties
33   *  @see org.apache.commons.jelly.tags.ant.GrantProject#getUserProperties
34   *  @see org.apache.commons.jelly.tags.ant.GrantProject#copyUserProperties
35   *  @see org.apache.commons.jelly.tags.ant.GrantProject#copyInheritedProperties
36   *  @see org.apache.commons.jelly.tags.ant.GrantProject#setSystemProperties
37   *  @see org.apache.commons.jelly.tags.ant.GrantProject#setJavaVersionProperty
38   *
39   *  @author <a href="mailto:bob@eng.werken.com">Bob McWhirter</a>
40   *  @author <a href="mailto:stephenh@chase3000.com">Stephen Haberman</a>
41   */
42  public interface PropsHandler {
43  
44      /*** Set a property.
45       *
46       *  @param key The property key.
47       *  @param value The value.
48       */
49      void setProperty(String key, String value);
50  
51      /*** Set a user property.
52       *
53       *  @param key The user property key.
54       *  @param value The value.
55       */
56      void setUserProperty(String key, String value);
57  
58      /*** Set a new property.
59       *
60       *  @param key The property key.
61       *  @param value The value.
62       */
63      void setNewProperty(String key, String value);
64  
65      /*** Sets an inherited property.
66       *
67       *  @param key The user property key.
68       *  @param value The value.
69       */
70      void setInheritedProperty(String key, String value);
71      
72      /*** Sets a property that is not a user property.
73       * 
74       * Acts as the replacement for ant's private 
75       * <code>setPropertyInternal</code> method.
76       * 
77       * @param key The property key.
78       * @param value The value.
79       */
80      void setPropertyIfUndefinedByUser(String key, String value);
81  
82      /*** Retrieve a property.
83       *
84       *  @param key The property key.
85       *
86       *  @return The value.
87       */
88      String getProperty(String key);
89  
90      /*** Retrieve a user property.
91       *
92       *  @param key The user property key.
93       *
94       *  @return The value.
95       */
96      String getUserProperty(String key);
97  
98      /*** Retrieve a <code>Hashtable</code> of all properties.
99       *
100      *  @return A <code>Hashtable</code> of all properties.
101      */
102     Hashtable getProperties();
103 
104     /*** Retrieve a <code>Hashtable</code> of all user properties.
105      *
106      *  @return A <code>Hashtable</code> of all user properties.
107      */
108     Hashtable getUserProperties();
109     
110     /*** Copy all of the user properties to the other <code>Project</code>.
111      * 
112      * @param other The <code>Project</code> to copy the properties to.
113      */
114     void copyUserProperties(Project other);
115     
116     /*** Copy all of the inherited properties to the other <code>Project</code>.
117      * 
118      * @param other The <code>Project</code> to copy the properties to.
119      */
120     void copyInheritedProperties(Project other);
121     
122     /*** Set the system variables for a <code>Project</code> that have
123      * not already been assigned as user properties.
124      */
125     void setSystemProperties();
126     
127     /*** Set the <code>ant.java.version</code> property.
128      */
129     void setJavaVersionProperty();    
130     
131     
132 }