Class CSVFormatter
java.lang.Object
java.util.logging.Formatter
de.aristaflow.adept2.base.registry.CSVFormatter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringChecks whether the designated string contains control characters (field or record separators) and escapes them if required.protected StringescapedString(String string) Escapes all control characters in the designated string and encloses the string with the corresponding characters.protected booleanescapeRequired(String string) Gets whether the designated string contains control characters (field or record separators) and therefore needs escaping.Gets the header line containing the names of the fields of a record as needed for a CSV.Methods inherited from class java.util.logging.Formatter
formatMessage, getTail
-
Constructor Details
-
CSVFormatter
public CSVFormatter()Creates a new formatter for CSV.
-
-
Method Details
-
format
-
getHead
Gets the header line containing the names of the fields of a record as needed for a CSV. -
escape
Checks whether the designated string contains control characters (field or record separators) and escapes them if required.- Parameters:
string- The string to check for required escaping.- Returns:
- The designated string with the corresponding characters escaped if required.
-
escapeRequired
Gets whether the designated string contains control characters (field or record separators) and therefore needs escaping.- Parameters:
string- The string to check for required escaping.- Returns:
- Whether the designated string contains control characters (field or record separators) and therefore needs escaping.
-
escapedString
Escapes all control characters in the designated string and encloses the string with the corresponding characters.- Parameters:
string- The string to enclose within the corresponding characters and to escape the used control characters.- Returns:
- The designated string enclosed and having the appropriate characters escaped.
-