|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cascading.scheme.util.DelimitedParser
public class DelimitedParser
Class DelimitedParser is not to be used directly but by platform specific Scheme
implementations.
TextDelimited
,
TextDelimited
,
Serialized FormField Summary | |
---|---|
protected Pattern |
cleanPattern
Field cleanPattern |
protected Pattern |
escapePattern
Field escapePattern |
protected Pattern |
splitPattern
Field splitPattern |
Constructor Summary | |
---|---|
DelimitedParser(String delimiter,
String quote,
Class[] types,
boolean strict,
boolean safe,
boolean skipHeader,
Fields sourceFields,
Fields sinkFields)
|
Method Summary | |
---|---|
static Object[] |
cleanSplit(Object[] split,
Pattern cleanPattern,
Pattern escapePattern,
String quote)
Method cleanSplit will return a quote free array of String values, the given split array
will be updated in place. |
static Pattern |
createCleanPatternFor(String quote)
Method createCleanPatternFor creates a regex Pattern for removing quote characters from a String. |
static Pattern |
createEscapePatternFor(String quote)
Method createEscapePatternFor creates a regex Pattern cleaning quote escapes from a String. |
static String[] |
createSplit(String value,
Pattern splitPattern,
int numValues)
Method createSplit will split the given value with the given splitPattern . |
static Pattern |
createSplitPatternFor(String delimiter,
String quote)
Method createSplitPatternFor creates a regex Pattern for splitting a line of text into its component
parts using the given delimiter and quote Strings. |
Appendable |
joinLine(Iterable iterable,
Appendable buffer)
|
Fields |
parseFirstLine(FlowProcess flowProcess,
Tap tap)
|
Object[] |
parseLine(String line)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Pattern splitPattern
protected Pattern cleanPattern
protected Pattern escapePattern
Constructor Detail |
---|
public DelimitedParser(String delimiter, String quote, Class[] types, boolean strict, boolean safe, boolean skipHeader, Fields sourceFields, Fields sinkFields)
Method Detail |
---|
public static Pattern createEscapePatternFor(String quote)
Pattern
cleaning quote escapes from a String.
If quote
is null or empty, a null value will be returned;
quote
- of type String
public static Pattern createCleanPatternFor(String quote)
Pattern
for removing quote characters from a String.
If quote
is null or empty, a null value will be returned;
quote
- of type String
public static Pattern createSplitPatternFor(String delimiter, String quote)
Pattern
for splitting a line of text into its component
parts using the given delimiter and quote Strings. quote
may be null.
delimiter
- of type Stringquote
- of type String
public static String[] createSplit(String value, Pattern splitPattern, int numValues)
value
with the given splitPattern
.
value
- of type StringsplitPattern
- of type PatternnumValues
- of type int
public static Object[] cleanSplit(Object[] split, Pattern cleanPattern, Pattern escapePattern, String quote)
split
array
will be updated in place.
If cleanPattern
is null, quote cleaning will not be performed, but all empty String values
will be replaces with a null
value.
split
- of type Object[]cleanPattern
- of type PatternescapePattern
- of type Patternquote
- of type String
public Fields parseFirstLine(FlowProcess flowProcess, Tap tap)
public Object[] parseLine(String line)
public Appendable joinLine(Iterable iterable, Appendable buffer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |