CsvUtil

Skip to end of metadata



Go to start of metadata


Description

  • org.joget.commons.util.CsvUtil
  • Under wflow-commons module
  • Utility method used to deal with comma separated value (CSV)

Code Sample

import org.joget.commons.util.CsvUtil;

 

 

String[] values = new String[]{"apple""banana""""orange"};

 

//result is apple,banana,orange

String csv = CsvUtil.getDeliminatedString(values, CsvUtil.DEFAULT_DELIMINATOR, true);

Fields

DEFAULT_DELIMINATOR
public static final String DEFAULT_DELIMINATOR = ",";

Used as default deliminator of generate CSV string


Methods

getDeliminatedString
public static java.lang.String getDeliminatedString(java.lang.String[] array)

Convert a String array as CSV

getDeliminatedString
public static java.lang.String getDeliminatedString(java.lang.String[] array, java.lang.String deliminator)

Convert a String array as CSV with custom deliminator

getDeliminatedString
public static java.lang.String getDeliminatedString(java.lang.String[] array, java.lang.String deliminator, boolean ignoreEmptyValue)

Convert a String array as CSV with custom deliminator. Option to remove empty String from result.

getPluginPropertyMap
public static java.util.Map<java.lang.String, java.lang.String> getPluginPropertyMap(java.lang.String propertyString) throws java.io.IOException

Retrieve plugin properties from a CSV string.

Deprecated method used by Joget v2 to parse plugin properties from a CSV string. Since Joget v3, Joget introduced a better UI for plugin configuration, the properties are stored in JSON format.

文档更新时间: 2018-11-06 07:03   作者:李庆