List of usage examples for org.apache.commons.lang3.text StrSubstitutor DEFAULT_ESCAPE
char DEFAULT_ESCAPE
To view the source code for org.apache.commons.lang3.text StrSubstitutor DEFAULT_ESCAPE.
Click Source Link
From source file:org.eclipse.hawkbit.repository.jpa.rsql.VirtualPropertyResolverTest.java
@Before public void before() { when(confMgmt.getConfigurationValue(TenantConfigurationKey.POLLING_TIME_INTERVAL, String.class)) .thenReturn(TEST_POLLING_TIME_INTERVAL); when(confMgmt.getConfigurationValue(TenantConfigurationKey.POLLING_OVERDUE_TIME_INTERVAL, String.class)) .thenReturn(TEST_POLLING_OVERDUE_TIME_INTERVAL); substitutor = new StrSubstitutor(resolverUnderTest, StrSubstitutor.DEFAULT_PREFIX, StrSubstitutor.DEFAULT_SUFFIX, StrSubstitutor.DEFAULT_ESCAPE); }
From source file:org.eclipse.hawkbit.repository.jpa.rsql.VirtualPropertyResolverTest.java
@Test @Description("Tests escape mechanism for placeholders (syntax is $${SOME_PLACEHOLDER}).") public void handleEscapedPlaceholder() { final String placeholder = "${OVERDUE_TS}"; final String escaptedPlaceholder = StrSubstitutor.DEFAULT_ESCAPE + placeholder; final String testString = "lhs=lt=" + escaptedPlaceholder; final String resolvedPlaceholders = substitutor.replace(testString); assertThat("Escaped OVERDUE_TS should not be resolved!", resolvedPlaceholders, containsString(placeholder)); }
From source file:org.eclipse.hawkbit.repository.rsql.VirtualPropertyResolver.java
@Override public String replace(final String input) { if (substitutor == null) { substitutor = new StrSubstitutor(this, StrSubstitutor.DEFAULT_PREFIX, StrSubstitutor.DEFAULT_SUFFIX, StrSubstitutor.DEFAULT_ESCAPE); }/*from www .j a v a 2 s .c o m*/ return substitutor.replace(input); }