01: /*
02: * Copyright 2006-2007 Dan Shellman
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 org.iscreen.impl;
17:
18: import org.iscreen.DocumentationIterator;
19:
20: /**
21: * This interface represents a wrapper around a validator. The wrapper
22: * class acts as the bridge to calling the validator.
23: *
24: * @author Shellman, Dan
25: */
26: public interface ValidatorWrapper {
27: /**
28: * Called to have the wrapper validate the passed object. It is expected
29: * that the wrapper will update the root object as appropriate. The
30: * context already has access to the root that is being passed in.
31: *
32: * @param context The validation context to pass on to the contained
33: * validator.
34: * @param root The OGNL root, to be updated as appropriate.
35: * @param obj The object to be validated.
36: */
37: boolean validate(InternalValidatorContext context,
38: ContextBean root, Object obj);
39:
40: /**
41: * Called to retrieve the "name" of the validator. The name represents
42: * some form of identification, though it does not have to be unique in
43: * any way. The name is merely associated with the configured validator,
44: * and is referenced when reporting failures.
45: *
46: * @return Returns the name of this validator.
47: */
48: String getName();
49:
50: /**
51: * Called to retrieve the documentation for the validator.
52: *
53: * @return Returns the documentation for the validator.
54: */
55: DocumentationIterator getDoc();
56: } //end ValidatorWrapper
|