本文整理汇总了Java中com.univocity.parsers.csv.CsvParserSettings.setKeepQuotes方法的典型用法代码示例。如果您正苦于以下问题:Java CsvParserSettings.setKeepQuotes方法的具体用法?Java CsvParserSettings.setKeepQuotes怎么用?Java CsvParserSettings.setKeepQuotes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.univocity.parsers.csv.CsvParserSettings
的用法示例。
在下文中一共展示了CsvParserSettings.setKeepQuotes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ListParser
import com.univocity.parsers.csv.CsvParserSettings; //导入方法依赖的package包/类
public ListParser(Parser inParser, char inCollectionDelim,
char inCollectionBegin, char inCollectionEnd) {
parser = inParser;
collectionDelim = inCollectionDelim;
collectionBegin = inCollectionBegin;
collectionEnd = inCollectionEnd;
elements = new ArrayList<Object>();
CsvParserSettings settings = new CsvParserSettings();
settings.getFormat().setLineSeparator("\n");
settings.getFormat().setDelimiter(collectionDelim);
settings.getFormat().setQuote(collectionQuote);
settings.getFormat().setQuoteEscape(collectionEscape);
settings.getFormat().setCharToEscapeQuoteEscaping(collectionEscape);
settings.setKeepQuotes(true);
settings.setKeepEscapeSequences(true);
csvp = new CsvParser(settings);
}
示例2: MapParser
import com.univocity.parsers.csv.CsvParserSettings; //导入方法依赖的package包/类
public MapParser(Parser inKeyParser, Parser inValueParser,
char inCollectionDelim, char inCollectionBegin,
char inCollectionEnd, char inMapDelim) {
keyParser = inKeyParser;
valueParser = inValueParser;
collectionDelim = inCollectionDelim;
collectionBegin = inCollectionBegin;
collectionEnd = inCollectionEnd;
mapDelim = inMapDelim;
elements = new HashMap<Object,Object>();
CsvParserSettings settings = new CsvParserSettings();
settings.getFormat().setLineSeparator("" + collectionDelim);
settings.getFormat().setNormalizedNewline(collectionDelim);
settings.getFormat().setDelimiter(mapDelim);
settings.getFormat().setQuote(collectionQuote);
settings.getFormat().setQuoteEscape(collectionEscape);
settings.getFormat().setCharToEscapeQuoteEscaping(collectionEscape);
settings.setKeepQuotes(true);
settings.setKeepEscapeSequences(true);
csvp = new CsvParser(settings);
}
示例3: SetParser
import com.univocity.parsers.csv.CsvParserSettings; //导入方法依赖的package包/类
public SetParser(Parser inParser, char inCollectionDelim,
char inCollectionBegin, char inCollectionEnd) {
parser = inParser;
collectionDelim = inCollectionDelim;
collectionBegin = inCollectionBegin;
collectionEnd = inCollectionEnd;
elements = new HashSet<Object>();
CsvParserSettings settings = new CsvParserSettings();
settings.getFormat().setLineSeparator("\n");
settings.getFormat().setDelimiter(collectionDelim);
settings.getFormat().setQuote(collectionQuote);
settings.getFormat().setQuoteEscape(collectionEscape);
settings.getFormat().setCharToEscapeQuoteEscaping(collectionEscape);
settings.setKeepQuotes(true);
settings.setKeepEscapeSequences(true);
csvp = new CsvParser(settings);
}
示例4: processCqlSchema
import com.univocity.parsers.csv.CsvParserSettings; //导入方法依赖的package包/类
private void processCqlSchema(String cqlSchema, Session session) throws ParseException {
CsvParserSettings ks_settings = new CsvParserSettings();
ks_settings.getFormat().setLineSeparator("\n");
ks_settings.getFormat().setDelimiter('.');
ks_settings.getFormat().setQuote('\"');
ks_settings.getFormat().setQuoteEscape('\\');
ks_settings.getFormat().setCharToEscapeQuoteEscaping('\\');
ks_settings.setKeepQuotes(true);
ks_settings.setKeepEscapeSequences(true);
ks_settings.setMaxCharsPerColumn(-1);
CsvParser ks_parser = new CsvParser(ks_settings);
String[] ks_elements = ks_parser.parseLine(cqlSchema);
keyspace = ks_elements[0];
String table_string = cqlSchema.substring(keyspace.length() + 1);
CsvParserSettings table_settings = new CsvParserSettings();
table_settings.getFormat().setLineSeparator("\n");
table_settings.getFormat().setDelimiter('(');
table_settings.getFormat().setQuote('\"');
table_settings.getFormat().setQuoteEscape('\\');
table_settings.getFormat().setCharToEscapeQuoteEscaping('\\');
table_settings.setKeepQuotes(true);
table_settings.setKeepEscapeSequences(true);
table_settings.setMaxCharsPerColumn(-1);
CsvParser table_parser = new CsvParser(table_settings);
String[] table_elements = table_parser.parseLine(table_string);
tablename = table_elements[0];
String schemaString = table_string.substring(tablename.length() + 1,
table_string.length() - 1);
sbl = schemaBits(schemaString, session);
}
示例5: DelimParser
import com.univocity.parsers.csv.CsvParserSettings; //导入方法依赖的package包/类
public DelimParser(String inDelimiter, int inCharsPerColumn,
String inNullString, String inComment) {
parsers = new ArrayList<Parser>();
elements = new ArrayList<Object>();
skip = new ArrayList<Boolean>();
parsersSize = parsers.size();
if (null == inDelimiter)
delimiter = DEFAULT_DELIMITER;
else
delimiter = inDelimiter;
if (null == inNullString)
nullString = DEFAULT_NULLSTRING;
else
nullString = inNullString;
if (null == inComment)
comment = DEFAULT_COMMENT_STRING.charAt(0);
else
comment = inComment.charAt(0);
charsPerColumn = inCharsPerColumn;
delim = ("\\t".equals(delimiter)) ? '\t' : delimiter.charAt(0);
quote = '\"';
escape = '\\';
CsvParserSettings settings = new CsvParserSettings();
settings.getFormat().setLineSeparator("\n");
settings.getFormat().setDelimiter(delim);
settings.setMaxCharsPerColumn(charsPerColumn);
settings.getFormat().setQuote(quote);
settings.getFormat().setQuoteEscape(escape);
settings.getFormat().setCharToEscapeQuoteEscaping(escape);
settings.setKeepQuotes(true);
settings.setKeepEscapeSequences(true);
settings.getFormat().setComment(comment);
csvp = new CsvParser(settings);
}