Package org.apache.commons.lang3.text

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


        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 Optional<String> parameterPathToSql(final SqlObjectDefinition<?> definition, String parameterDotPath) {
    List<SqlParameterDefinition> parts = definition.resolveParameterPath(parameterDotPath);
View Full Code Here


    }

    @Override
    public String format(String pattern, Map<String, Object> paramMap) {
        StrSubstitutor sub = new StrSubstitutor(paramMap, prefix, suffix);
        return sub.replace(pattern);
    }
}
View Full Code Here

            "Invalid object path: {}", key);
        return p.get();
      }
    };
    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

        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 Optional<String> parameterPathToSql(final SqlObjectDefinition<?> definition, String parameterDotPath) {
    List<SqlParameterDefinition> parts = definition.resolveParameterPath(parameterDotPath);
View Full Code Here

    if(lon != null) params.put("lon", lon);
    if(lat != null) params.put("lat", lat);

    StrSubstitutor sub = new StrSubstitutor(params.build(), "${", "}");
    if(lon != null && lat != null) {
      query = sub.replace(queryLocationBiasTemplate);
    } else {
      query = sub.replace(queryTemplate);
    }

    SearchResponse response = client.prepareSearch("photon").setSearchType(SearchType.QUERY_AND_FETCH).setQuery(query).setSize(limit).setTimeout(TimeValue.timeValueSeconds(7)).execute().actionGet();
View Full Code Here

    StrSubstitutor sub = new StrSubstitutor(params.build(), "${", "}");
    if(lon != null && lat != null) {
      query = sub.replace(queryLocationBiasTemplate);
    } else {
      query = sub.replace(queryTemplate);
    }

    SearchResponse response = client.prepareSearch("photon").setSearchType(SearchType.QUERY_AND_FETCH).setQuery(query).setSize(limit).setTimeout(TimeValue.timeValueSeconds(7)).execute().actionGet();
    List<JSONObject> results = convert(response.getHits().getHits(), lang);
    results = removeStreetDuplicates(results);
View Full Code Here

    eventData.put("DESCRIPTION", summary);
   
    eventData.put("UID", getEventUID());
    StrSubstitutor sub = new StrSubstitutor(eventData);
   
    return sub.replace(template);
  }
 
  /**
   * gets the UID value to use in the calendar for identifying the source of the event
   * @return primary key and canonical class name concatenated e.g. 1001-org.martinlaw.bo.courtcase.Event
View Full Code Here

            "Invalid object path: {}", key);
        return p.get();
      }
    };
    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 Optional<String> parameterPathToSql(final SqlObjectDefinition<?> definition, String parameterDotPath) {
    List<SqlParameterDefinition> parts = definition.resolveParameterPath(parameterDotPath);
View Full Code Here

    // Perform any string substitutions from the message format
    StrLookup<?> lookup = new MyLookup(theRequest, theRequestDetails);
    StrSubstitutor subs = new StrSubstitutor(lookup, "${", "}", '\\');

    // Actuall log the line
    String line = subs.replace(myMessageFormat);
    myLogger.info(line);

    return true;
  }
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.