View Javadoc

1   package org.kuali.rice.krms.builder;
2   
3   import org.kuali.rice.krms.dto.PropositionEditor;
4   
5   import java.util.HashMap;
6   import java.util.List;
7   import java.util.Map;
8   
9   /**
10   * Created with IntelliJ IDEA.
11   * User: SW
12   * Date: 2013/04/02
13   * Time: 11:05 AM
14   * To change this template use File | Settings | File Templates.
15   */
16  public class SimpleTextComponentBuilder implements ComponentBuilder<PropositionEditor>{
17  
18      private static final String TEXT_KEY = "kuali.term.parameter.type.free.text";
19  
20      @Override
21      public List<String> getComponentIds() {
22          return null;  //To change body of implemented methods use File | Settings | File Templates.
23      }
24  
25      @Override
26      public void resolveTermParameters(PropositionEditor propositionEditor, Map<String, String> termParameters) {
27          String text = termParameters.get(TEXT_KEY);
28          propositionEditor.setTermParameter(text);
29      }
30  
31      @Override
32      public Map<String, String> buildTermParameters(PropositionEditor propositionEditor) {
33          Map<String, String> termParameters = new HashMap<String, String>();
34          termParameters.put(TEXT_KEY, propositionEditor.getTermParameter());
35          return termParameters;
36      }
37  }