01: /*
02: * Copyright 2004, 2005, 2006 Odysseus Software GmbH
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: package de.odysseus.calyxo.forms.check;
17:
18: import java.util.Locale;
19:
20: import javax.servlet.http.HttpServletRequest;
21:
22: import de.odysseus.calyxo.forms.Checker;
23:
24: /**
25: * A simple checker does not need the request object to do his work.
26: *
27: * @author Christoph Beck
28: * @author Oliver Stuhr
29: */
30: public abstract class SimpleChecker implements Checker {
31:
32: /**
33: * Constructor.
34: */
35: public SimpleChecker() {
36: super ();
37: }
38:
39: /**
40: * Forward to {@link #check(Object)}.
41: */
42: public final boolean check(HttpServletRequest request, Object value) {
43: return check(value);
44: }
45:
46: /**
47: * Check the specified value (to be implemented by subclasses)
48: */
49: public abstract boolean check(Object value);
50:
51: /* (non-Javadoc)
52: * @see de.odysseus.calyxo.forms.impl.ValidationEngine#localize(java.util.Locale)
53: */
54: public void localize(Locale locale) {
55: }
56:
57: /* (non-Javadoc)
58: * @see de.odysseus.calyxo.forms.impl.ValidationEngine#isSharable()
59: */
60: public boolean isSharable() {
61: return false;
62: }
63: }
|