public class CsvGenerator extends Object implements OneToOneObjectGenerator<String>
Element, based on the fields and constants provided.
For example, if you provide:
fields=[prop1, SOURCE, DESTINATION, prop2, GROUP] and constants=["constant1", "constant2"]The output will be:
prop1Value,sourceValue,destinationValue,prop2,groupValue,constant1,constant2
| Modifier and Type | Class and Description |
|---|---|
static class |
CsvGenerator.Builder |
| Modifier and Type | Field and Description |
|---|---|
static String |
COMMA |
static String |
GROUP |
| Constructor and Description |
|---|
CsvGenerator() |
| Modifier and Type | Method and Description |
|---|---|
String |
_apply(Element element) |
String |
getCommaReplacement() |
LinkedHashMap<String,String> |
getConstants() |
LinkedHashMap<String,String> |
getFields() |
String |
getHeader()
Generates a CSV String from, if present, the fields and constants
|
boolean |
isQuoted() |
void |
setCommaReplacement(String commaReplacement) |
void |
setConstants(LinkedHashMap<String,String> constants) |
void |
setFields(LinkedHashMap<String,String> fields) |
void |
setQuoted(boolean quoted) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplypublic static final String GROUP
public static final String COMMA
public LinkedHashMap<String,String> getFields()
public void setFields(LinkedHashMap<String,String> fields)
public LinkedHashMap<String,String> getConstants()
public void setConstants(LinkedHashMap<String,String> constants)
public String _apply(Element element)
_apply in interface OneToOneObjectGenerator<String>element - the element to convertpublic String getHeader()
public boolean isQuoted()
public void setQuoted(boolean quoted)
public String getCommaReplacement()
public void setCommaReplacement(String commaReplacement)
Copyright © 2022. All rights reserved.