001package org.kuali.rice.krms.builder;
002
003import org.kuali.rice.krms.dto.PropositionEditor;
004
005import java.util.HashMap;
006import java.util.List;
007import java.util.Map;
008
009/**
010 * Created with IntelliJ IDEA.
011 * User: SW
012 * Date: 2013/04/02
013 * Time: 11:05 AM
014 * To change this template use File | Settings | File Templates.
015 */
016public class SimpleTextComponentBuilder implements ComponentBuilder<PropositionEditor>{
017
018    private static final String TEXT_KEY = "kuali.term.parameter.type.free.text";
019
020    @Override
021    public List<String> getComponentIds() {
022        return null;  //To change body of implemented methods use File | Settings | File Templates.
023    }
024
025    @Override
026    public void resolveTermParameters(PropositionEditor propositionEditor, Map<String, String> termParameters) {
027        String text = termParameters.get(TEXT_KEY);
028        propositionEditor.setTermParameter(text);
029    }
030
031    @Override
032    public Map<String, String> buildTermParameters(PropositionEditor propositionEditor) {
033        Map<String, String> termParameters = new HashMap<String, String>();
034        termParameters.put(TEXT_KEY, propositionEditor.getTermParameter());
035        return termParameters;
036    }
037}