KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > idaremedia > antx > parameters > FlexConditional


1 /**
2  * $Id: FlexConditional.java 180 2007-03-15 12:56:38Z ssmc $
3  * Copyright 2004 iDare Media, Inc. All rights reserved.
4  *
5  * Originally written by iDare Media, Inc. for release into the public domain. This
6  * library, source form and binary form, is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License (LGPL) as published
8  * by the Free Software Foundation; either version 2.1 of the License, or (at your option)
9  * any later version.<p>
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU LGPL for more details.<p>
14  *
15  * You should have received a copy of the GNU Lesser General Public License along with this
16  * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite
17  * 330, Boston, MA 02111-1307 USA. The GNU LGPL can be found online at
18  * http://www.fsf.org/copyleft/lesser.html<p>
19  *
20  * This product has been influenced by several projects within the open-source community.
21  * The JWare developers wish to acknowledge the open-source community's support. For more
22  * information regarding the open-source products used within JWare, please visit the
23  * JWare website.
24  *----------------------------------------------------------------------------------------*
25  * WEBSITE- http://www.jware.info EMAIL- inquiries@jware.info
26  *----------------------------------------------------------------------------------------*
27  **/

28
29 package com.idaremedia.antx.parameters;
30
31 /**
32  * A component that supports an extended set of if/unless conditions to determine
33  * whether it executes. A flex condition's execution is determined by the combination
34  * of <em>all</em> of its <i>if*</i> and <i>unless*</i> condiitons.
35  * <p>
36  * <b>Examples:</b><pre>
37  * &lt;do ifAll="ant.file,ant.version"&gt;&#8230;
38  * &lt;do unlessAnt="^.*version 1\.5\.[3-9]?.*"&gt;&#8230;
39  * &lt;call ifOS="unix" &#8230;&gt;
40  * &lt;foreach ifAllTrue="javac.debug,javadoc.debug"&gt;&#8230;
41  * </pre>
42  *
43  * @since JWare/AntX 0.4
44  * @author ssmc, &copy;2004 <a HREF="http://www.jware.info">iDare&nbsp;Media,&nbsp;Inc.</a>
45  * @version 0.5
46  * @.safety n/a
47  * @.group api,infra
48  **/

49
50 public interface FlexConditional extends Conditional, PlatformConditional
51 {
52     /**
53      * Adds a positive boolean condition to this component.
54      * The condition is <i>true</i> if the incoming string
55      * represents a positive boolean string like <span class="src">yes</span>.
56      * This method allows conditional tasks to leverage AntX value
57      * URIs that generate a boolean string.
58      * @param booleanString the string to evaluate
59      * @since JWare/AntX 0.5
60      */

61     void setTrue(String JavaDoc booleanString);
62
63
64     /**
65      * Adds a negative boolean condition to this component.
66      * The condition is <i>true</i> if the incoming string
67      * represents a negative boolean string like <span class="src">no</span>.
68      * This method allows conditional tasks to leverage AntX value
69      * URIs that generate a boolean string.
70      * @param booleanString the string to evaluate
71      * @since JWare/AntX 0.5
72      **/

73     void setFalse(String JavaDoc booleanString);
74
75
76     /**
77      * Adds an if-true condition to this component. The
78      * condition is only <i>true</i> if the named property
79      * is defined as one of the positive Ant boolean
80      * strings (like "<span class="src">yes</span>" or
81      * "<span class="src">true</span>").
82      * @see #setIfAllTrue setIfAllTrue
83      **/

84     void setIfTrue(String JavaDoc property);
85
86
87     /**
88      * Adds an unless-true condition to this component. The
89      * condition is only <i>true</i> if the named property
90      * does not exist or is not defined as one of the
91      * positive Ant boolean strings (like
92      * "<span class="src">yes</span>" or
93      * "<span class="src">true</span>").
94      * @see #setUnlessAllTrue setUnlessAllTrue
95      **/

96     void setUnlessTrue(String JavaDoc property);
97
98
99     /**
100      * Adds an if-all condition to this component. The
101      * condition is only <i>true</i> if all of the named
102      * properties exist.
103      * @param properties comma-delimited list of property names
104      **/

105     void setIfAll(String JavaDoc properties);
106
107
108     /**
109      * Adds an unless-all condition to this component. The
110      * condition is only <i>true</i> if none of the named
111      * properties exist.
112      * @param properties comma-delimited list of property names
113      **/

114     void setUnlessAll(String JavaDoc properties);
115
116
117     /**
118      * Adds an if-all-true condition to this component. The
119      * condition is only <i>true</i> if all of the named
120      * properties exist and are defined as valid positive Ant
121      * boolean strings.
122      * @param properties comma-delimited list of property names
123      * @see #setIfTrue setIfTrue
124      **/

125     void setIfAllTrue(String JavaDoc properties);
126
127
128     /**
129      * Adds an unless-all-true condition to this component. The
130      * condition is only <i>true</i> if none of the named
131      * properties exist, or if none are defined to a positive
132      * Ant boolean string.
133      * @param properties comma-delimited list of property names
134      * @see #setUnlessTrue setUnlessTrue
135      **/

136     void setUnlessAllTrue(String JavaDoc properties);
137
138
139     /**
140      * Returns <i>true</i> if all of this component's
141      * current <i>if</i> conditions are <i>true</i>.
142      **/

143     boolean testIfCondition();
144
145
146     /**
147      * Returns <i>true</i> if all of this component's
148      * current <i>unless</i> conditions are <i>true</i>.
149      **/

150     boolean testUnlessCondition();
151 }
152
153
154 /* end-of-FlexConditional.java */
155
Popular Tags