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.krad.uif.component;
017
018import java.util.Map;
019
020/**
021 * Marks any class that can be configured through the UIF dictionary
022 *
023 * <p>
024 * Indicates behavior that must be supported by an Class that can be configured through
025 * the UIF dictionary, such as property expressions.
026 * </p>
027 *
028 * @author Kuali Rice Team (rice.collab@kuali.org)
029 */
030public interface Configurable {
031
032    /**
033     * Map of expressions that should be evaluated to conditionally set a property on the component
034     *
035     * <p>
036     * When configuring a component property through XML an expression can be given using the @{} placeholder. During
037     * the loading of the XML any such expressions are captured and placed into this Map, with the property they apply
038     * to set as the Map key. The expressions are then evaluated during the apply model phase and the result is set as
039     * the property value.
040     * </p>
041     *
042     * <p>
043     * Note after the expression is picked up, the property configuration is removed. Thus the property in the
044     * component will only have its default object value until the expression is evaluated
045     * </p>
046     *
047     * @return Map<String, String> map of expressions where key is property name and value is expression to evaluate
048     */
049    public Map<String, String> getPropertyExpressions();
050
051    /**
052     * Setter for the Map of property expressions
053     *
054     * @param propertyExpressions
055     */
056    public void setPropertyExpressions(Map<String, String> propertyExpressions);
057
058    /**
059     * Returns the expression configured for the property with the given name
060     *
061     * @return String expression for property or null if expression is not configured
062     * @see Component#getPropertyExpressions()
063     */
064    public String getPropertyExpression(String propertyName);
065}