- All Superinterfaces:
CsvEscapeModeAccessor
,CsvEscapeModeAccessor.CsvEscapeModeBuilder<CsvMixin>
,CsvEscapeModeAccessor.CsvEscapeModeMutator
,CsvEscapeModeAccessor.CsvEscapeModeProperty
,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
- All Known Implementing Classes:
CsvBuilder
public interface CsvMixin
extends CsvEscapeModeAccessor.CsvEscapeModeProperty, CsvEscapeModeAccessor.CsvEscapeModeBuilder<CsvMixin>, org.refcodes.mixin.TrimAccessor.TrimProperty, org.refcodes.mixin.TrimAccessor.TrimBuilder<CsvMixin>, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty, org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<CsvMixin>
This interface defines common functionality for implementations capable of
CSV (file) handling.
-
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
Nested classes/interfaces inherited from interface org.refcodes.mixin.TrimAccessor
org.refcodes.mixin.TrimAccessor.TrimBuilder<B extends org.refcodes.mixin.TrimAccessor.TrimBuilder<B>>, org.refcodes.mixin.TrimAccessor.TrimMutator, org.refcodes.mixin.TrimAccessor.TrimProperty
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the prefixes used to identify CSV lines to be ignored.String[]
Gets the prefixes used to identify CSV lines to be ignored.default boolean
Tests whether the line starts with a comment prefix.void
setCommentPrefixes
(String... aCommentPrefixes) Sets the prefixes used to identify CSV lines to be ignored.default String
Converts a text to a comment by using the fist defined comment prefix as ofgetCommentPrefixes()
suffixed with a space (" ") followed by the line of text.default String
Uncomment the given line in case it is a comment as ofisComment(String)
.withCommentPrefixes
(String... aCommentPrefixes) Sets the prefixes used to identify CSV lines to be ignored.Methods inherited from interface org.refcodes.textual.CsvEscapeModeAccessor
getCsvEscapeMode
Methods inherited from interface org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeBuilder
withCsvEscapeMode
Methods inherited from interface org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeMutator
setCsvEscapeMode
Methods inherited from interface org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeProperty
letCsvEscapeMode
Methods inherited from interface org.refcodes.mixin.DelimiterAccessor
getDelimiter
Methods inherited from interface org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder
withDelimiter
Methods inherited from interface org.refcodes.mixin.DelimiterAccessor.DelimiterMutator
setDelimiter
Methods inherited from interface org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
letDelimiter
Methods inherited from interface org.refcodes.mixin.TrimAccessor
isTrim
Methods inherited from interface org.refcodes.mixin.TrimAccessor.TrimBuilder
withTrim
Methods inherited from interface org.refcodes.mixin.TrimAccessor.TrimMutator
setTrim
Methods inherited from interface org.refcodes.mixin.TrimAccessor.TrimProperty
letTrim
-
Method Details
-
setCommentPrefixes
Sets the prefixes used to identify CSV lines to be ignored.- Parameters:
aCommentPrefixes
- The prefixes used to identify CSV lines to be ignored.
-
getCommentPrefixes
String[] getCommentPrefixes()Gets the prefixes used to identify CSV lines to be ignored.- Returns:
- return The prefixes used to identify CSV lines to be ignored.
-
clearCommentPrefixes
void clearCommentPrefixes()Clears the prefixes used to identify CSV lines to be ignored. No CSV lines will be ignored any more. -
withCommentPrefixes
Sets the prefixes used to identify CSV lines to be ignored.- Parameters:
aCommentPrefixes
- The prefixes used to identify CSV lines to be ignored.- Returns:
- The instance on which this method has been invoked as of the builder pattern.
-
isComment
Tests whether the line starts with a comment prefix.- Parameters:
aLine
- The line to be tested.- Returns:
- True in case the line starts with a comment prefix, else false.
-
uncomment
Uncomment the given line in case it is a comment as ofisComment(String)
.- Parameters:
aLine
- The line to be uncommented.- Returns:
- The uncommented line.
-
toComment
Converts a text to a comment by using the fist defined comment prefix as ofgetCommentPrefixes()
suffixed with a space (" ") followed by the line of text. If no prefix has been set viasetCommentPrefixes(String...)
orwithCommentPrefixes(String...)
, then thePrefix.CSV_COMMENT
is used.- Parameters:
aLine
- The line to be converted to a comment line.- Returns:
- The comment accordingly prefixed.
-