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

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

本文整理了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

public static Clause[] parseHeader(String header) throws IllegalArgumentException
{
  Clause[] clauses = null;
  if (header != null)
  {
    if (header.length() == 0)
    {
      throw new IllegalArgumentException("The header cannot be an empty string.");
    }
    String[] ss = parseDelimitedString(header, ",");
    clauses = parseClauses(ss);
  }
  return (clauses == null) ? new Clause[0] : clauses;
}

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

public static Clause[] parseHeader(String header) throws IllegalArgumentException
{
  Clause[] clauses = null;
  if (header != null)
  {
    if (header.length() == 0)
    {
      throw new IllegalArgumentException("The header cannot be an empty string.");
    }
    String[] ss = parseDelimitedString(header, ",");
    clauses = parseClauses(ss);
  }
  return (clauses == null) ? new Clause[0] : clauses;
}

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

public static Clause[] parseHeader(String header) throws IllegalArgumentException
{
  Clause[] clauses = null;
  if (header != null)
  {
    if (header.length() == 0)
    {
      throw new IllegalArgumentException("The header cannot be an empty string.");
    }
    String[] ss = parseDelimitedString(header, ",");
    clauses = parseClauses(ss);
  }
  return (clauses == null) ? new Clause[0] : clauses;
}

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

public static Clause[] parseHeader(String header) throws IllegalArgumentException
{
  Clause[] clauses = null;
  if (header != null)
  {
    if (header.length() == 0)
    {
      throw new IllegalArgumentException("The header cannot be an empty string.");
    }
    String[] ss = parseDelimitedString(header, ",");
    clauses = parseClauses(ss);
  }
  return (clauses == null) ? new Clause[0] : clauses;
}

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

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

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

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

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

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

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

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

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

/**
 * Write out an entry, handling proper unicode and line length constraints
 */
private static void writeEntry(OutputStream out, String name, String value, boolean nice) throws IOException {
  if (nice && NICE_HEADERS.contains(name)) {
    int n = write(out, 0, name + ": ");
    String[] parts = Parser.parseDelimitedString(value, ",");
    if (parts.length > 1) {
      write(out, 0, "\r\n ");
      n = 1;
    }
    for (int i = 0; i < parts.length; i++) {
      if (i < parts.length - 1) {
        write(out, n, parts[i] + ",");
        write(out, 0, "\r\n ");
      } else {
        write(out, n, parts[i]);
        write(out, 0, "\r\n");
      }
      n = 1;
    }
  } else {
    int n = write(out, 0, name + ": ");
    write(out, n, value);
    write(out, 0, "\r\n");
  }
}

相关文章

微信公众号

最新文章

更多