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

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

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

Util.substituteVariable介绍

[英]Replaces variables of ${var:default} with System.getProperty(var, default). If no variables are found, returns the same string, otherwise a copy of the string with variables substituted
[中]用系统替换${var:default}的变量。getProperty(变量,默认值)。如果未找到变量,则返回相同的字符串,否则返回替换了变量的字符串副本

代码示例

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

  1. public void substituteVariables() {
  2. for(Iterator<Map.Entry<String, String>> it=properties.entrySet().iterator(); it.hasNext();) {
  3. Map.Entry<String, String> entry=it.next();
  4. String key=entry.getKey();
  5. String val=entry.getValue();
  6. String tmp=Util.substituteVariable(val);
  7. if(!val.equals(tmp)) {
  8. properties.put(key, tmp);
  9. }
  10. else {
  11. if(tmp.contains("${"))
  12. it.remove();
  13. }
  14. }
  15. properties_str=propertiesToString();
  16. }

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

  1. /**
  2. * Replace variables of the form ${var:default} with the getProperty(var,
  3. * default)
  4. *
  5. * @param configurator
  6. */
  7. public static void substituteVariables(ProtocolStackConfigurator configurator) {
  8. List<ProtocolConfiguration> protocols=configurator.getProtocolStack();
  9. protocols.stream().filter(data -> data != null).forEach(data -> {
  10. Map<String,String> parms=data.getProperties();
  11. for(Map.Entry<String,String> entry : parms.entrySet()) {
  12. String val=entry.getValue();
  13. String replacement=Util.substituteVariable(val);
  14. if(!replacement.equals(val)) {
  15. entry.setValue(replacement);
  16. }
  17. }
  18. });
  19. }
  20. }

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

  1. public void substituteVariables() {
  2. for(Iterator<Map.Entry<String, String>> it=properties.entrySet().iterator(); it.hasNext();) {
  3. Map.Entry<String, String> entry=it.next();
  4. String key=entry.getKey();
  5. String val=entry.getValue();
  6. String tmp=Util.substituteVariable(val);
  7. if(!val.equals(tmp)) {
  8. properties.put(key, tmp);
  9. }
  10. else {
  11. if(tmp.contains("${"))
  12. it.remove();
  13. }
  14. }
  15. properties_str=propertiesToString();
  16. }

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

  1. /**
  2. * Replace variables of the form ${var:default} with the getProperty(var,
  3. * default)
  4. *
  5. * @param configurator
  6. */
  7. public static void substituteVariables(ProtocolStackConfigurator configurator) {
  8. List<ProtocolConfiguration> protocols=configurator.getProtocolStack();
  9. protocols.stream().filter(data -> data != null).forEach(data -> {
  10. Map<String,String> parms=data.getProperties();
  11. for(Map.Entry<String,String> entry : parms.entrySet()) {
  12. String val=entry.getValue();
  13. String replacement=Util.substituteVariable(val);
  14. if(!replacement.equals(val)) {
  15. entry.setValue(replacement);
  16. }
  17. }
  18. });
  19. }
  20. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. parm=(ProtocolParameter)entry.getValue();
  2. String val=parm.getValue();
  3. String replacement=Util.substituteVariable(val);
  4. if(!replacement.equals(val)) {
  5. parm.setValue(replacement);

相关文章

Util类方法