01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.selection;
18:
19: import org.apache.avalon.framework.logger.AbstractLogEnabled;
20: import org.apache.avalon.framework.parameters.Parameters;
21:
22: import java.util.Map;
23:
24: /**
25: * Abstract SwitchSelector class.
26: *
27: * @author <a href="mailto:crafterm@apache.org">Marcus Crafter</a>
28: * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
29: * @version $Id: AbstractSwitchSelector.java 433543 2006-08-22 06:22:54Z crossley $
30: */
31: public abstract class AbstractSwitchSelector extends AbstractLogEnabled
32: implements SwitchSelector {
33:
34: /**
35: * Selectors test pattern against some objects in a <code>Map</code>
36: * model and signals success with the returned boolean value
37: * @param expr The expression to test.
38: * @return Signals successful test.
39: */
40: public boolean select(String expr, Map objectModel,
41: Parameters params) {
42: return select(expr, getSelectorContext(objectModel, params));
43: }
44: }
|