public static ElementParameterType getElemeterParameterType(IElementParameter param) { if (param == null) { return null; } ElementParameterType targetPramType = TalendFileFactory.eINSTANCE.createElementParameterType(); if (param.getParentParameter() != null) { targetPramType.setName( param.getParentParameter().getName() + ":" + param.getName()); // $NON-NLS-1$ } else { targetPramType.setName(param.getName()); } targetPramType.setField(param.getFieldType().getName()); targetPramType.setContextMode(param.isContextMode()); Object value = param.getValue(); if (param.getFieldType().equals(EParameterFieldType.TABLE) && value != null) { List<Map<String, Object>> tableValues = (List<Map<String, Object>>) value; for (Map<String, Object> currentLine : tableValues) { for (int i = 0; i < param.getListItemsDisplayCodeName().length; i++) { ElementValueType elementValue = TalendFileFactory.eINSTANCE.createElementValueType(); elementValue.setElementRef(param.getListItemsDisplayCodeName()[i]); Object o = currentLine.get(param.getListItemsDisplayCodeName()[i]); IElementParameter tmpParam = null; Object[] listItemsValue = param.getListItemsValue(); if (listItemsValue.length > i) { tmpParam = (IElementParameter) listItemsValue[i]; } String strValue = ""; // $NON-NLS-1$ if (o instanceof Integer && tmpParam != null) { if (tmpParam.getListItemsValue().length == 0) { strValue = ""; // $NON-NLS-1$ } else { strValue = (String) tmpParam.getListItemsValue()[(Integer) o]; } } else { if (o instanceof String) { strValue = (String) o; } else { if (o instanceof Boolean) { strValue = ((Boolean) o).toString(); } } } if (tmpParam != null && tmpParam.getFieldType().equals(EParameterFieldType.PASSWORD)) { elementValue.setValue(strValue, true); } else { elementValue.setValue(strValue); } // Object object = currentLine.get(param.getListItemsDisplayCodeName()[i] + IEbcdicConstant.REF_TYPE); if (object != null) { elementValue.setType((String) object); } targetPramType.getElementValue().add(elementValue); } } } else { if (value == null) { targetPramType.setValue(""); // $NON-NLS-1$ } else { if (value instanceof Boolean) { targetPramType.setValue(((Boolean) value).toString()); } else { if (value instanceof String) { targetPramType.setRawValue(value.toString()); } } } } return targetPramType; }