1 | /*
|
---|
2 | * Copyright 2002-2004 The Apache Software Foundation
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | *
|
---|
16 | */
|
---|
17 |
|
---|
18 | package org.apache.tools.ant.types.selectors;
|
---|
19 |
|
---|
20 | import java.util.Enumeration;
|
---|
21 | import org.apache.tools.ant.Project;
|
---|
22 | import org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * This is the interface for selectors that can contain other selectors.
|
---|
26 | *
|
---|
27 | * @since 1.5
|
---|
28 | */
|
---|
29 | public interface SelectorContainer {
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * Indicates whether there are any selectors here.
|
---|
33 | *
|
---|
34 | * @return whether any selectors are in this container
|
---|
35 | */
|
---|
36 | boolean hasSelectors();
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Gives the count of the number of selectors in this container
|
---|
40 | *
|
---|
41 | * @return the number of selectors in this container
|
---|
42 | */
|
---|
43 | int selectorCount();
|
---|
44 |
|
---|
45 | /**
|
---|
46 | * Returns the set of selectors as an array.
|
---|
47 | * @param p the current project
|
---|
48 | * @return an array of selectors in this container
|
---|
49 | */
|
---|
50 | FileSelector[] getSelectors(Project p);
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * Returns an enumerator for accessing the set of selectors.
|
---|
54 | *
|
---|
55 | * @return an enumerator that goes through each of the selectors
|
---|
56 | */
|
---|
57 | Enumeration selectorElements();
|
---|
58 |
|
---|
59 | /**
|
---|
60 | * Add a new selector into this container.
|
---|
61 | *
|
---|
62 | * @param selector the new selector to add
|
---|
63 | */
|
---|
64 | void appendSelector(FileSelector selector);
|
---|
65 |
|
---|
66 | /* Methods below all add specific selectors */
|
---|
67 |
|
---|
68 | /**
|
---|
69 | * add a "Select" selector entry on the selector list
|
---|
70 | * @param selector the selector to add
|
---|
71 | */
|
---|
72 | void addSelector(SelectSelector selector);
|
---|
73 |
|
---|
74 | /**
|
---|
75 | * add an "And" selector entry on the selector list
|
---|
76 | * @param selector the selector to add
|
---|
77 | */
|
---|
78 | void addAnd(AndSelector selector);
|
---|
79 |
|
---|
80 | /**
|
---|
81 | * add an "Or" selector entry on the selector list
|
---|
82 | * @param selector the selector to add
|
---|
83 | */
|
---|
84 | void addOr(OrSelector selector);
|
---|
85 |
|
---|
86 | /**
|
---|
87 | * add a "Not" selector entry on the selector list
|
---|
88 | * @param selector the selector to add
|
---|
89 | */
|
---|
90 | void addNot(NotSelector selector);
|
---|
91 |
|
---|
92 | /**
|
---|
93 | * add a "None" selector entry on the selector list
|
---|
94 | * @param selector the selector to add
|
---|
95 | */
|
---|
96 | void addNone(NoneSelector selector);
|
---|
97 |
|
---|
98 | /**
|
---|
99 | * add a majority selector entry on the selector list
|
---|
100 | * @param selector the selector to add
|
---|
101 | */
|
---|
102 | void addMajority(MajoritySelector selector);
|
---|
103 |
|
---|
104 | /**
|
---|
105 | * add a selector date entry on the selector list
|
---|
106 | * @param selector the selector to add
|
---|
107 | */
|
---|
108 | void addDate(DateSelector selector);
|
---|
109 |
|
---|
110 | /**
|
---|
111 | * add a selector size entry on the selector list
|
---|
112 | * @param selector the selector to add
|
---|
113 | */
|
---|
114 | void addSize(SizeSelector selector);
|
---|
115 |
|
---|
116 | /**
|
---|
117 | * add a selector filename entry on the selector list
|
---|
118 | * @param selector the selector to add
|
---|
119 | */
|
---|
120 | void addFilename(FilenameSelector selector);
|
---|
121 |
|
---|
122 | /**
|
---|
123 | * add an extended selector entry on the selector list
|
---|
124 | * @param selector the selector to add
|
---|
125 | */
|
---|
126 | void addCustom(ExtendSelector selector);
|
---|
127 |
|
---|
128 | /**
|
---|
129 | * add a contains selector entry on the selector list
|
---|
130 | * @param selector the selector to add
|
---|
131 | */
|
---|
132 | void addContains(ContainsSelector selector);
|
---|
133 |
|
---|
134 | /**
|
---|
135 | * add a present selector entry on the selector list
|
---|
136 | * @param selector the selector to add
|
---|
137 | */
|
---|
138 | void addPresent(PresentSelector selector);
|
---|
139 |
|
---|
140 | /**
|
---|
141 | * add a depth selector entry on the selector list
|
---|
142 | * @param selector the selector to add
|
---|
143 | */
|
---|
144 | void addDepth(DepthSelector selector);
|
---|
145 |
|
---|
146 | /**
|
---|
147 | * add a depends selector entry on the selector list
|
---|
148 | * @param selector the selector to add
|
---|
149 | */
|
---|
150 | void addDepend(DependSelector selector);
|
---|
151 |
|
---|
152 | /**
|
---|
153 | * add a regular expression selector entry on the selector list
|
---|
154 | * @param selector the selector to add
|
---|
155 | */
|
---|
156 | void addContainsRegexp(ContainsRegexpSelector selector);
|
---|
157 |
|
---|
158 | /**
|
---|
159 | * add the type selector
|
---|
160 | * @param selector the selector to add
|
---|
161 | * @since ant 1.6
|
---|
162 | */
|
---|
163 | void addType(TypeSelector selector);
|
---|
164 |
|
---|
165 | /**
|
---|
166 | * add the different selector
|
---|
167 | * @param selector the selector to add
|
---|
168 | * @since ant 1.6
|
---|
169 | */
|
---|
170 | void addDifferent(DifferentSelector selector);
|
---|
171 |
|
---|
172 | /**
|
---|
173 | * add the modified selector
|
---|
174 | * @param selector the selector to add
|
---|
175 | * @since ant 1.6
|
---|
176 | */
|
---|
177 | void addModified(ModifiedSelector selector);
|
---|
178 |
|
---|
179 | /**
|
---|
180 | * add an arbitary selector
|
---|
181 | * @param selector the selector to add
|
---|
182 | * @since Ant 1.6
|
---|
183 | */
|
---|
184 | void add(FileSelector selector);
|
---|
185 | }
|
---|