Package org.apache.commons.lang3.text

Examples of org.apache.commons.lang3.text.StrSubstitutor.replace()


   
    Map<String, String> variables = email.getVariables();
    if(variables!=null){
      StrSubstitutor substitutor = new StrSubstitutor(variables, "${", "}");
      subject = substitutor.replace(subject);
      bodyHtml = substitutor.replace(bodyHtml);
      bodyText = substitutor.replace(bodyText);
    }
   
    if(senderName!=null){
      from = senderName+" <"+from+">";
View Full Code Here


    Map<String, String> variables = email.getVariables();
    if(variables!=null){
      StrSubstitutor substitutor = new StrSubstitutor(variables, "${", "}");
      subject = substitutor.replace(subject);
      bodyHtml = substitutor.replace(bodyHtml);
      bodyText = substitutor.replace(bodyText);
    }
   
    if(senderName!=null){
      from = senderName+" <"+from+">";
    }
View Full Code Here

    }
   
    Map<String, String> variables = email.getVariables();
    if(variables!=null){
      StrSubstitutor substitutor = new StrSubstitutor(variables, "${", "}");
      subject = substitutor.replace(subject);
      bodyHtml = substitutor.replace(bodyHtml);
      bodyText = substitutor.replace(bodyText);
    }
   
    if(senderName!=null){
View Full Code Here

            valuesMap.put("imgIn", (uploadCommandLine.getUploadTempPath() + System.getProperty("file.separator") + CommonUtils.stripPunctuation(FilenameUtils.getBaseName(uploadBean.getName()), '-') + "." + FilenameUtils.getExtension(uploadBean.getName())));
            System.out.println("spazi linux" + (uploadCommandLine.getUploadTempPath() + System.getProperty("file.separator") + CommonUtils.stripPunctuation(FilenameUtils.getBaseName(uploadBean.getName()), '-') + "." + FilenameUtils.getExtension(uploadBean.getName())));
            valuesMap.put("imgOut", (uploadPath.toString()));
          }
          StrSubstitutor strSubstitutor = new StrSubstitutor(valuesMap);
          String cmd = strSubstitutor.replace(uploadCommandLine.getCommandLine());
          System.out.println(cmd);
          try {
            Runtime runtime = Runtime.getRuntime();
            Process process = runtime.exec(cmd);
            process.waitFor();
View Full Code Here

          commandLine.setUploadPath(theXMLConfUpload.valoreNodo(prefixUpload + "[" + (i + 1) + "]" + "/commandList/command[" + (j + 1) + "]/uploadPath/text()"));
          if (commandLine.getUploadPath().toLowerCase().contains("webapp")) {
            Map<String, String> valuesMap = new HashMap<String, String>();
            valuesMap.put("webApp", (String) modelMap.get("realPath"));
            StrSubstitutor strSubstitutor = new StrSubstitutor(valuesMap);
            commandLine.setUploadPath(strSubstitutor.replace(commandLine.getUploadPath()));
          }
          commandLine.setUploadNameDir(theXMLConfUpload.valoreNodo(prefixUpload + "[" + (i + 1) + "]" + "/commandList/command[" + (j + 1) + "]/uploadNameDir/text()"));
          uploadBean.getCommandLine().add(commandLine);
        }
      }
View Full Code Here

      }
      if (isEmptyValue) {
        return "";
      }
      StrSubstitutor sub = new StrSubstitutor(valuesMap);
      resolvedString = sub.replace(templateString);
    } catch (Exception e) {
      resolvedString = "";
    }

    return resolvedString;
View Full Code Here

      public String lookup(String key) {
        return definition.parameterPathToSql(key).orNull();
      }
    };
    StrSubstitutor s = new StrSubstitutor(lookup, "{{", "}}", '$');
    String result = s.replace(sql);
    return result;
  }
 
  public String replaceProperties(final SqlObjectDefinition<?> definition, final String sql) {
    StrLookup<String> lookup = new StrLookup<String>() {
View Full Code Here

        JirmPrecondition.check.state(sqlName.isPresent(), "Property: {} not found in object.", key);
        return sqlName.get();
      }
    };
    StrSubstitutor s = new StrSubstitutor(lookup, "{{", "}}", '$');
    String result = s.replace(sql);
    return result;
  }
 
 
//  public String selectConjuntionQuery() {
View Full Code Here

     * @param expr expression string.
     * @return replaced string.
     */
    public String replaceVars(String expr) {
        StrSubstitutor s = new StrSubstitutor(this);
        return s.replace(expr);
    }

    /**
     * Replace variable reference to value for each strings.
     *
 
View Full Code Here

      public String lookup(String key) {
        return parameterPathToSql(definition,key).orNull();
      }
    };
    StrSubstitutor s = new StrSubstitutor(lookup, "{{", "}}", '$');
    String result = s.replace(sql);
    return result;
  }
 
  public String replaceProperties(final SqlObjectDefinition<?> definition, final String sql) {
    StrLookup<String> lookup = new StrLookup<String>() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.