Example usage for org.apache.commons.lang.text StrTokenizer getCSVInstance

List of usage examples for org.apache.commons.lang.text StrTokenizer getCSVInstance

Introduction

In this page you can find the example usage for org.apache.commons.lang.text StrTokenizer getCSVInstance.

Prototype

public static StrTokenizer getCSVInstance() 

Source Link

Document

Gets a new tokenizer instance which parses Comma Separated Value strings initializing it with the given input.

Usage

From source file:nl.nn.adapterframework.jdbc.MessageStoreListener.java

@Override
public Object getRawMessage(Map threadContext) throws ListenerException {
    Object rawMessage = super.getRawMessage(threadContext);
    if (rawMessage != null && sessionKeys != null) {
        MessageWrapper messageWrapper = (MessageWrapper) rawMessage;
        StrTokenizer strTokenizer = StrTokenizer.getCSVInstance().reset(messageWrapper.getText());
        messageWrapper.setText((String) strTokenizer.next());
        int i = 0;
        while (strTokenizer.hasNext()) {
            threadContext.put(sessionKeysList.get(i), strTokenizer.next());
            i++;/*from   w  w w .j a v  a2  s  .c  o m*/
        }
    }
    return rawMessage;
}