本文整理汇总了Java中org.apache.commons.lang.text.StrLookup类的典型用法代码示例。如果您正苦于以下问题:Java StrLookup类的具体用法?Java StrLookup怎么用?Java StrLookup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StrLookup类属于org.apache.commons.lang.text包,在下文中一共展示了StrLookup类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BuildSession
import org.apache.commons.lang.text.StrLookup; //导入依赖的package包/类
public BuildSession(String buildId, AgentIdentifier agentIdentifier, BuildStateReporter buildStateReporter, TaggedStreamConsumer console, StrLookup buildVariables, ArtifactsRepository artifactsRepository, HttpService httpService, Clock clock, File workingDir, String consoleLogCharset) {
this.buildId = buildId;
this.agentIdentifier = agentIdentifier;
this.buildStateReporter = buildStateReporter;
this.console = console;
this.buildVariables = buildVariables;
this.artifactsRepository = artifactsRepository;
this.httpService = httpService;
this.clock = clock;
this.workingDir = workingDir;
this.consoleLogCharset = consoleLogCharset;
this.envs = new HashMap<>();
this.secretSubstitutions = new HashMap<>();
this.buildResult = JobResult.Passed;
this.doneLatch = new CountDownLatch(1);
this.cancelLatch = new CountDownLatch(1);
this.downloadAction = new DownloadAction(httpService, getPublisher(), clock);
this.executorService = Executors.newCachedThreadPool();
}
示例2: handleInterpolation
import org.apache.commons.lang.text.StrLookup; //导入依赖的package包/类
private String handleInterpolation(String value) {
StrSubstitutor substitutor = new StrSubstitutor(new StrLookup() {
@Override
public String lookup(String key) {
String property = getSystemOrAppProperty(key);
return property != null ? property : System.getProperty(key);
}
});
return substitutor.replace(value);
}
示例3: BuildVariables
import org.apache.commons.lang.text.StrLookup; //导入依赖的package包/类
public BuildVariables(AgentRuntimeInfo agentRuntimeInfo, Clock clock) {
this.clock = clock;
this.staticLookup = StrLookup.mapLookup(map(
"agent.location", agentRuntimeInfo.getLocation(),
"agent.hostname", agentRuntimeInfo.getHostName()
));
}
示例4: newBuildSession
import org.apache.commons.lang.text.StrLookup; //导入依赖的package包/类
protected BuildSession newBuildSession() {
return new BuildSession("build1",
agentIdentifier, statusReporter,
console,
StrLookup.mapLookup(buildVariables),
artifactsRepository, httpService, new TestingClock(), sandbox, "utf-8");
}
示例5: getEmail
import org.apache.commons.lang.text.StrLookup; //导入依赖的package包/类
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));
}
if (connectTimeout > 0) {
email.setSocketConnectionTimeout(connectTimeout);
}
if (soTimeout > 0) {
email.setSocketTimeout(soTimeout);
}
// #1008 setting the subject via the setSubject(..) parameter.
if (params.containsKey(EmailServiceConstants.SUBJECT)) {
email.setSubject(params.get(EmailServiceConstants.SUBJECT));
}
return email;
}
示例6: activate
import org.apache.commons.lang.text.StrLookup; //导入依赖的package包/类
@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;
} 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);
}
开发者ID:Adobe-Consulting-Services,项目名称:acs-aem-commons,代码行数:30,代码来源:AemEnvironmentIndicatorFilter.java
示例7: fetchLookupForPrefix
import org.apache.commons.lang.text.StrLookup; //导入依赖的package包/类
@Override
protected StrLookup fetchLookupForPrefix(String prefix) {
return errorLookup;
}
示例8: fetchNoPrefixLookup
import org.apache.commons.lang.text.StrLookup; //导入依赖的package包/类
@Override
protected StrLookup fetchNoPrefixLookup() {
return errorLookup;
}