本文整理汇总了Java中ch.qos.logback.core.Context.getObject方法的典型用法代码示例。如果您正苦于以下问题:Java Context.getObject方法的具体用法?Java Context.getObject怎么用?Java Context.getObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ch.qos.logback.core.Context
的用法示例。
在下文中一共展示了Context.getObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEffectiveConverterMap
import ch.qos.logback.core.Context; //导入方法依赖的package包/类
/**
* Returns a map where the default converter map is merged with the map
* contained in the context.
*/
public Map<String, String> getEffectiveConverterMap() {
Map<String, String> effectiveMap = new HashMap<String, String>();
// add the least specific map fist
Map<String, String> defaultMap = getDefaultConverterMap();
if (defaultMap != null) {
effectiveMap.putAll(defaultMap);
}
// contextMap is more specific than the default map
Context context = getContext();
if (context != null) {
@SuppressWarnings("unchecked")
Map<String, String> contextMap = (Map<String, String>) context
.getObject(CoreConstants.PATTERN_RULE_REGISTRY);
if (contextMap != null) {
effectiveMap.putAll(contextMap);
}
}
// set the most specific map last
effectiveMap.putAll(instanceConverterMap);
return effectiveMap;
}
示例2: getEffectiveConverterMap
import ch.qos.logback.core.Context; //导入方法依赖的package包/类
/**
* Returns a map where the default converter map is merged with the map
* contained in the context.
*/
public Map<String, String> getEffectiveConverterMap() {
Map<String, String> effectiveMap = new HashMap<String, String>();
// add the least specific map fist
Map<String, String> defaultMap = getDefaultConverterMap();
if (defaultMap != null) {
effectiveMap.putAll(defaultMap);
}
// contextMap is more specific than the default map
Context context = getContext();
if (context != null) {
@SuppressWarnings("unchecked")
Map<String, String> contextMap = (Map<String, String>) context
.getObject(CoreConstants.PATTERN_RULE_REGISTRY);
if (contextMap != null) {
effectiveMap.putAll(contextMap);
}
}
return effectiveMap;
}
示例3: wasConfigurationWatchListReset
import ch.qos.logback.core.Context; //导入方法依赖的package包/类
public static boolean wasConfigurationWatchListReset(Context context) {
Object o = context.getObject(CoreConstants.CONFIGURATION_WATCH_LIST_RESET);
if (o == null)
return false;
else {
return ((Boolean) o).booleanValue();
}
}
示例4: getConfigurationWatchList
import ch.qos.logback.core.Context; //导入方法依赖的package包/类
public static ConfigurationWatchList getConfigurationWatchList(Context context) {
return (ConfigurationWatchList) context.getObject(CoreConstants.CONFIGURATION_WATCH_LIST);
}
示例5: start
import ch.qos.logback.core.Context; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void start() {
String depthStr = getFirstOption();
if (depthStr == null) {
return;
}
try {
if (isRange(depthStr)) {
String[] numbers = splitRange(depthStr);
if (numbers.length == 2) {
depthStart = Integer.parseInt(numbers[0]);
depthEnd = Integer.parseInt(numbers[1]);
checkRange();
} else {
addError("Failed to parse depth option as range [" + depthStr + "]");
}
} else {
depthEnd = Integer.parseInt(depthStr);
}
} catch (NumberFormatException nfe) {
addError("Failed to parse depth option [" + depthStr + "]", nfe);
}
final List optionList = getOptionList();
if (optionList != null && optionList.size() > 1) {
final int optionListSize = optionList.size();
for (int i = 1; i < optionListSize; i++) {
String evaluatorStr = (String) optionList.get(i);
Context context = getContext();
if (context != null) {
Map evaluatorMap = (Map) context
.getObject(CoreConstants.EVALUATOR_MAP);
EventEvaluator<ILoggingEvent> ee = (EventEvaluator<ILoggingEvent>) evaluatorMap
.get(evaluatorStr);
if (ee != null) {
addEvaluator(ee);
}
}
}
}
}
示例6: start
import ch.qos.logback.core.Context; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void start() {
String lengthStr = getFirstOption();
if (lengthStr == null) {
lengthOption = Integer.MAX_VALUE;
} else {
lengthStr = lengthStr.toLowerCase();
if ("full".equals(lengthStr)) {
lengthOption = Integer.MAX_VALUE;
} else if ("short".equals(lengthStr)) {
lengthOption = 1;
} else {
try {
lengthOption = Integer.parseInt(lengthStr);
} catch (NumberFormatException nfe) {
addError("Could not parse [" + lengthStr + "] as an integer");
lengthOption = Integer.MAX_VALUE;
}
}
}
final List optionList = getOptionList();
if (optionList != null && optionList.size() > 1) {
final int optionListSize = optionList.size();
for (int i = 1; i < optionListSize; i++) {
String evaluatorOrIgnoredStackTraceLine = (String) optionList.get(i);
Context context = getContext();
Map evaluatorMap = (Map) context.getObject(CoreConstants.EVALUATOR_MAP);
EventEvaluator<ILoggingEvent> ee = (EventEvaluator<ILoggingEvent>) evaluatorMap
.get(evaluatorOrIgnoredStackTraceLine);
if (ee != null) {
addEvaluator(ee);
} else {
addIgnoreStackTraceLine(evaluatorOrIgnoredStackTraceLine);
}
}
}
super.start();
}