public static List<String> getParameterList(String parameterString) {
        List<String> parameterList = new ArrayList<>();

        StringTokenizer tok = new StringTokenizer(parameterString, ",");
        while (tok.hasMoreElements()) {
            String param = tok.nextToken().trim();
            parameterList.add(cutOffSingleQuotes(param));
        }

        List<String> postProcessed = new ArrayList<>();
        for (int i = 0; i < parameterList.size(); i++) {
            int next = i + 1;

            String processed = parameterList.get(i);

            if (processed.startsWith("'") && !processed.endsWith("'")) {
                while (next < parameterList.size()) {
                    if (parameterString.contains(processed + ", " + parameterList.get(next))) {
                        processed += ", " + parameterList.get(next);
                    } else if (parameterString.contains(processed + "," + parameterList.get(next))) {
                        processed += "," + parameterList.get(next);
                    } else if (parameterString.contains(processed + " , " + parameterList.get(next))) {
                        processed += " , " + parameterList.get(next);
                    } else {
                        processed += parameterList.get(next);
                    }

                    i++;
                    if (parameterList.get(next).endsWith("'")) {
                        break;
                    } else {
                        next++;
                    }
                }

            }

            postProcessed.add(cutOffSingleQuotes(processed));
        }

        return postProcessed;
    }
public static List < String > getParameterList ( String parameterString ) { List < String > parameterList = new ArrayList < > ( ) ; StringTokenizer tok = new StringTokenizer ( parameterString , "," ) ; while ( tok . hasMoreElements ( ) ) { String param = tok . nextToken ( ) . trim ( ) ; parameterList . add ( cutOffSingleQuotes ( param ) ) ; } List < String > postProcessed = new ArrayList < > ( ) ; for ( int i = 0 ; i < parameterList . size ( ) ; i ++ ) { int next = i + 1 ; String processed = parameterList . get ( i ) ; if ( processed . startsWith ( "'" ) && ! processed . endsWith ( "'" ) ) { while ( next < parameterList . size ( ) ) { if ( parameterString . contains ( processed + ", " + parameterList . get ( next ) ) ) { processed += ", " + parameterList . get ( next ) ; } else if ( parameterString . contains ( processed + "," + parameterList . get ( next ) ) ) { processed += "," + parameterList . get ( next ) ; } else if ( parameterString . contains ( processed + " , " + parameterList . get ( next ) ) ) { processed += " , " + parameterList . get ( next ) ; } else { processed += parameterList . get ( next ) ; } i ++ ; if ( parameterList . get ( next ) . endsWith ( "'" ) ) { break ; } else { next ++ ; } } } postProcessed . add ( cutOffSingleQuotes ( processed ) ) ; } return postProcessed ; }
Convert a parameter string to a list of parameters.

@param parameterString comma separated parameter string.
@return list of parameters.