当前位置: 首页>>代码示例>>Java>>正文


Java Context.getObject方法代码示例

本文整理汇总了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;
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:28,代码来源:PatternLayoutBase.java

示例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;
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:26,代码来源:HTMLLayoutBase.java

示例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();
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:9,代码来源:ConfigurationWatchListUtil.java

示例4: getConfigurationWatchList

import ch.qos.logback.core.Context; //导入方法依赖的package包/类
public static ConfigurationWatchList getConfigurationWatchList(Context context) {
  return (ConfigurationWatchList) context.getObject(CoreConstants.CONFIGURATION_WATCH_LIST);
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:4,代码来源:ConfigurationWatchListUtil.java

示例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);
        }
      }
    }
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:44,代码来源:CallerDataConverter.java

示例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();
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:43,代码来源:ThrowableProxyConverter.java


注:本文中的ch.qos.logback.core.Context.getObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。