01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php
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:
17: package org.kuali.core.datadictionary.control;
18:
19: import org.kuali.core.datadictionary.ValidationCompletionUtils;
20: import org.kuali.core.datadictionary.exception.ClassValidationException;
21: import org.kuali.core.datadictionary.exception.CompletionException;
22: import org.kuali.core.lookup.keyvalues.KeyValuesFinder;
23:
24: /**
25: * A single HTML select control.
26: *
27: */
28: public abstract class MultivalueControlDefinitionBase extends
29: ControlDefinitionBase {
30: /**
31: * @see org.kuali.core.datadictionary.DataDictionaryDefinition#completeValidation(java.lang.Class, java.lang.Class)
32: */
33: public void completeValidation(Class rootBusinessObjectClass,
34: Class otherBusinessObjectClass,
35: ValidationCompletionUtils validationCompletionUtils) {
36: super .completeValidation(rootBusinessObjectClass,
37: otherBusinessObjectClass, validationCompletionUtils);
38:
39: Class valuesFinder = getValuesFinderClass();
40: if (valuesFinder == null) {
41: throw new CompletionException("error validating "
42: + rootBusinessObjectClass.getName()
43: + " control: keyValuesFinder was never set ("
44: + getParseLocation() + ")");
45: }
46: if (!KeyValuesFinder.class.isAssignableFrom(valuesFinder)) {
47: throw new ClassValidationException("error validating "
48: + rootBusinessObjectClass.getName()
49: + " control: class '" + valuesFinder.getName()
50: + "' is not a KeyValuesFinder subclass ("
51: + getParseLocation() + ")");
52: }
53: }
54: }
|