Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Logback: the reliable, generic, fast and flexible logging framework. Copyright (C) 1999-2011, All rights reserved. This program and the accompanying materials are dual-licensed under either the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation or (per the licensee's choosing) under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.
package ch.qos.logback.core.rolling.helper;
Returns a date formatted by SimpleDateFormatter.

Ceki Gücü
public class DateTokenConverter<E> extends DynamicConverter<E> implements MonoTypedConverter {

The conversion word/character with which this converter is registered.
  public final static String CONVERTER_KEY = "d";
  public final static String AUXILIARY_TOKEN = "AUX";
  private String datePattern;
  // is this token converter primary or auxiliary? Only the primary converter
  // determines the rolling period
  private boolean primary = true;
  public void start() {
    this. = getFirstOption();
    if (this. == null) {
      this. = ;
    final List<StringoptionList = getOptionList();
    if(optionList != null && optionList.size()> 1) {
      String secondOption = optionList.get(1);
      if(.equalsIgnoreCase(secondOption)) {
         = false;
  public String convert(Date date) {
    return .format(date.getTime());
  public String convert(Object o) {
    if (o == null) {
      throw new IllegalArgumentException("Null argument forbidden");
    if (o instanceof Date) {
      return convert((Dateo);
    throw new IllegalArgumentException("Cannot convert "+o+" of type"+o.getClass().getName());

Return the date pattern.
  public String getDatePattern() {
    return ;
  public boolean isApplicable(Object o) {
    return (o instanceof Date);
  public String toRegex() {
    DatePatternToRegexUtil datePatternToRegexUtil = new DatePatternToRegexUtil();
    return datePatternToRegexUtil.toRegex();
  public boolean isPrimary() {
    return ;
New to GrepCode? Check out our FAQ X