org.jgroups.util.Util.replaceProperties()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(163)

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

Util.replaceProperties介绍

[英]Go through the input string and replace any occurance of ${p} with the props.getProperty(p) value. If there is no such property p defined, then the ${p} reference will remain unchanged.

If the property reference is of the form ${p:v} and there is no such property p, then the default value v will be returned.

If the property reference is of the form ${p1,p2} or ${p1,p2:v} then the primary and the secondary properties will be tried in turn, before returning either the unchanged input, or the default value.

The property ${/} is replaced with System.getProperty("file.separator") value and the property ${:} is replaced with System.getProperty("path.separator").
[中]检查输入字符串并用props替换${p}的任何出现。getProperty(p)值。如果没有定义这样的属性p,那么${p}引用将保持不变。
如果属性引用的形式为${p:v},并且没有这样的属性p,那么将返回默认值v。
如果属性引用的格式为${p1,p2}或${p1,p2:v},则在返回未更改的输入或默认值之前,将依次尝试主属性和辅助属性。
属性${/}替换为System。getProperty(“file.separator”)值和属性${:}替换为System。getProperty(“path.separator”)。

代码示例

代码示例来源:origin: wildfly/wildfly

for (Class<Protocol> clazz : classes)
  convertProtocolToAsciidocTable(props,clazz);
String result = Util.replaceProperties(s, props);
FileWriter fw = new FileWriter(f, false);
fw.write(result);
convertUnsupportedToAsciidocTable(props,experimentalClasses,"Experimental");
result=Util.replaceProperties(s,props);
fw=new FileWriter(f,false);
fw.write(result);

代码示例来源:origin: org.jboss.eap/wildfly-client-all

for (Class<Protocol> clazz : classes)
  convertProtocolToAsciidocTable(props,clazz);
String result = Util.replaceProperties(s, props);
FileWriter fw = new FileWriter(f, false);
fw.write(result);
convertUnsupportedToAsciidocTable(props,experimentalClasses,"Experimental");
result=Util.replaceProperties(s,props);
fw=new FileWriter(f,false);
fw.write(result);

相关文章

微信公众号

最新文章

更多

Util类方法