本文整理了Java中org.apache.felix.utils.properties.Properties.escapeKey()
方法的一些代码示例,展示了Properties.escapeKey()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Properties.escapeKey()
方法的具体详情如下:
包路径:org.apache.felix.utils.properties.Properties
类名称:Properties
方法名:escapeKey
[英]Escape the separators in the key.
[中]从钥匙里的隔板里逃出来。
代码示例来源: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: apache/felix
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);
StringBuilder sb = new StringBuilder();
int lastLine = valueLines.size() - 1;
代码示例来源:origin: org.apache.felix/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);
StringBuilder sb = new StringBuilder();
int lastLine = valueLines.size() - 1;
代码示例来源:origin: org.apache.felix/org.apache.felix.fileinstall
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);
StringBuilder sb = new StringBuilder();
int lastLine = valueLines.size() - 1;
内容来源于网络,如有侵权,请联系作者删除!