public Map<String, String> getMapOfStrings(String key) { Map<String, Object> value = getMap(key); Map<String, String> transValue = new HashMap<String, String>(); for (Map.Entry<String, Object> entry : value.entrySet()) { transValue.put(entry.getKey(), String.valueOf(entry.getValue())); } return transValue; }
public Map<String, String> getMapOfStrings(String key) { Map<String, Object> value = getMap(key); Map<String, String> transValue = new HashMap<String, String>(); for (Map.Entry<String, Object> entry : value.entrySet()) { transValue.put(entry.getKey(), String.valueOf(entry.getValue())); } return transValue; }
public FormBuilderDTOHelper getSubDto(String key) { return new FormBuilderDTOHelper(getMap(key)); }
public FormBuilderDTOHelper getSubDto(String key) { return new FormBuilderDTOHelper(getMap(key)); }
@Override public Map<String, Object> getDataMap() { FormBuilderDTOHelper helper = new FormBuilderDTOHelper(); helper.setString("html", html); helper.setString("commandClass", commandClass); if (subMenu != null) { List<Object> subItems = new ArrayList<Object>(); for (MenuOptionDescription option : subMenu) { subItems.add(option.getDataMap()); } helper.setList("subMenu", subItems); } return helper.getMap(); }
@Override public Map<String, Object> getDataMap() { FormBuilderDTOHelper helper = new FormBuilderDTOHelper(); helper.setString("html", html); helper.setString("commandClass", commandClass); if (subMenu != null) { List<Object> subItems = new ArrayList<Object>(); for (MenuOptionDescription option : subMenu) { subItems.add(option.getDataMap()); } helper.setList("subMenu", subItems); } return helper.getMap(); }
@Override public void setDataMap(Map<String, Object> dataMap) throws FormEncodingException { FormBuilderDTOHelper helper = new FormBuilderDTOHelper(dataMap); this.html = helper.getString("html"); this.commandClass = helper.getString("commandClass"); List<FormBuilderDTOHelper> subItems = helper.getListOfDtoHelpers("subMenu"); this.subMenu.clear(); if (subItems != null) { for (FormBuilderDTOHelper subHelper : subItems) { MenuOptionDescription option = new MenuOptionDescription(); option.setDataMap(subHelper.getMap()); this.subMenu.add(option); } } } }
@Override public void setDataMap(Map<String, Object> dataMap) throws FormEncodingException { FormBuilderDTOHelper helper = new FormBuilderDTOHelper(dataMap); this.html = helper.getString("html"); this.commandClass = helper.getString("commandClass"); List<FormBuilderDTOHelper> subItems = helper.getListOfDtoHelpers("subMenu"); this.subMenu.clear(); if (subItems != null) { for (FormBuilderDTOHelper subHelper : subItems) { MenuOptionDescription option = new MenuOptionDescription(); option.setDataMap(subHelper.getMap()); this.subMenu.add(option); } } } }
try { item = (FormItemRepresentation) itemRep.createInstance(); item.setDataMap(itemRep.getMap()); } catch (Exception ex) { throw new FormEncodingException("invalid form item", ex); try { FBValidation validation = (FBValidation) subDto.createInstance(); validation.setDataMap(subDto.getMap()); formValidations.add(validation); } catch (Exception ex) { Map<String, Object> inputsMap = helper.getMap("inputs"); this.inputs.clear(); for (Map.Entry<String, Object> entry : inputsMap.entrySet()) { Map<String, Object> outputsMap = helper.getMap("outputs"); this.outputs.clear(); for (Map.Entry<String, Object> entry : outputsMap.entrySet()) { for (FormBuilderDTOHelper scriptRep : loadScriptsRep) { ScriptRepresentation script = new ScriptRepresentation(); script.setDataMap(scriptRep.getMap()); this.onLoadScripts.add(script); for (FormBuilderDTOHelper scriptRep : submitScriptsRep) { ScriptRepresentation script = new ScriptRepresentation(); script.setDataMap(scriptRep.getMap()); this.onSubmitScripts.add(script);
try { item = (FormItemRepresentation) itemRep.createInstance(); item.setDataMap(itemRep.getMap()); } catch (Exception ex) { throw new FormEncodingException("invalid form item", ex); try { FBValidation validation = (FBValidation) subDto.createInstance(); validation.setDataMap(subDto.getMap()); formValidations.add(validation); } catch (Exception ex) { Map<String, Object> inputsMap = helper.getMap("inputs"); this.inputs.clear(); for (Map.Entry<String, Object> entry : inputsMap.entrySet()) { Map<String, Object> outputsMap = helper.getMap("outputs"); this.outputs.clear(); for (Map.Entry<String, Object> entry : outputsMap.entrySet()) { for (FormBuilderDTOHelper scriptRep : loadScriptsRep) { ScriptRepresentation script = new ScriptRepresentation(); script.setDataMap(scriptRep.getMap()); this.onLoadScripts.add(script); for (FormBuilderDTOHelper scriptRep : submitScriptsRep) { ScriptRepresentation script = new ScriptRepresentation(); script.setDataMap(scriptRep.getMap()); this.onSubmitScripts.add(script);
return helper.getMap();
return helper.getMap();