Examples of StrSubstitutor


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

     */
    public synchronized StrSubstitutor getSubstitutor()
    {
        if (substitutor == null)
        {
            substitutor = new StrSubstitutor(createInterpolator());
        }
        return substitutor;
    }
View Full Code Here

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

                    // hack "a la" invoker plugin to download dependencies from local repo
                    // and not download from central

                    Map<String, String> values = new HashMap<String, String>( 1 );
                    values.put( "localRepositoryUrl", toUrl( userLocalRepo ) );
                    StrSubstitutor strSubstitutor = new StrSubstitutor( values );

                    String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml" ) );

                    String filtered = strSubstitutor.replace( fileContent );

                    FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered );

                }
View Full Code Here

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

         * @return The normalized URI reference.
         */
        @Override
        protected String normalizeURI(String uriref)
        {
            StrSubstitutor substitutor = ((CatalogManager) catalogManager).getStrSubstitutor();
            String resolved = substitutor != null ? substitutor.replace(uriref) : uriref;
            return super.normalizeURI(resolved);
        }
View Full Code Here

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

     */
    public synchronized StrSubstitutor getSubstitutor()
    {
        if (substitutor == null)
        {
            substitutor = new StrSubstitutor(createInterpolator());
        }
        return substitutor;
    }
View Full Code Here

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

         * @return The normalized URI reference.
         */
        @Override
        protected String normalizeURI(String uriref)
        {
            StrSubstitutor substitutor = ((CatalogManager) catalogManager).getStrSubstitutor();
            String resolved = substitutor != null ? substitutor.replace(uriref) : uriref;
            return super.normalizeURI(resolved);
        }
View Full Code Here

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

            boolean missingPropertyFound = false;
            for (String missingProperty : Sets.difference(allProperties, valueMap.keySet()).immutableCopy()) {
                valueMap.put(missingProperty, MISSING_PROPERTY_PREFIX + missingProperty + MISSING_PROPERTY_SUFFIX);
                missingPropertyFound = true;
            }
            final StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap, propertyPrefix, propertySuffix);
            for (final FileInfo template : templates) {
                generateConfig(template, filter, outputBasePath, strSubstitutor, missingPropertiesByFilename, missingPropertyFound);
            }
        }
View Full Code Here

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

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

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

     *
     * @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

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

            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

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

      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
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.