org.apache.felix.utils.properties.Properties.checkHeaderComment()方法的使用及代码示例

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

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

Properties.checkHeaderComment介绍

[英]Checks if parts of the passed in comment can be used as header comment. This method checks whether a header comment can be defined (i.e. whether this is the first comment in the loaded file). If this is the case, it is searched for the lates blank line. This line will mark the end of the header comment. The return value is the index of the first line in the passed in list, which does not belong to the header comment.
[中]检查传入注释的部分内容是否可用作标题注释。此方法检查是否可以定义标题注释(即,这是否是加载文件中的第一条注释)。如果是这种情况,则搜索最新的空行。这一行将标记标题注释的结尾。返回值是传入列表中第一行的索引,它不属于标题注释。

代码示例

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

/**
 * Reads a properties file and stores its internal structure. The found
 * properties will be added to the associated configuration object.
 *
 * @param in the reader to the properties file
 * @throws java.io.IOException if an error occurs
 */
protected void loadLayout(Reader in) throws IOException
{
  PropertiesReader reader = new PropertiesReader(in);
  while (reader.nextProperty())
  {
    storage.put(reader.getPropertyName(), reader.getPropertyValue());
    int idx = checkHeaderComment(reader.getCommentLines());
    layout.put(reader.getPropertyName(),
        new Layout(idx < reader.getCommentLines().size() ?
                new ArrayList<String>(reader.getCommentLines().subList(idx, reader.getCommentLines().size())) :
                null,
              new ArrayList<String>(reader.getValueLines())));
  }
  footer = new ArrayList<String>(reader.getCommentLines());
  if (substitute)
  {
    substitute();
  }
}

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

int idx = checkHeaderComment(reader.getCommentLines());
layout.put(reader.getPropertyName(),
    new Layout(idx < reader.getCommentLines().size() ?

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

int idx = checkHeaderComment(reader.getCommentLines());
layout.put(reader.getPropertyName(),
    new Layout(idx < reader.getCommentLines().size() ?

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

int idx = checkHeaderComment(reader.getCommentLines());
layout.put(reader.getPropertyName(),
    new Layout(idx < reader.getCommentLines().size() ?

相关文章