jp.terasoluna.fw.web.codelist
Class MappedCodeListLoader

java.lang.Object
  extended by jp.terasoluna.fw.web.codelist.MappedCodeListLoader
All Implemented Interfaces:
CodeListLoader

public class MappedCodeListLoader
extends java.lang.Object
implements CodeListLoader

Implementation class of CodeListLoader initializes the code list information in Map.

For creating the codelist by using this class, use setCodeListMap(Map) method and provide the code list information in Map format and then execute load().

Usage example in Spring framework.
 <bean id="reader1"
       class="jp.terasoluna.fw.web.codelist.MappedCodeListLoader"
       init-method="load">
     <property name="codeListMap">
         <map>
             <entry key="001">
                 <value>value001</value>
             </entry>
             <entry key="002">
                 <value>value002</value>
             </entry>
             <entry key="003">
                 <value>value003</value>
             </entry>
         </map>
     </property>
 </bean>
 


Field Summary
private  java.util.Map<java.lang.String,java.lang.String> codeListMap
          Map which is assigned at the time of initializing the code list information.
private  java.util.List<CodeBean> codeLists
          Code list.
 
Constructor Summary
MappedCodeListLoader()
           
 
Method Summary
 CodeBean[] getCodeBeans()
          Fetches the code list.

Code list can be fetched as the array of CodeBean.
*Code list is the unique information in the application. In case of overriding this method, implementation should be done in such a way that there should be no impact even if the contents of code list are edited by using business logic.
 java.util.Map getCodeListMap()
          Fetches the code list initialization information Map.
 void load()
          Initializes the code list.

Generates CodeBean from the codeListMap information which is already set.
 void setCodeListMap(java.util.Map<java.lang.String,java.lang.String> codeListMap)
          Sets the code list initialization information Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codeListMap

private java.util.Map<java.lang.String,java.lang.String> codeListMap
code>Map which is assigned at the time of initializing the code list information.


codeLists

private java.util.List<CodeBean> codeLists
Code list.

See Also:
CodeBean
Constructor Detail

MappedCodeListLoader

public MappedCodeListLoader()
Method Detail

getCodeListMap

public java.util.Map getCodeListMap()
Fetches the code list initialization information Map.

Returns:
Code list initialization information Map

setCodeListMap

public void setCodeListMap(java.util.Map<java.lang.String,java.lang.String> codeListMap)
Sets code list initialization information Map.

Parameters:
codeListMap - Code list initialization information Map

load

public void load()
Initializes the code list.

Generates CodeBean from the codeListMap information which is already set.

Specified by:
load in interface CodeListLoader

getCodeBeans

public CodeBean[] getCodeBeans()
Fetches the code list.

Code list can be fetched as an array of CodeBean.
*Code list is the unique information in the application. In case of overriding this method, implementation should be done in such a way that there should be no impact even if the contents of code list are edited by using business logic.

Specified by:
getCodeBeans in interface CodeListLoader
Returns:
Code list