public class DelimiterSet
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static DelimiterSet |
DEFAULT_DELIMITERS |
static DelimiterSet |
HIVE_DELIMITERS |
static java.lang.String |
INPUT_ENCLOSE_REQUIRED_KEY |
static java.lang.String |
INPUT_ENCLOSED_BY_KEY |
static java.lang.String |
INPUT_ESCAPED_BY_KEY |
static java.lang.String |
INPUT_FIELD_DELIM_KEY
Create the input variations for export instead of overloading them.
|
static java.lang.String |
INPUT_RECORD_DELIM_KEY |
static DelimiterSet |
MYSQL_DELIMITERS |
static char |
NULL_CHAR |
static java.lang.String |
OUTPUT_ENCLOSE_REQUIRED_KEY |
static java.lang.String |
OUTPUT_ENCLOSED_BY_KEY |
static java.lang.String |
OUTPUT_ESCAPED_BY_KEY |
static java.lang.String |
OUTPUT_FIELD_DELIM_KEY |
static java.lang.String |
OUTPUT_RECORD_DELIM_KEY |
Constructor and Description |
---|
DelimiterSet()
Create a delimiter set with the default delimiters
(comma for fields, newline for records).
|
DelimiterSet(char field,
char record,
char enclose,
char escape,
boolean isEncloseRequired)
Create a delimiter set with the specified delimiters.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
DelimiterSet |
copy()
Identical to clone() but does not throw spurious exceptions.
|
boolean |
equals(java.lang.Object other) |
java.lang.String |
formatConstructor()
Format this set of delimiters as a call to the constructor for
this object, that would generate identical delimiters.
|
char |
getEnclosedBy() |
char |
getEscapedBy() |
char |
getFieldsTerminatedBy() |
char |
getLinesTerminatedBy() |
int |
hashCode() |
boolean |
isEncloseRequired() |
void |
setEnclosedBy(char e)
Sets the enclosed-by character.
|
void |
setEncloseRequired(boolean required)
Set whether the enclosed-by character must be applied to all fields,
or only fields with embedded delimiters.
|
void |
setEscapedBy(char e)
Sets the escaped-by character.
|
void |
setFieldsTerminatedBy(char f)
Sets the fields-terminated-by character.
|
void |
setLinesTerminatedBy(char r)
Sets the end-of-record lines-terminated-by character.
|
java.lang.String |
toString() |
public static final char NULL_CHAR
public static final java.lang.String OUTPUT_FIELD_DELIM_KEY
public static final java.lang.String OUTPUT_RECORD_DELIM_KEY
public static final java.lang.String OUTPUT_ENCLOSED_BY_KEY
public static final java.lang.String OUTPUT_ESCAPED_BY_KEY
public static final java.lang.String OUTPUT_ENCLOSE_REQUIRED_KEY
public static final java.lang.String INPUT_FIELD_DELIM_KEY
public static final java.lang.String INPUT_RECORD_DELIM_KEY
public static final java.lang.String INPUT_ENCLOSED_BY_KEY
public static final java.lang.String INPUT_ESCAPED_BY_KEY
public static final java.lang.String INPUT_ENCLOSE_REQUIRED_KEY
public static final DelimiterSet DEFAULT_DELIMITERS
public static final DelimiterSet HIVE_DELIMITERS
public static final DelimiterSet MYSQL_DELIMITERS
public DelimiterSet()
public DelimiterSet(char field, char record, char enclose, char escape, boolean isEncloseRequired)
field
- the fields-terminated-by delimiterrecord
- the lines-terminated-by delimiterenclose
- the enclosed-by characterescape
- the escaped-by characterisEncloseRequired
- If true, enclosed-by is applied to all
fields. If false, only applied to fields that embed delimiters.public DelimiterSet copy()
public void setFieldsTerminatedBy(char f)
public char getFieldsTerminatedBy()
public void setLinesTerminatedBy(char r)
public char getLinesTerminatedBy()
public void setEnclosedBy(char e)
e
- the enclosed-by character, or '\000' for no enclosing character.public char getEnclosedBy()
public void setEscapedBy(char e)
e
- the escaped-by character, or '\000' for no escape character.public char getEscapedBy()
public void setEncloseRequired(boolean required)
public boolean isEncloseRequired()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String formatConstructor()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
Copyright © 2019 The Apache Software Foundation