/** * Creates a new instance and initializes it. Uses defaults for variable * prefix and suffix and the escaping character. * * @param valueMap the map with the variables' values, may be null */ public StrSubstitutor(Map valueMap) { this(StrLookup.mapLookup(valueMap), DEFAULT_PREFIX, DEFAULT_SUFFIX, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @param escape the escape character * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix, char escape) { this(StrLookup.mapLookup(valueMap), prefix, suffix, escape); }
/** * Creates a new instance and initializes it. Uses a default escaping character. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix) { this(StrLookup.mapLookup(valueMap), prefix, suffix, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. Uses a default escaping character. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix) { this(StrLookup.mapLookup(valueMap), prefix, suffix, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. Uses a default escaping character. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix) { this(StrLookup.mapLookup(valueMap), prefix, suffix, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @param escape the escape character * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix, char escape) { this(StrLookup.mapLookup(valueMap), prefix, suffix, escape); }
/** * Creates a new instance and initializes it. Uses defaults for variable * prefix and suffix and the escaping character. * * @param valueMap the map with the variables' values, may be null */ public StrSubstitutor(Map valueMap) { this(StrLookup.mapLookup(valueMap), DEFAULT_PREFIX, DEFAULT_SUFFIX, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. Uses defaults for variable * prefix and suffix and the escaping character. * * @param valueMap the map with the variables' values, may be null */ public StrSubstitutor(Map valueMap) { this(StrLookup.mapLookup(valueMap), DEFAULT_PREFIX, DEFAULT_SUFFIX, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @param escape the escape character * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix, char escape) { this(StrLookup.mapLookup(valueMap), prefix, suffix, escape); }
/** * Creates a new instance and initializes it. Uses defaults for variable * prefix and suffix and the escaping character. * * @param valueMap the map with the variables' values, may be null */ public StrSubstitutor(Map valueMap) { this(StrLookup.mapLookup(valueMap), DEFAULT_PREFIX, DEFAULT_SUFFIX, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. Uses a default escaping character. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix) { this(StrLookup.mapLookup(valueMap), prefix, suffix, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @param escape the escape character * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix, char escape) { this(StrLookup.mapLookup(valueMap), prefix, suffix, escape); }
/** * Creates a new instance and initializes it. Uses a default escaping character. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix) { this(StrLookup.mapLookup(valueMap), prefix, suffix, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. Uses a default escaping character. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix) { this(StrLookup.mapLookup(valueMap), prefix, suffix, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. Uses defaults for variable * prefix and suffix and the escaping character. * * @param valueMap the map with the variables' values, may be null */ public StrSubstitutor(Map valueMap) { this(StrLookup.mapLookup(valueMap), DEFAULT_PREFIX, DEFAULT_SUFFIX, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @param escape the escape character * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix, char escape) { this(StrLookup.mapLookup(valueMap), prefix, suffix, escape); }
/** * Creates a new instance and initializes it. Uses defaults for variable * prefix and suffix and the escaping character. * * @param valueMap the map with the variables' values, may be null */ public StrSubstitutor(Map valueMap) { this(StrLookup.mapLookup(valueMap), DEFAULT_PREFIX, DEFAULT_SUFFIX, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. * * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @param escape the escape character * @throws IllegalArgumentException if the prefix or suffix is null */ public StrSubstitutor(Map valueMap, String prefix, String suffix, char escape) { this(StrLookup.mapLookup(valueMap), prefix, suffix, escape); }
private void configureInternal() throws Exception { Properties properties = new Properties(); properties.load(getClass().getResourceAsStream("/test.properties")); for (Object o : System.getProperties().keySet()) { properties.put("" + o, System.getProperty("" + o)); } bind(Properties.class).toInstance(properties); StrSubstitutor sub = new StrSubstitutor(StrLookup.mapLookup(properties)); bind(StrSubstitutor.class).toInstance(sub); }
private Email getEmail(final MailTemplate mailTemplate, final Class<? extends Email> mailType, final Map<String, String> params) throws EmailException, MessagingException, IOException { final Email email = mailTemplate.getEmail(StrLookup.mapLookup(params), mailType); if (params.containsKey(EmailServiceConstants.SENDER_EMAIL_ADDRESS) && params.containsKey(EmailServiceConstants.SENDER_NAME)) { email.setFrom( params.get(EmailServiceConstants.SENDER_EMAIL_ADDRESS), params.get(EmailServiceConstants.SENDER_NAME)); } else if (params.containsKey(EmailServiceConstants.SENDER_EMAIL_ADDRESS)) { email.setFrom(params.get(EmailServiceConstants.SENDER_EMAIL_ADDRESS)); } return email; }