Example usage for org.apache.commons.lang.text StrLookup systemPropertiesLookup

List of usage examples for org.apache.commons.lang.text StrLookup systemPropertiesLookup

Introduction

In this page you can find the example usage for org.apache.commons.lang.text StrLookup systemPropertiesLookup.

Prototype

public static StrLookup systemPropertiesLookup() 

Source Link

Document

Returns a lookup which uses System#getProperties() System properties to lookup the key to value.

Usage

From source file:com.adobe.acs.commons.wcm.impl.AemEnvironmentIndicatorFilter.java

@Activate
@SuppressWarnings("squid:S1149")
protected final void activate(ComponentContext ctx) {
    Dictionary<?, ?> config = ctx.getProperties();

    color = PropertiesUtil.toString(config.get(PROP_COLOR), "");
    cssOverride = PropertiesUtil.toString(config.get(PROP_CSS_OVERRIDE), "");
    innerHTML = PropertiesUtil.toString(config.get(PROP_INNER_HTML), "");
    innerHTML = new StrSubstitutor(StrLookup.systemPropertiesLookup()).replace(innerHTML);

    // Only write CSS variable if cssOverride or color is provided
    if (StringUtils.isNotBlank(cssOverride)) {
        css = cssOverride;/*  w ww . java2 s .com*/
    } else if (StringUtils.isNotBlank(color)) {
        css = createCss(color);
    }

    titlePrefix = xss.encodeForJSString(PropertiesUtil.toString(config.get(PROP_TITLE_PREFIX), "").toString());

    if (StringUtils.isNotBlank(css) || StringUtils.isNotBlank(titlePrefix)) {
        Dictionary<String, String> filterProps = new Hashtable<String, String>();
        filterProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN, "/");
        filterProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT,
                "(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=*)");
        filterRegistration = ctx.getBundleContext().registerService(Filter.class.getName(), this, filterProps);
    }

    excludedWCMModes = PropertiesUtil.toStringArray(config.get(PROP_EXCLUDED_WCMMODES),
            DEFAULT_EXCLUDED_WCMMODES);
}

From source file:org.aludratest.impl.log4testing.configuration.ReflectionUtil.java

private static String substituteSystemProperties(String param) {
    final StrLookup systemLookup = StrLookup.systemPropertiesLookup();
    final StrSubstitutor substitutor = new StrSubstitutor(systemLookup);
    return substitutor.replace(param);
}