View Javadoc
1   /*
2    * $Header: /cvsroot/sinon/sinon/src/java/eteg/sinon/core/Action.java,v 1.2 2005/06/21 14:25:07 thiagohp Exp $
3    * $Revision: 1.2 $
4    * $Date: 2005/06/21 14:25:07 $
5    * $Author: thiagohp $
6    *
7    * =============================================================================
8    *
9    * Copyright 2004-2005 Eteg Internet Ltda. (http://www.eteg.com.br)
10   *
11   * Licensed under the Apache License, Version 2.0 (the "License");
12   * you may not use this file except in compliance with the License.
13   * You may obtain a copy of the License at
14   *
15   *     http://www.apache.org/licenses/LICENSE-2.0
16   *
17   * Unless required by applicable law or agreed to in writing, software
18   * distributed under the License is distributed on an "AS IS" BASIS,
19   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20   * See the License for the specific language governing permissions and
21   * limitations under the License.
22   */
23  package eteg.sinon.core;
24  
25  /***
26   * Class that represents an action to be executed after the data extraction
27   * of a page.
28   *
29   * @author <a href="mailto:thiagohp at users.sourceforge.net">Thiago H. de Paula Figueiredo</a>
30   * @author Last modified by $Author: thiagohp $
31   * @version $Revision: 1.2 $
32   */
33  public class Action implements Step {
34  
35      /***
36       * Processed page ID.
37       */
38      private String pageId;
39  
40      /***
41       * Name of the list variable to be iterated. Optional attribute.
42       */
43      private String foreach;
44  
45      /***
46       * Name of the variable that receives the value of the current list element.
47       * Optional attribute.
48       */
49      private String variable;
50  
51      /***
52       * Name of the variable that receives the current position in the iterated
53       * list. Optional attribute.
54       */
55      private String index;
56  
57      /***
58       * Condition that must be met in order the action to be executed.
59       * Optional attribute.
60       */
61      private String condition;
62  
63      /***
64       * Name of the property on which the condition will be tested.
65       * Optional attribute.
66       */
67      private String propertyId;
68  
69      /***
70       * URL of the page to be processed. Optional attribute.
71       */
72      private String url;
73  
74      /***
75       * Configuration of the page to be processed. Optional attribute.
76       */
77      private PageConfiguration configuration;
78  
79      /***
80       * Single constructor of this class.
81       */
82      public Action() {
83      }
84  
85      /***
86       * Returns the value of the property <code>pageId</code>.
87       * @return a <code>String</code>.
88       */
89      public String getPageId() {
90          return pageId;
91      }
92  
93      /***
94       * Sets the value of the <code>pageId</code> property.
95       * @param pageId the new <code>pageId</code> value.
96       */
97      public void setPageId(String pageId) {
98          this.pageId = pageId;
99      }
100 
101     /***
102      * Returns the value of the <code>foreach</code> property.
103      * @return a <code>String</code>.
104      */
105     public String getForeach() {
106         return foreach;
107     }
108 
109     /***
110      * Sets the value of the <code>foreach</code> property.
111      * @param foreach the new <code>foreach</code> value.
112      */
113     public void setForeach(String foreach) {
114         this.foreach = foreach;
115     }
116 
117     /***
118      * Returns the value of the <code>variable</code> property.
119      * @return a <code>String</code>.
120      */
121     public String getVariable() {
122         return variable;
123     }
124 
125     /***
126      * Sets the value of the <code>variable</code> property.
127      * @param variable the new <code>variable</code> value.
128      */
129     public void setVariable(String variable) {
130         this.variable = variable;
131     }
132 
133     /***
134      * Returns the value of the <code>index</code> property.
135      * @return a <code>String</code>.
136      */
137     public String getIndex() {
138         return index;
139     }
140 
141     /***
142      * Sets the value of the <code>index</code> property.
143      * @param index the new <code>index</code> value.
144      */
145     public void setIndex(String index) {
146         this.index = index;
147     }
148 
149     /***
150      * Returns the value of the <code>conditioni</code> property.
151      * @return a <code>String</code>.
152      */
153     public String getCondition() {
154         return condition;
155     }
156 
157     /***
158      * Sets the value of the <code>condition</code> property.
159      * @param condition the new <code>condition</code> value.
160      */
161     public void setCondition(String condition) {
162         this.condition = condition;
163     }
164 
165     /***
166      * Returns the value of the <code>propertyId</code> property.
167      * @return a <code>String</code>.
168      */
169     public String getPropertyId() {
170         return propertyId;
171     }
172 
173     /***
174      * Sets the value of the <code>propertyId</code> property.
175      * @param propertyId the new <code>propertyId</code> value.
176      */
177     public void setPropertyId(String propertyId) {
178         this.propertyId = propertyId;
179     }
180 
181     /***
182      * Returns the value of the <code>url</code> property.
183      * @return a <code>String</code>.
184      */
185     public String getUrl() {
186         return url;
187     }
188 
189     /***
190      * Sets the value of the <code>url</code> property.
191      * @param url the new <code>url</code> value.
192      */
193     public void setUrl(String url) {
194         this.url = url;
195     }
196 
197     /***
198      * Returns the value of the <code>configuration</code> property.
199      * @return a <code>String</code>.
200      */
201     public PageConfiguration getConfiguration() {
202         return configuration;
203     }
204 
205     /***
206      * Sets the value of the <code>configuration</code> property.
207      * @param configuration the new <code>configuration</code> value.
208      */
209     public void setConfiguration(PageConfiguration configuration) {
210         this.configuration = configuration;
211     }
212 
213     /***
214      * Returns <code>false</code>.
215      */
216     public boolean isDataExtraction() {
217         return false;
218     }
219 
220     /***
221      * Returns <code>false</code>.
222      */
223     public boolean isPositioningStep() {
224         return false;
225     }
226 
227     /***
228      * Returns <code>true</code>.
229      */
230     public boolean isAction() {
231         return true;
232     }
233 
234     /***
235      * Returns <code>false</code>.
236      */
237     public boolean isLoop() {
238         return false;
239     }
240 
241 }