Package org.beanio.stream.delimited
Class DelimitedParserConfiguration
- java.lang.Object
-
- org.beanio.stream.delimited.DelimitedParserConfiguration
-
- Direct Known Subclasses:
DelimitedRecordParserFactory
public class DelimitedParserConfiguration extends java.lang.ObjectStores configuration settings for parsing delimited formatted streams.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description DelimitedParserConfiguration()Constructs a newDelimitedParserConfiguration.DelimitedParserConfiguration(char delimiter)Constructs a newDelimitedReaderConfiguration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]getComments()Returns the array of comment prefixes.chargetDelimiter()Returns the field delimiting character.java.lang.CharactergetEscape()Returns the character used by the input stream to escape delimiters and itself.java.lang.CharactergetLineContinuationCharacter()Returns the line continuation character ornullif line continuation is disabled.java.lang.StringgetRecordTerminator()Returns the character used to mark the end of a record.booleanisCommentEnabled()Returns whether one or more comment prefixes have been configured.booleanisEscapeEnabled()Returns whether an escape character is enabled.booleanisLineContinationEnabled()Returns whether the line continuation character is enabled.voidsetComments(java.lang.String[] comments)Sets the array of comment prefixes.voidsetDelimiter(char delimiter)Sets the field delimiting character to use.voidsetEscape(java.lang.Character escapeCharacter)Sets the character used by the input stream to escape delimiters and itself.voidsetLineContinuationCharacter(java.lang.Character lineContinuationCharacter)Sets the line continuation character.voidsetRecordTerminator(java.lang.String recordTerminator)Sets the character used to mark the end of a record.
-
-
-
Constructor Detail
-
DelimitedParserConfiguration
public DelimitedParserConfiguration()
Constructs a newDelimitedParserConfiguration.
-
DelimitedParserConfiguration
public DelimitedParserConfiguration(char delimiter)
Constructs a newDelimitedReaderConfiguration.- Parameters:
delimiter- the field delimiting character
-
-
Method Detail
-
getDelimiter
public char getDelimiter()
Returns the field delimiting character. Defaults to tab.- Returns:
- the record delimiter
-
setDelimiter
public void setDelimiter(char delimiter)
Sets the field delimiting character to use.- Parameters:
delimiter- the record delimiting character
-
getEscape
public java.lang.Character getEscape()
Returns the character used by the input stream to escape delimiters and itself. By default, escaping is disabled.- Returns:
- the escape character or
nullif escaping is disabled
-
setEscape
public void setEscape(java.lang.Character escapeCharacter)
Sets the character used by the input stream to escape delimiters and itself. If set to null, escaping is disabled.- Parameters:
escapeCharacter- the new escape character
-
getLineContinuationCharacter
public java.lang.Character getLineContinuationCharacter()
Returns the line continuation character ornullif line continuation is disabled. By default, line continuation is disabled.- Returns:
- the line continuation character or
nullif disabled
-
setLineContinuationCharacter
public void setLineContinuationCharacter(java.lang.Character lineContinuationCharacter)
Sets the line continuation character. May be set tonullto disable line continuation.- Parameters:
lineContinuationCharacter- the line continuation character
-
isEscapeEnabled
public boolean isEscapeEnabled()
Returns whether an escape character is enabled.- Returns:
trueif enabled, false otherwise
-
isLineContinationEnabled
public boolean isLineContinationEnabled()
Returns whether the line continuation character is enabled.- Returns:
trueif the line continuation character is enabled
-
getRecordTerminator
public java.lang.String getRecordTerminator()
Returns the character used to mark the end of a record. By default, a carriage return (CR), line feed (LF), or CRLF sequence is used to signify the end of the record.- Returns:
- the record termination character
-
setRecordTerminator
public void setRecordTerminator(java.lang.String recordTerminator)
Sets the character used to mark the end of a record. If set tonull, a carriage return (CR), line feed (LF), or CRLF sequence is used.- Parameters:
recordTerminator- the record termination character
-
getComments
public java.lang.String[] getComments()
Returns the array of comment prefixes. If a line read from a stream begins with a configured comment prefix, the line is ignored. By default, no lines are considered commented.- Returns:
- the array of comment prefixes
-
setComments
public void setComments(java.lang.String[] comments)
Sets the array of comment prefixes. If a line read from a stream begins with a configured comment prefix, the line is ignored.- Parameters:
comments- the array of comment prefixes
-
isCommentEnabled
public boolean isCommentEnabled()
Returns whether one or more comment prefixes have been configured.- Returns:
trueif one or more comment prefixes have been configured
-
-