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

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

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

Properties.unescapeJava介绍

[英]Unescapes any Java literals found in the String to a Writer.
This is a slightly modified version of the StringEscapeUtils.unescapeJava() function in commons-lang that doesn't drop escaped separators (i.e ',').
[中]将在String中找到的任何Java文本解压缩为Writer
这是对StringEscapeUtils稍加修改的版本。commons lang中的unescapeJava()函数,该函数不删除转义分隔符(即“\,”。

代码示例

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

/**
 * Parses the next property from the input stream and stores the found
 * name and value in internal fields. These fields can be obtained using
 * the provided getter methods. The return value indicates whether EOF
 * was reached (<b>false</b>) or whether further properties are
 * available (<b>true</b>).
 *
 * @return a flag if further properties are available
 * @throws java.io.IOException if an error occurs
 */
public boolean nextProperty() throws IOException
{
  String line = readProperty();
  if (line == null)
  {
    return false; // EOF
  }
  // parse the line
  String[] property = parseProperty(line);
  propertyName = unescapeJava(property[0]);
  propertyValue = unescapeJava(property[1]);
  return true;
}

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

public String put(String key, List<String> commentLines, List<String> valueLines) {
  commentLines = new ArrayList<String>(commentLines);
  valueLines = new ArrayList<String>(valueLines);
  String escapedKey = escapeKey(key);
  int lastLine = valueLines.size() - 1;
  if (valueLines.isEmpty()) {
    valueLines.add(escapedKey + "=");
  } else if (!valueLines.get(0).trim().startsWith(escapedKey)) {
    valueLines.set(0, escapedKey + " = " + escapeJava(valueLines.get(0)) + (0 < lastLine? "\\": ""));
  }
  for (int i = 1; i < valueLines.size(); i++) {
    valueLines.set(i, escapeJava(valueLines.get(i)) + (i < lastLine? "\\": ""));
  }
  StringBuilder value = new StringBuilder();
  for (String line: valueLines) {
    value.append(line);
  }
  this.layout.put(key, new Layout(commentLines, valueLines));
  return storage.put(key, unescapeJava(value.toString()));
}

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

this.typed = this.typed & typed;
propertyName = unescapeJava(property[0]);
propertyValue = property[1];
return true;

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

this.typed = this.typed & typed;
propertyName = unescapeJava(property[0]);
propertyValue = property[1];
return true;

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

this.typed = this.typed & typed;
propertyName = unescapeJava(property[0]);
propertyValue = property[1];
return true;

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

if (!typed) {
  for (Map.Entry<String,String> e : storage.entrySet()) {
    e.setValue(unescapeJava(e.getValue()));

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

if (!typed) {
  for (Map.Entry<String,String> e : storage.entrySet()) {
    e.setValue(unescapeJava(e.getValue()));

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

if (!typed) {
  for (Map.Entry<String,String> e : storage.entrySet()) {
    e.setValue(unescapeJava(e.getValue()));

相关文章