001/**
002 * Copyright 2010-2014 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.common.util.spring;
017
018import java.util.List;
019import java.util.Properties;
020
021import org.kuali.common.util.PropertyUtils;
022import org.kuali.common.util.property.processor.PropertyProcessor;
023import org.springframework.beans.factory.FactoryBean;
024
025public class PropertyProcessorFactoryBean implements FactoryBean<Properties> {
026
027        Properties properties;
028        List<PropertyProcessor> processors;
029
030        @Override
031        public Properties getObject() {
032                PropertyUtils.process(properties, processors);
033                return properties;
034        }
035
036        @Override
037        public Class<Properties> getObjectType() {
038                return Properties.class;
039        }
040
041        @Override
042        public boolean isSingleton() {
043                return false;
044        }
045
046        public Properties getProperties() {
047                return properties;
048        }
049
050        public void setProperties(Properties properties) {
051                this.properties = properties;
052        }
053
054        public List<PropertyProcessor> getProcessors() {
055                return processors;
056        }
057
058        public void setProcessors(List<PropertyProcessor> processors) {
059                this.processors = processors;
060        }
061
062}