001    /**
002     * Copyright 2005-2011 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     */
016    package org.kuali.rice.krad.uif.component;
017    
018    import java.util.HashMap;
019    import java.util.Map;
020    
021    /**
022     * Implementation of <code>Configurable</code> that contains a Map<String, String> for holding
023     * property expressions
024     *
025     * <p>
026     * Should be extended by other UIF classes (such as <code>Component</code> or <code>LayoutManager</code>) to
027     * provide property expression support
028     * </p>
029     *
030     * @author Kuali Rice Team (rice.collab@kuali.org)
031     */
032    public abstract class ConfigurableBase implements Configurable {
033        private Map<String, String> propertyExpressions;
034    
035        public ConfigurableBase() {
036            propertyExpressions = new HashMap<String, String>();
037        }
038    
039        /**
040         * @see org.kuali.rice.krad.uif.component.ConfigurableBase#getPropertyExpressions
041         */
042        public Map<String, String> getPropertyExpressions() {
043            return propertyExpressions;
044        }
045    
046        /**
047         * @see org.kuali.rice.krad.uif.component.ConfigurableBase#setPropertyExpressions
048         */
049        public void setPropertyExpressions(Map<String, String> propertyExpressions) {
050            this.propertyExpressions = propertyExpressions;
051        }
052    
053        /**
054         * @see org.kuali.rice.krad.uif.component.ConfigurableBase#getPropertyExpression
055         */
056        public String getPropertyExpression(String propertyName) {
057            if (this.propertyExpressions.containsKey(propertyName)) {
058                return this.propertyExpressions.get(propertyName);
059            }
060    
061            return null;
062        }
063    }