Package org.refcodes.textual
Class CsvBuilderImpl
- java.lang.Object
-
- org.refcodes.textual.CsvBuilderImpl
-
- All Implemented Interfaces:
org.refcodes.mixin.DelimiterAccessor
,org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<CsvMixin>
,org.refcodes.mixin.DelimiterAccessor.DelimiterMutator
,org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
,org.refcodes.mixin.TrimAccessor
,org.refcodes.mixin.TrimAccessor.TrimBuilder<CsvMixin>
,org.refcodes.mixin.TrimAccessor.TrimMutator
,org.refcodes.mixin.TrimAccessor.TrimProperty
,CsvBuilder
,CsvEscapeModeAccessor
,CsvEscapeModeAccessor.CsvEscapeModeBuilder<CsvMixin>
,CsvEscapeModeAccessor.CsvEscapeModeMutator
,CsvEscapeModeAccessor.CsvEscapeModeProperty
,CsvMixin
public class CsvBuilderImpl extends java.lang.Object implements CsvBuilder
This class implements the interfaceCsvBuilderImpl
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.textual.CsvEscapeModeAccessor
CsvEscapeModeAccessor.CsvEscapeModeBuilder<B extends CsvEscapeModeAccessor.CsvEscapeModeBuilder<?>>, CsvEscapeModeAccessor.CsvEscapeModeMutator, CsvEscapeModeAccessor.CsvEscapeModeProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.DelimiterAccessor
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
-
-
Constructor Summary
Constructors Constructor Description CsvBuilderImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCommentPrefixes()
Clears the prefixes used to identify CSV lines to be ignored.protected static java.util.List<java.lang.String>
fromSeparatedValues(java.lang.String aSeparatedValues)
Takes theString
and creates aList
withString
instances containing the elements as identified from theString
by splitting theString
at the delimiter positions and adding those chunks to theList
with the accordingDelimiter.CSV
delimiter..protected static java.util.List<java.lang.String>
fromSeparatedValues(java.lang.String aSeparatedValues, char aDelimiter)
Takes theString
and creates aList
withString
instances containing the elements as identified from theString
by splitting theString
at the delimiter positions and adding those chunks to theList
.protected static java.util.List<java.lang.String>
fromSeparatedValues(java.lang.String aRecord, char aDelimiter, CsvEscapeMode aCsvEscapeMode, boolean isTrimRecords)
From separated values.protected static java.util.List<java.lang.String>
fromSplitValues(java.lang.String aSplitValues)
Takes theString
and creates aList
withString
instances containing the elements as identified from theString
by splitting theString
at the delimiter positions and adding those chunks to theList
with the accordingDelimiter.CSV
delimiter..protected static java.util.List<java.lang.String>
fromSplitValues(java.lang.String aSplitValues, char aDelimiter)
Takes theString
and creates aList
withString
instances containing the elements as identified from theString
by splitting theString
at the delimiter positions and adding those chunks to theList
.protected static java.util.List<java.lang.String>
fromSplitValues(java.lang.String aValues, java.lang.String aDelimiters)
Takes theString
and creates aList
withString
instances containing the elements as identified from theString
by splitting theString
at the delimiter positions and adding those chunks to theList
.java.lang.String[]
getCommentPrefixes()
Gets the prefixes used to identify CSV lines to be ignored.CsvEscapeMode
getCsvEscapeMode()
Gets the currently setCsvEscapeMode
being used.char
getDelimiter()
java.util.Collection<java.lang.Object>
getFields()
Retrieves the CSV elements from the CSV elements property.java.lang.String
getRecord()
Retrieves the CSV line from the CSV line property.boolean
isTrim()
void
setCommentPrefixes(java.lang.String... aCommentPrefixes)
Sets the prefixes used to identify CSV lines to be ignored.void
setCsvEscapeMode(CsvEscapeMode aCsvEscapeMode)
Sets theCsvEscapeMode
to be used.void
setDelimiter(char aDelimiterChar)
void
setFields(java.lang.Object... aFields)
Sets the CSV elements for the CSV elements property.void
setFields(java.util.Collection<java.lang.Object> aFields)
Sets the CSV elements for the CSV elements property.void
setRecord(java.lang.String aRecord)
Sets the CSV line for the CSV line property.void
setTrim(boolean isTrimRecords)
protected static java.lang.String
toEscapedRegexp(char aDelimiter)
To escaped regexp.java.util.List<java.lang.String>
toFields()
Creates a list ofString
elements from the CSV line being set viaCsvBuilder.setRecord(String)
orCsvBuilder.withRecord(String)
.java.lang.String
toRecord()
Creates a CSV line from the elements being set viaCsvBuilder.setFields(String[])
orCsvBuilder.withFields(String[])
.java.lang.String
toRecord(java.lang.Object... aFields)
Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).java.lang.String
toRecord(java.lang.String... aFields)
Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).java.lang.String
toRecord(java.util.Collection<java.lang.Object> aFields)
Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method).protected static java.lang.String
toSeparatedValue(java.lang.Object aValue)
Escapes a single value according to the rules of CSV like separated values with the accordingDelimiter.CSV
delimiter.protected static java.lang.String
toSeparatedValue(java.lang.Object aValue, char aDelimiter)
Escapes a single value according to the rules of CSV like separated values.protected static java.lang.String
toSeparatedValues(java.lang.Object[] aArray)
Takes the array'sString
representation and creates a singleString
with the accordingDelimiter.CSV
delimiter.protected static java.lang.String
toSeparatedValues(java.lang.Object[] aArray, char aDelimiter)
Takes the array's String representation and creates a singleString
with the provided delimiter.protected static java.lang.String
toSeparatedValues(java.util.Collection<?> aCollection)
Takes the collection and creates a singleString
with the accordingDelimiter.CSV
delimiter.protected static java.lang.String
toSeparatedValues(java.util.Collection<?> aCollection, char aDelimiter)
Takes the collection and creates a singleString
with the provided delimiter.protected static java.lang.String
toSeparatedValues(java.util.Collection<java.lang.Object> aFields, char aDelimiter, CsvEscapeMode aCsvEscapeMode)
To separated values.protected static java.lang.String
toSplitValue(java.lang.Object aValue, char aDelimiter)
Creates theString
representation of a single split value not applying any escaping.protected static java.lang.String
toSplitValues(java.lang.Object[] aArray)
Takes the array'sString
representation and creates a singleString
with the accordingDelimiter.CSV
delimiter.protected static java.lang.String
toSplitValues(java.lang.Object[] aArray, char aDelimiter)
Takes the array's String representation and creates a singleString
with the provided delimiter.protected static java.lang.String
toSplitValues(java.util.Collection<?> aCollection)
Takes the collection and creates a singleString
with the accordingDelimiter.CSV
delimiter.protected static java.lang.String
toSplitValues(java.util.Collection<?> aCollection, char aDelimiter)
Takes the collection and creates a singleString
with the provided delimiter.java.lang.String
toString()
TheString
being build by the builder upon the settings of the attributes.java.lang.String[]
toStrings()
Creates an array ofString
s from the CSV line being set viaCsvBuilder.setRecord(String)
orCsvBuilder.withRecord(String)
.java.lang.String[]
toStrings(java.lang.String aRecord)
Convenience method for theCsvBuilder.toFields(String)
method.-
Methods inherited from interface org.refcodes.textual.CsvBuilder
setFields, setFields, setFields, setFields, setFields, setFields, setFields, setFields, setFields, setFields, setFields, setFields, setFields, setFields, setFields, setFields, setFields, toFields, toRecord, toRecord, toRecord, toRecord, toRecord, toRecord, toRecord, toRecord, toRecord, toRecord, toRecord, toRecord, toRecord, toRecord, toRecord, toRecord, toString, toString, withCommentPrefixes, withCsvEscapeMode, withDelimiter, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withFields, withRecord, withTrim
-
-
-
-
Method Detail
-
setTrim
public void setTrim(boolean isTrimRecords)
- Specified by:
setTrim
in interfaceorg.refcodes.mixin.TrimAccessor.TrimMutator
-
isTrim
public boolean isTrim()
- Specified by:
isTrim
in interfaceorg.refcodes.mixin.TrimAccessor
-
getCsvEscapeMode
public CsvEscapeMode getCsvEscapeMode()
Gets the currently setCsvEscapeMode
being used.- Specified by:
getCsvEscapeMode
in interfaceCsvEscapeModeAccessor
- Returns:
- The currently configured
CsvEscapeMode
s.
-
setCsvEscapeMode
public void setCsvEscapeMode(CsvEscapeMode aCsvEscapeMode)
Sets theCsvEscapeMode
to be used.- Specified by:
setCsvEscapeMode
in interfaceCsvEscapeModeAccessor.CsvEscapeModeMutator
- Parameters:
aCsvEscapeMode
- TheCsvEscapeMode
to be stored by theCsvEscapeMode
property.
-
setRecord
public void setRecord(java.lang.String aRecord)
Sets the CSV line for the CSV line property.- Specified by:
setRecord
in interfaceCsvBuilder
- Parameters:
aRecord
- The CSV line to be stored by the CSV line property.
-
getRecord
public java.lang.String getRecord()
Retrieves the CSV line from the CSV line property.- Specified by:
getRecord
in interfaceCsvBuilder
- Returns:
- The CSV line stored by the CSV line property.
-
setFields
public void setFields(java.lang.Object... aFields)
Sets the CSV elements for the CSV elements property.- Specified by:
setFields
in interfaceCsvBuilder
- Parameters:
aFields
- The CSV elements to be stored by the CSV elements property.
-
getFields
public java.util.Collection<java.lang.Object> getFields()
Retrieves the CSV elements from the CSV elements property.- Specified by:
getFields
in interfaceCsvBuilder
- Returns:
- The CSV elements stored by the CSV elements property.
-
setFields
public void setFields(java.util.Collection<java.lang.Object> aFields)
Sets the CSV elements for the CSV elements property.- Specified by:
setFields
in interfaceCsvBuilder
- Parameters:
aFields
- The CSV elements to be stored by the CSV elements property.
-
getDelimiter
public char getDelimiter()
- Specified by:
getDelimiter
in interfaceorg.refcodes.mixin.DelimiterAccessor
-
setDelimiter
public void setDelimiter(char aDelimiterChar)
- Specified by:
setDelimiter
in interfaceorg.refcodes.mixin.DelimiterAccessor.DelimiterMutator
-
toFields
public java.util.List<java.lang.String> toFields() throws java.lang.IllegalStateException
Creates a list ofString
elements from the CSV line being set viaCsvBuilder.setRecord(String)
orCsvBuilder.withRecord(String)
.- Specified by:
toFields
in interfaceCsvBuilder
- Returns:
- The elements created from the CSV line.
- Throws:
java.lang.IllegalStateException
- Thrown in case no elements have been set via theCsvBuilder.withFields(String[])
orCsvBuilder.setFields(String[])
methods.
-
toRecord
public java.lang.String toRecord() throws java.lang.IllegalStateException
Creates a CSV line from the elements being set viaCsvBuilder.setFields(String[])
orCsvBuilder.withFields(String[])
.- Specified by:
toRecord
in interfaceCsvBuilder
- Returns:
- The CSV line created from the CSV line.
- Throws:
java.lang.IllegalStateException
- Thrown in case no CSV line has been set via theCsvBuilder.withRecord(String)
orCsvBuilder.setRecord(String)
methods.
-
toRecord
public java.lang.String toRecord(java.lang.Object... aFields)
Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter viaCsvBuilder.withDelimiter(char)
can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination ofCsvBuilder.withFields(String...)
withCsvBuilder.toRecord()
.- Specified by:
toRecord
in interfaceCsvBuilder
- Parameters:
aFields
- The CSV elements to be converted into a record.- Returns:
- The CSV line created from the fields.
-
toRecord
public java.lang.String toRecord(java.util.Collection<java.lang.Object> aFields)
Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter viaCsvBuilder.withDelimiter(char)
can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination ofCsvBuilder.withFields(String...)
withCsvBuilder.toRecord()
.- Specified by:
toRecord
in interfaceCsvBuilder
- Parameters:
aFields
- The CSV elements to be converted into a record.- Returns:
- The CSV line created from the fields.
-
toStrings
public java.lang.String[] toStrings() throws java.lang.IllegalStateException
Creates an array ofString
s from the CSV line being set viaCsvBuilder.setRecord(String)
orCsvBuilder.withRecord(String)
. It should return the same result as an array as a call toCsvBuilder.toFields()
. Returns null if the record is a comment as ofCsvMixin.isComment(String)
.- Specified by:
toStrings
in interfaceCsvBuilder
- Returns:
- The elements created from the CSV line or null if the record is a comment.
- Throws:
java.lang.IllegalStateException
-
toRecord
public java.lang.String toRecord(java.lang.String... aFields) throws java.lang.IllegalStateException
Creates a CSV line from the fields being provided This method is to be side effect free in terms of the fields (and the resulting record) is not part of the state for this instance (from the point of view of this method). Still changing for example the delimiter viaCsvBuilder.withDelimiter(char)
can cause side effects! For avoiding thread race conditions / side effects regarding the fields (and the resulting record), use this method instead of the combination ofCsvBuilder.withFields(String...)
withCsvBuilder.toRecord()
.- Specified by:
toRecord
in interfaceCsvBuilder
- Parameters:
aFields
- The CSV elements to be converted into a record.- Returns:
- The CSV line created from the fields.
- Throws:
java.lang.IllegalStateException
-
toStrings
public java.lang.String[] toStrings(java.lang.String aRecord)
Convenience method for theCsvBuilder.toFields(String)
method.- Specified by:
toStrings
in interfaceCsvBuilder
- Parameters:
aRecord
- The CSV line to be stored by the CSV line property.- Returns:
- The elements created from the CSV line or null if the record is a comment.
-
toString
public java.lang.String toString() throws java.lang.IllegalStateException
TheString
being build by the builder upon the settings of the attributes. It should return the same result as a call toCsvBuilder.toRecord()
.- Specified by:
toString
in interfaceCsvBuilder
- Overrides:
toString
in classjava.lang.Object
- Returns:
- The according resulting
String
- Throws:
java.lang.IllegalStateException
-
setCommentPrefixes
public void setCommentPrefixes(java.lang.String... aCommentPrefixes)
Sets the prefixes used to identify CSV lines to be ignored.- Specified by:
setCommentPrefixes
in interfaceCsvMixin
- Parameters:
aCommentPrefixes
- The prefixes used to identify CSV lines to be ignored.
-
getCommentPrefixes
public java.lang.String[] getCommentPrefixes()
Gets the prefixes used to identify CSV lines to be ignored.- Specified by:
getCommentPrefixes
in interfaceCsvMixin
- Returns:
- return The prefixes used to identify CSV lines to be ignored.
-
clearCommentPrefixes
public void clearCommentPrefixes()
Clears the prefixes used to identify CSV lines to be ignored. No CSV lines will be ignored any more.- Specified by:
clearCommentPrefixes
in interfaceCsvMixin
-
fromSeparatedValues
protected static java.util.List<java.lang.String> fromSeparatedValues(java.lang.String aRecord, char aDelimiter, CsvEscapeMode aCsvEscapeMode, boolean isTrimRecords)
From separated values.- Parameters:
aRecord
- the recordaDelimiter
- the delimiteraCsvEscapeMode
- the csv escape modeisTrimRecords
- When true, then leading and trailing whitespaces are trimmed.- Returns:
- the list
-
toSeparatedValues
protected static java.lang.String toSeparatedValues(java.util.Collection<java.lang.Object> aFields, char aDelimiter, CsvEscapeMode aCsvEscapeMode)
To separated values.- Parameters:
aFields
- the fieldsaDelimiter
- the delimiteraCsvEscapeMode
- the csv escape mode- Returns:
- the string
-
toSeparatedValues
protected static java.lang.String toSeparatedValues(java.util.Collection<?> aCollection)
Takes the collection and creates a singleString
with the accordingDelimiter.CSV
delimiter. Unescaping any escaped chars is taken care of by this method, for example an unescaped delimiter char is escaped in the result.- Parameters:
aCollection
- The collection to be converted to a single CSVString
.- Returns:
- The single CSV
String
from the collection.
-
toSeparatedValues
protected static java.lang.String toSeparatedValues(java.util.Collection<?> aCollection, char aDelimiter)
Takes the collection and creates a singleString
with the provided delimiter. Unescaping any escaped chars is taken care of by this method, for example an unescaped delimiter char is escaped in the result.- Parameters:
aCollection
- The collection to be converted to a single CSVString
.aDelimiter
- The delimiter to use for creating the single CSVString
.- Returns:
- The single CSV
String
from the collection.
-
toSeparatedValue
protected static java.lang.String toSeparatedValue(java.lang.Object aValue)
Escapes a single value according to the rules of CSV like separated values with the accordingDelimiter.CSV
delimiter.- Parameters:
aValue
- The value which'sString
representation is to be escaped accordingly.- Returns:
- A single value escaped according to the rules of CSV like separated values.
-
toSeparatedValue
protected static java.lang.String toSeparatedValue(java.lang.Object aValue, char aDelimiter)
Escapes a single value according to the rules of CSV like separated values.- Parameters:
aValue
- The value which'sString
representation is to be escaped accordingly.aDelimiter
- The delimiter to use for creating the single CSVString
.- Returns:
- A single value escaped according to the rules of CSV like separated values.
-
fromSeparatedValues
protected static java.util.List<java.lang.String> fromSeparatedValues(java.lang.String aSeparatedValues)
Takes theString
and creates aList
withString
instances containing the elements as identified from theString
by splitting theString
at the delimiter positions and adding those chunks to theList
with the accordingDelimiter.CSV
delimiter.. Escaping any unescaped chars is taken care of by this method, for example an escaped delimiter char is unescaped in the result.- Parameters:
aSeparatedValues
- TheString
representing the CSVString
where contained elements are separated from each other by the given delimiter.- Returns:
- The
List
containing the elements as identified from the given CSVString
.
-
fromSeparatedValues
protected static java.util.List<java.lang.String> fromSeparatedValues(java.lang.String aSeparatedValues, char aDelimiter)
Takes theString
and creates aList
withString
instances containing the elements as identified from theString
by splitting theString
at the delimiter positions and adding those chunks to theList
. Escaping any unescaped chars is taken care of by this method, for example an escaped delimiter char is unescaped in the result.- Parameters:
aSeparatedValues
- TheString
representing the CSVString
where contained elements are separated from each other by the given delimiter.aDelimiter
- The delimiter used for separating the elements if the single CSVString
.- Returns:
- The
List
containing the elements as identified from the given CSVString
.
-
toSplitValues
protected static java.lang.String toSplitValues(java.lang.Object[] aArray)
Takes the array'sString
representation and creates a singleString
with the accordingDelimiter.CSV
delimiter. No escaping is taken care of, for escaping either use the accordingtoSeparatedValues(Object[])
method or do escaping manually.- Parameters:
aArray
- The array to be converted to a single CSVString
.- Returns:
- The single CSV
String
from theString
array.
-
toSplitValues
protected static java.lang.String toSplitValues(java.lang.Object[] aArray, char aDelimiter)
Takes the array's String representation and creates a singleString
with the provided delimiter. No escaping is taken of, for escaping either use the accordingtoSeparatedValues(Object[], char)
method or do escaping manually.- Parameters:
aArray
- The array to be converted to a single CSVString
.aDelimiter
- The delimiter to use for creating the single CSVString
.- Returns:
- The single CSV
String
from theString
array.
-
toSplitValues
protected static java.lang.String toSplitValues(java.util.Collection<?> aCollection)
Takes the collection and creates a singleString
with the accordingDelimiter.CSV
delimiter. No escaping is taken of, for escaping either use the accordingtoSeparatedValues(java.util.Collection<java.lang.Object>,char,org.refcodes.textual.CsvEscapeMode)
method or do escaping manually viatoSeparatedValue(java.lang.Object)
.- Parameters:
aCollection
- The collection to be converted to a single CSVString
.- Returns:
- The single CSV
String
from the collection.
-
toSplitValues
protected static java.lang.String toSplitValues(java.util.Collection<?> aCollection, char aDelimiter)
Takes the collection and creates a singleString
with the provided delimiter. No escaping is taken of, for escaping either use the accordingtoSeparatedValues(java.util.Collection<java.lang.Object>,char,org.refcodes.textual.CsvEscapeMode)
method or do escaping manually viatoSeparatedValue(java.lang.Object)
.- Parameters:
aCollection
- The collection to be converted to a single CSVString
.aDelimiter
- The delimiter to use for creating the single CSVString
.- Returns:
- The single CSV
String
from the collection.
-
toSplitValue
protected static java.lang.String toSplitValue(java.lang.Object aValue, char aDelimiter)
Creates theString
representation of a single split value not applying any escaping.- Parameters:
aValue
- The value which'sString
representation is to be retrieved.aDelimiter
- The delimiter to use for creating the single CSVString
.- Returns:
- A single value not escaped as required by plain split values.
-
fromSplitValues
protected static java.util.List<java.lang.String> fromSplitValues(java.lang.String aSplitValues)
Takes theString
and creates aList
withString
instances containing the elements as identified from theString
by splitting theString
at the delimiter positions and adding those chunks to theList
with the accordingDelimiter.CSV
delimiter.. Escaping any unescaped chars is taken care of by this method, for example an escaped delimiter char is unescaped in the result.- Parameters:
aSplitValues
- TheString
representing the CSVString
where contained elements are split from each other by the given delimiter.- Returns:
- The
List
containing the elements as identified from the given CSVString
.
-
fromSplitValues
protected static java.util.List<java.lang.String> fromSplitValues(java.lang.String aSplitValues, char aDelimiter)
Takes theString
and creates aList
withString
instances containing the elements as identified from theString
by splitting theString
at the delimiter positions and adding those chunks to theList
. Escaping any unescaped chars is taken care of by this method, for example an escaped delimiter char is unescaped in the result.- Parameters:
aSplitValues
- TheString
representing the CSVString
where contained elements are split from each other by the given delimiter.aDelimiter
- The delimiter used for separating the elements if the single CSVString
.- Returns:
- The
List
containing the elements as identified from the given CSVString
.
-
fromSplitValues
protected static java.util.List<java.lang.String> fromSplitValues(java.lang.String aValues, java.lang.String aDelimiters)
Takes theString
and creates aList
withString
instances containing the elements as identified from theString
by splitting theString
at the delimiter positions and adding those chunks to theList
. Escaping any unescaped chars is taken care of by this method, for example an escaped delimiter char is unescaped in the result.- Parameters:
aValues
- TheString
representing the CSVString
where contained elements are separated from each other by the given delimiter.aDelimiters
- The delimiter characters used for separating the elements.- Returns:
- The
List
containing the elements as identified from the given CSVString
.
-
toSeparatedValues
protected static java.lang.String toSeparatedValues(java.lang.Object[] aArray)
Takes the array'sString
representation and creates a singleString
with the accordingDelimiter.CSV
delimiter. Unescaping any escaped chars is taken care of by this method, for example an unescaped delimiter char is escaped in the result.- Parameters:
aArray
- The array to be converted to a single CSVString
.- Returns:
- The single CSV
String
from theString
array.
-
toSeparatedValues
protected static java.lang.String toSeparatedValues(java.lang.Object[] aArray, char aDelimiter)
Takes the array's String representation and creates a singleString
with the provided delimiter. Unescaping any escaped chars is taken care of by this method, for example an unescaped delimiter char is escaped in the result.- Parameters:
aArray
- The array to be converted to a single CSVString
.aDelimiter
- The delimiter to use for creating the single CSVString
.- Returns:
- The single CSV
String
from theString
array.
-
toEscapedRegexp
protected static java.lang.String toEscapedRegexp(char aDelimiter)
To escaped regexp.- Parameters:
aDelimiter
- the delimiter- Returns:
- the string
-
-