View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   https://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.commons.csv;
21  
22  /**
23   * Private constants for this package.
24   */
25  final class Constants {
26  
27      static final char BACKSLASH = '\\';
28  
29      static final char BACKSPACE = '\b';
30  
31      static final String COMMA = ",";
32  
33      /**
34       * Starts a comment, the remainder of the line is the comment.
35       */
36      static final char COMMENT = '#';
37  
38      static final char CR = '\r';
39  
40      /** RFC 4180 defines line breaks as CRLF. */
41      static final String CRLF = "\r\n";
42  
43      static final Character DOUBLE_QUOTE_CHAR = Character.valueOf('"');  // Explicit (un)boxing is intentional.
44  
45      static final String EMPTY = "";
46  
47      static final String[] EMPTY_STRING_ARRAY = {};
48  
49      static final char FF = '\f';
50  
51      static final char LF = '\n';
52  
53      /**
54       * Unicode line separator.
55       */
56      static final String LINE_SEPARATOR = "\u2028";
57  
58      /**
59       * Unicode next line.
60       */
61      static final String NEXT_LINE = "\u0085";
62  
63      /**
64       * Unicode paragraph separator.
65       */
66      static final String PARAGRAPH_SEPARATOR = "\u2029";
67  
68      static final char PIPE = '|';
69  
70      /** ASCII record separator. */
71      static final char RS = 30;
72  
73      static final char SP = ' ';
74  
75      static final String SQL_NULL_STRING = "\\N";
76  
77      static final char TAB = '\t';
78  
79      /** Undefined state for the lookahead char. */
80      static final int UNDEFINED = -2;
81  
82      /** ASCII unit separator. */
83      static final char US = 31;
84  
85      /** No instances. */
86      private Constants() {
87          // noop
88      }
89  
90  }