org.apache.felix.utils.manifest.Parser.parseDelimitedString()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中org.apache.felix.utils.manifest.Parser.parseDelimitedString()方法的一些代码示例,展示了Parser.parseDelimitedString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.parseDelimitedString()方法的具体详情如下:
包路径:org.apache.felix.utils.manifest.Parser
类名称:Parser
方法名:parseDelimitedString

Parser.parseDelimitedString介绍

[英]Parses delimited string and returns an array containing the tokens. This parser obeys quotes, so the delimiter character will be ignored if it is inside of a quote. This method assumes that the quote character is not included in the set of delimiter characters.
[中]解析分隔字符串并返回包含标记的数组。该解析器遵循引号,因此如果分隔符字符位于引号内,它将被忽略。此方法假定引号字符不包括在分隔符集中。

代码示例

代码示例来源:origin: org.everit.osgi.bundles/org.everit.osgi.bundles.org.apache.felix.utils

  1. public static Clause[] parseHeader(String header) throws IllegalArgumentException
  2. {
  3. Clause[] clauses = null;
  4. if (header != null)
  5. {
  6. if (header.length() == 0)
  7. {
  8. throw new IllegalArgumentException("The header cannot be an empty string.");
  9. }
  10. String[] ss = parseDelimitedString(header, ",");
  11. clauses = parseClauses(ss);
  12. }
  13. return (clauses == null) ? new Clause[0] : clauses;
  14. }

代码示例来源:origin: org.apache.felix/org.apache.felix.utils

  1. public static Clause[] parseHeader(String header) throws IllegalArgumentException
  2. {
  3. Clause[] clauses = null;
  4. if (header != null)
  5. {
  6. if (header.length() == 0)
  7. {
  8. throw new IllegalArgumentException("The header cannot be an empty string.");
  9. }
  10. String[] ss = parseDelimitedString(header, ",");
  11. clauses = parseClauses(ss);
  12. }
  13. return (clauses == null) ? new Clause[0] : clauses;
  14. }

代码示例来源:origin: org.apache.felix/org.apache.felix.fileinstall

  1. public static Clause[] parseHeader(String header) throws IllegalArgumentException
  2. {
  3. Clause[] clauses = null;
  4. if (header != null)
  5. {
  6. if (header.length() == 0)
  7. {
  8. throw new IllegalArgumentException("The header cannot be an empty string.");
  9. }
  10. String[] ss = parseDelimitedString(header, ",");
  11. clauses = parseClauses(ss);
  12. }
  13. return (clauses == null) ? new Clause[0] : clauses;
  14. }

代码示例来源:origin: apache/felix

  1. public static Clause[] parseHeader(String header) throws IllegalArgumentException
  2. {
  3. Clause[] clauses = null;
  4. if (header != null)
  5. {
  6. if (header.length() == 0)
  7. {
  8. throw new IllegalArgumentException("The header cannot be an empty string.");
  9. }
  10. String[] ss = parseDelimitedString(header, ",");
  11. clauses = parseClauses(ss);
  12. }
  13. return (clauses == null) ? new Clause[0] : clauses;
  14. }

代码示例来源:origin: apache/felix

  1. String[] pieces = parseDelimitedString(ss[ssIdx], ";");

代码示例来源:origin: org.everit.osgi.bundles/org.everit.osgi.bundles.org.apache.felix.utils

  1. String[] pieces = parseDelimitedString(ss[ssIdx], ";");

代码示例来源:origin: org.apache.felix/org.apache.felix.fileinstall

  1. String[] pieces = parseDelimitedString(ss[ssIdx], ";");

代码示例来源:origin: org.apache.felix/org.apache.felix.utils

  1. String[] pieces = parseDelimitedString(ss[ssIdx], ";");

代码示例来源:origin: org.apache.felix/maven-bundle-plugin

  1. /**
  2. * Write out an entry, handling proper unicode and line length constraints
  3. */
  4. private static void writeEntry(OutputStream out, String name, String value, boolean nice) throws IOException {
  5. if (nice && NICE_HEADERS.contains(name)) {
  6. int n = write(out, 0, name + ": ");
  7. String[] parts = Parser.parseDelimitedString(value, ",");
  8. if (parts.length > 1) {
  9. write(out, 0, "\r\n ");
  10. n = 1;
  11. }
  12. for (int i = 0; i < parts.length; i++) {
  13. if (i < parts.length - 1) {
  14. write(out, n, parts[i] + ",");
  15. write(out, 0, "\r\n ");
  16. } else {
  17. write(out, n, parts[i]);
  18. write(out, 0, "\r\n");
  19. }
  20. n = 1;
  21. }
  22. } else {
  23. int n = write(out, 0, name + ": ");
  24. write(out, n, value);
  25. write(out, 0, "\r\n");
  26. }
  27. }

相关文章