1 /***
2 * Copyright 2003, 2004, 2005. CodeStreet LLC.
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 http://www.apache.org/licenses/LICENSE-2.0
7 *
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14
15 package com.codestreet.selector;
16
17 import java.util.Map;
18
19 import com.codestreet.selector.parser.IValueProvider;
20 import com.codestreet.selector.parser.Result;
21
22 /***
23 * Interface implemented by selectors.
24 *
25 * @author Jawaid Hakim.
26 */
27 public interface ISelector
28 {
29 /***
30 * Evaluate the selector.
31 *
32 * @param identifiers
33 * Value for each non-null identifier in the selector.
34 * @return Returns <tt>true</tt> if the data passes the selector.
35 * Otherwise, returns <tt>false</tt>.
36 * @see #getIdentifiers()
37 */
38 Result eval(final Map identifiers);
39
40 /***
41 * Evaluate the selector.
42 *
43 * @param provider
44 * Value provider. During evaluation of the selector callbacks
45 * are made on the value provider to get identifier values.
46 * @param corr
47 * Correlation data. Passed as-is to the value provider.
48 * @return Result evaluating the selector.
49 */
50 Result eval(final IValueProvider provider, final Object corr);
51
52 /***
53 * Get identifiers used by the selector. The key into the <tt>Map</tt> is
54 * the name of the identifier and the value is an instance of
55 * <tt>Identifier</tt>.
56 *
57 * @return Readonly <tt>Map</tt> of identifiers that are used within the
58 * selector.
59 * @throws UnsupportedOperationException
60 * @see #eval(Map)
61 */
62 Map getIdentifiers();
63
64 /***
65 * Get the selector.
66 *
67 * @return Selector.
68 */
69 String getSelector();
70 }
This page was automatically generated by Maven