|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.parsers.common.Format
public abstract class Format
This is the parent class for all configuration classes that define a text format.
By default, all parsers and writers have to handle, at least, the following format definitions:
lineSeparator defaults to the system line separator
lineSeparator will be replaced by this character.lineSeparator.normalizedNewline defaults to '\n'.
comment defaults to '#'.
CsvFormat,
FixedWidthFormat| Constructor Summary | |
|---|---|
protected |
Format()
|
| Method Summary | |
|---|---|
protected Format |
clone()
|
char |
getComment()
Returns the character that represents a line comment. |
protected abstract TreeMap<String,Object> |
getConfiguration()
|
char[] |
getLineSeparator()
Returns the current line separator character sequence, which can contain 1 to 2 characters. |
String |
getLineSeparatorString()
Returns the current line separator sequence as a String of 1 to 2 characters. |
char |
getNormalizedNewline()
Returns the normalized newline character, which is automatically replaced by lineSeparator when reading/writing. |
static char[] |
getSystemLineSeparator()
Returns the system's line separator sequence, which can contain 1 to 2 characters. |
boolean |
isComment(char ch)
Identifies whether or not a given character represents a comment |
boolean |
isNewLine(char ch)
Compares the given character against the normalizedNewline character. |
void |
setComment(char comment)
Defines the character that represents a line comment when found in the beginning of a line of text. |
void |
setLineSeparator(char[] lineSeparator)
Defines the line separator sequence that should be used for parsing and writing. |
void |
setLineSeparator(String lineSeparator)
Defines the line separator sequence that should be used for parsing and writing. |
void |
setNormalizedNewline(char normalizedNewline)
Sets the normalized newline character, which is automatically replaced by lineSeparator when reading/writing |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Format()
| Method Detail |
|---|
public char[] getLineSeparator()
public static char[] getSystemLineSeparator()
public String getLineSeparatorString()
public void setLineSeparator(String lineSeparator)
lineSeparator - a sequence of 1 to 2 characters that identifies the end of a linepublic void setLineSeparator(char[] lineSeparator)
lineSeparator - a sequence of 1 to 2 characters that identifies the end of a linepublic char getNormalizedNewline()
lineSeparator when reading/writing. Defaults to '\n'.
public void setNormalizedNewline(char normalizedNewline)
lineSeparator when reading/writing
normalizedNewline - a single character used to represent a line separator.public boolean isNewLine(char ch)
normalizedNewline character.
ch - the character to be verified
public char getComment()
Set it to '\0' to disable comment skipping.
public void setComment(char comment)
Use '\0' to disable comment skipping.
comment - the comment characterpublic boolean isComment(char ch)
ch - the character to be verified
public final String toString()
toString in class Objectprotected abstract TreeMap<String,Object> getConfiguration()
protected Format clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||