Package org.apache.commons.lang3.text

Examples of org.apache.commons.lang3.text.StrSubstitutor


    @Before
    public void setUp() {
        StaticContainer.reset();
        publicChild = new PublicChild();
        publiclyShadowedChild = new PubliclyShadowedChild();
        privatelyShadowedChild = new PrivatelyShadowedChild();
    }
View Full Code Here


                    Object value = ip.resolve(key);
                    return (value != null) ? value.toString() : null;
                }
            };
            substitutor =
                    new StrSubstitutor(variableResolver, prefixMatcher,
                            suffixMatcher, StrSubstitutor.DEFAULT_ESCAPE);
        }
    }
View Full Code Here

     *
     * @return the {@code StrSubstitutor} used by this object
     */
    private StrSubstitutor initSubstitutor()
    {
        return new StrSubstitutor(new StrLookup<Object>()
        {
            @Override
            public String lookup(String key)
            {
                Object result = resolve(key);
View Full Code Here

            if (additionals != null) {
                if (placeHolders == null) {
                    placeHolders = new HashMap<String, String>();
                }

                final StrSubstitutor lookup = new StrSubstitutor(StrLookup.mapLookup(placeHolders));

                for (final String line : additionals) {
                    final StringBuilder builder = new StringBuilder(line);
                    if (hashAlgo != null) {
                        builder.append("|").append(Files.hash(urls(line, lookup), hashAlgo))
View Full Code Here

      senderName = settingService.getConfig(storeId, SettingKey.CFG_NAME, String.class);
    }
   
    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

     *
     * @return the {@code StrSubstitutor} used by this object
     */
    private StrSubstitutor initSubstitutor()
    {
        return new StrSubstitutor(new StrLookup<Object>()
        {
            @Override
            public String lookup(String key)
            {
                Object result = resolve(key);
View Full Code Here

                    Object value = ip.resolve(key);
                    return (value != null) ? value.toString() : null;
                }
            };
            substitutor =
                    new StrSubstitutor(variableResolver, prefixMatcher,
                            suffixMatcher, StrSubstitutor.DEFAULT_ESCAPE);
        }
    }
View Full Code Here

            System.out.println("quiiiiiiiii");
            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.setUploadMode(theXMLConfUpload.valoreNodo(prefixUpload + "[" + (i + 1) + "]" + "/commandList/command[" + (j + 1) + "]/uploadMode/text()"));
          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

TOP

Related Classes of org.apache.commons.lang3.text.StrSubstitutor

Copyright © 2018 www.massapicom. 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.