@@ -78,11 +78,11 @@ public class CsvSchema
78
78
/**********************************************************************
79
79
*/
80
80
81
- protected final static int FEATURE_USE_HEADER = 0x0001 ;
82
- protected final static int FEATURE_SKIP_FIRST_DATA_ROW = 0x0002 ;
83
- protected final static int FEATURE_ALLOW_COMMENTS = 0x0004 ;
81
+ protected final static int ENCODING_FEATURE_USE_HEADER = 0x0001 ;
82
+ protected final static int ENCODING_FEATURE_SKIP_FIRST_DATA_ROW = 0x0002 ;
83
+ protected final static int ENCODING_FEATURE_ALLOW_COMMENTS = 0x0004 ;
84
84
85
- protected final static int DEFAULT_FEATURES = 0 ;
85
+ protected final static int DEFAULT_ENCODING_FEATURES = 0 ;
86
86
87
87
/*
88
88
/**********************************************************************
@@ -330,7 +330,7 @@ public static class Builder
330
330
*
331
331
* @since 2.5
332
332
*/
333
- protected int _features = DEFAULT_FEATURES ;
333
+ protected int _encodingFeatures = DEFAULT_ENCODING_FEATURES ;
334
334
335
335
protected char _columnSeparator = DEFAULT_COLUMN_SEPARATOR ;
336
336
@@ -349,7 +349,7 @@ public static class Builder
349
349
* @since 2.5
350
350
*/
351
351
protected char [] _nullValue = DEFAULT_NULL_VALUE ;
352
-
352
+
353
353
public Builder () { }
354
354
355
355
/**
@@ -361,7 +361,7 @@ public Builder(CsvSchema src)
361
361
for (Column col : src ._columns ) {
362
362
_columns .add (col );
363
363
}
364
- _features = src ._features ;
364
+ _encodingFeatures = src ._features ;
365
365
_columnSeparator = src ._columnSeparator ;
366
366
_arrayElementSeparator = src ._arrayElementSeparator ;
367
367
_quoteChar = src ._quoteChar ;
@@ -441,7 +441,7 @@ public Iterator<Column> getColumns() {
441
441
* used for reading and writing or not.
442
442
*/
443
443
public Builder setUseHeader (boolean b ) {
444
- _feature (FEATURE_USE_HEADER , b );
444
+ _feature (ENCODING_FEATURE_USE_HEADER , b );
445
445
return this ;
446
446
}
447
447
@@ -451,7 +451,7 @@ public Builder setUseHeader(boolean b) {
451
451
* should be skipped in its entirety.
452
452
*/
453
453
public Builder setSkipFirstDataRow (boolean b ) {
454
- _feature (FEATURE_SKIP_FIRST_DATA_ROW , b );
454
+ _feature (ENCODING_FEATURE_SKIP_FIRST_DATA_ROW , b );
455
455
return this ;
456
456
}
457
457
@@ -463,12 +463,12 @@ public Builder setSkipFirstDataRow(boolean b) {
463
463
* @since 2.5
464
464
*/
465
465
public Builder setAllowComments (boolean b ) {
466
- _feature (FEATURE_ALLOW_COMMENTS , b );
466
+ _feature (ENCODING_FEATURE_ALLOW_COMMENTS , b );
467
467
return this ;
468
468
}
469
469
470
470
protected final void _feature (int feature , boolean state ) {
471
- _features = state ? (_features | feature ) : (_features & ~feature );
471
+ _encodingFeatures = state ? (_encodingFeatures | feature ) : (_encodingFeatures & ~feature );
472
472
}
473
473
474
474
/**
@@ -556,7 +556,7 @@ public Builder setNullValue(char[] nvl) {
556
556
public CsvSchema build ()
557
557
{
558
558
Column [] cols = _columns .toArray (new Column [_columns .size ()]);
559
- return new CsvSchema (cols , _features ,
559
+ return new CsvSchema (cols , _encodingFeatures ,
560
560
_columnSeparator , _quoteChar , _escapeChar ,
561
561
_lineSeparator , _arrayElementSeparator ,
562
562
_nullValue );
@@ -588,7 +588,7 @@ protected void _checkIndex(int index) {
588
588
*
589
589
* @since 2.5
590
590
*/
591
- protected int _features = DEFAULT_FEATURES ;
591
+ protected int _features = DEFAULT_ENCODING_FEATURES ;
592
592
593
593
protected final char _columnSeparator ;
594
594
@@ -612,7 +612,7 @@ public CsvSchema(Column[] columns,
612
612
char [] lineSeparator )
613
613
{
614
614
this (columns ,
615
- (useHeader ? FEATURE_USE_HEADER : 0 ) + (skipFirstDataRow ? FEATURE_SKIP_FIRST_DATA_ROW : 0 ),
615
+ (useHeader ? ENCODING_FEATURE_USE_HEADER : 0 ) + (skipFirstDataRow ? ENCODING_FEATURE_SKIP_FIRST_DATA_ROW : 0 ),
616
616
columnSeparator , quoteChar , escapeChar , lineSeparator ,
617
617
DEFAULT_ARRAY_ELEMENT_SEPARATOR , DEFAULT_NULL_VALUE );
618
618
}
@@ -760,27 +760,27 @@ public Builder rebuild() {
760
760
*/
761
761
762
762
public CsvSchema withUseHeader (boolean state ) {
763
- return _withFeature (FEATURE_USE_HEADER , state );
763
+ return _withFeature (ENCODING_FEATURE_USE_HEADER , state );
764
764
}
765
765
766
766
/**
767
767
* Helper method for constructing and returning schema instance that
768
768
* is similar to this one, except that it will be using header line.
769
769
*/
770
770
public CsvSchema withHeader () {
771
- return _withFeature (FEATURE_USE_HEADER , true );
771
+ return _withFeature (ENCODING_FEATURE_USE_HEADER , true );
772
772
}
773
773
774
774
/**
775
775
* Helper method for construcing and returning schema instance that
776
776
* is similar to this one, except that it will not be using header line.
777
777
*/
778
778
public CsvSchema withoutHeader () {
779
- return _withFeature (FEATURE_USE_HEADER , false );
779
+ return _withFeature (ENCODING_FEATURE_USE_HEADER , false );
780
780
}
781
781
782
782
public CsvSchema withSkipFirstDataRow (boolean state ) {
783
- return _withFeature (FEATURE_SKIP_FIRST_DATA_ROW , state );
783
+ return _withFeature (ENCODING_FEATURE_SKIP_FIRST_DATA_ROW , state );
784
784
}
785
785
786
786
/**
@@ -790,7 +790,7 @@ public CsvSchema withSkipFirstDataRow(boolean state) {
790
790
* @since 2.5
791
791
*/
792
792
public CsvSchema withAllowComments (boolean state ) {
793
- return _withFeature (FEATURE_ALLOW_COMMENTS , state );
793
+ return _withFeature (ENCODING_FEATURE_ALLOW_COMMENTS , state );
794
794
}
795
795
796
796
/**
@@ -800,7 +800,7 @@ public CsvSchema withAllowComments(boolean state) {
800
800
* @since 2.5
801
801
*/
802
802
public CsvSchema withComments () {
803
- return _withFeature (FEATURE_ALLOW_COMMENTS , true );
803
+ return _withFeature (ENCODING_FEATURE_ALLOW_COMMENTS , true );
804
804
}
805
805
806
806
/**
@@ -810,7 +810,7 @@ public CsvSchema withComments() {
810
810
* @since 2.5
811
811
*/
812
812
public CsvSchema withoutComments () {
813
- return _withFeature (FEATURE_ALLOW_COMMENTS , false );
813
+ return _withFeature (ENCODING_FEATURE_ALLOW_COMMENTS , false );
814
814
}
815
815
816
816
protected CsvSchema _withFeature (int feature , boolean state ) {
@@ -956,21 +956,21 @@ public String getSchemaType() {
956
956
/**********************************************************************
957
957
*/
958
958
959
- public boolean usesHeader () { return (_features & FEATURE_USE_HEADER ) != 0 ; }
960
- public boolean skipsFirstDataRow () { return (_features & FEATURE_SKIP_FIRST_DATA_ROW ) != 0 ; }
961
- public boolean allowsComments () { return (_features & FEATURE_ALLOW_COMMENTS ) != 0 ; }
959
+ public boolean usesHeader () { return (_features & ENCODING_FEATURE_USE_HEADER ) != 0 ; }
960
+ public boolean skipsFirstDataRow () { return (_features & ENCODING_FEATURE_SKIP_FIRST_DATA_ROW ) != 0 ; }
961
+ public boolean allowsComments () { return (_features & ENCODING_FEATURE_ALLOW_COMMENTS ) != 0 ; }
962
962
963
963
/**
964
964
* @deprecated Use {@link #usesHeader()} instead
965
965
*/
966
966
@ Deprecated // since 2.5
967
- public boolean useHeader () { return (_features & FEATURE_USE_HEADER ) != 0 ; }
967
+ public boolean useHeader () { return (_features & ENCODING_FEATURE_USE_HEADER ) != 0 ; }
968
968
969
969
/**
970
970
* @deprecated Use {@link #skipsFirstDataRow()} instead
971
971
*/
972
972
@ Deprecated // since 2.5
973
- public boolean skipFirstDataRow () { return (_features & FEATURE_SKIP_FIRST_DATA_ROW ) != 0 ; }
973
+ public boolean skipFirstDataRow () { return (_features & ENCODING_FEATURE_SKIP_FIRST_DATA_ROW ) != 0 ; }
974
974
975
975
public char getColumnSeparator () { return _columnSeparator ; }
976
976
public int getArrayElementSeparator () { return _arrayElementSeparator ; }
0 commit comments