01: /*
02: * Copyright 2007 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: package org.kuali.kfs.service.impl;
17:
18: import org.kuali.kfs.service.ParameterEvaluator;
19:
20: /**
21: * This implementation of ParameterEvaluator is returned by ParameterServiceImpl when evaluation involves a constraining value and
22: * neither the allow nor deny parameter have restrictions for that value.
23: */
24: public class AlwaysSucceedParameterEvaluatorImpl implements
25: ParameterEvaluator {
26: private static final AlwaysSucceedParameterEvaluatorImpl instance = new AlwaysSucceedParameterEvaluatorImpl();
27:
28: public static ParameterEvaluator getInstance() {
29: return instance;
30: }
31:
32: private AlwaysSucceedParameterEvaluatorImpl() {
33: }
34:
35: public boolean constraintIsAllow() {
36: return Boolean.TRUE;
37: }
38:
39: public boolean evaluateAndAddError(
40: Class businessObjectOrDocumentClass,
41: String constrainedPropertyName,
42: String userEditablePropertyName) {
43: return evaluationSucceeds();
44: }
45:
46: public boolean evaluateAndAddError(
47: Class businessObjectOrDocumentClass,
48: String constrainedPropertyName) {
49: return evaluationSucceeds();
50: }
51:
52: public boolean evaluationSucceeds() {
53: return Boolean.TRUE;
54: }
55:
56: public String getName() {
57: return AlwaysSucceedParameterEvaluatorImpl.class.getName();
58: }
59:
60: public String getParameterValuesForMessage() {
61: return AlwaysSucceedParameterEvaluatorImpl.class.getName();
62: }
63:
64: public String getValue() {
65: return AlwaysSucceedParameterEvaluatorImpl.class.getName();
66: }
67:
68: public void setConstrainedValue(String constrainedValue) {
69: }
70: }
|