001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.core.impl.parameter;
017
018
019import org.kuali.rice.core.api.parameter.ParameterEvaluator;
020
021/**
022 * This implementation of ParameterEvaluator is returned by ParameterServiceImpl when evaluation involves a constraining value and
023 * neither the allow nor deny parameter have restrictions for that value.
024 */
025public class AlwaysSucceedParameterEvaluatorImpl implements ParameterEvaluator {
026    private static final AlwaysSucceedParameterEvaluatorImpl instance = new AlwaysSucceedParameterEvaluatorImpl();
027
028    public static ParameterEvaluator getInstance() {
029        return instance;
030    }
031
032    private AlwaysSucceedParameterEvaluatorImpl() {
033    }
034
035    public boolean constraintIsAllow() {
036        return Boolean.TRUE;
037    }
038
039
040    public boolean evaluateAndAddError(Class businessObjectOrDocumentClass, String constrainedPropertyName, String userEditablePropertyName) {
041        return evaluationSucceeds();
042    }
043
044    public boolean evaluateAndAddError(Class businessObjectOrDocumentClass, String constrainedPropertyName) {
045        return evaluationSucceeds();
046    }
047
048    public boolean evaluationSucceeds() {
049        return Boolean.TRUE;
050    }
051
052    public String getName() {
053        return AlwaysSucceedParameterEvaluatorImpl.class.getName();
054    }
055
056    public String getParameterValuesForMessage() {
057        return AlwaysSucceedParameterEvaluatorImpl.class.getName();
058    }
059
060    public String getValue() {
061        return AlwaysSucceedParameterEvaluatorImpl.class.getName();
062    }
063
064    public void setConstrainedValue(String constrainedValue) {
065    }
066}