// Path: app/src/main/java/de/codecentric/validate/TimeValidator.java
// public interface TimeValidator {
// 
//     /**
//      * Validate time in 24 hours format with regular expression
//      * 
//      * @param time
//      *            time address for validation
//      * @return true valid time format, false invalid time format
//      */
//     public abstract boolean validate(String time);
// 
// }
// 
// Path: app/src/main/java/de/codecentric/validate/impl/Time24HoursValidator.java
// public class Time24HoursValidator implements TimeValidator {
// 
//     private Pattern pattern;
//     private Matcher matcher;
// 
//     private static final String TIME24HOURS_PATTERN = "([01]?[0-9]|2[0-3]):[0-5][0-9]";
// 
//     public Time24HoursValidator() {
//         pattern = Pattern.compile(TIME24HOURS_PATTERN);
//     }
// 
//     /*
//      * (non-Javadoc)
//      * 
//      * @see
//      * de.codecentric.validate.impl.TimeValidator#validate(java.lang.String)
//      */
//     @Override
//     public boolean validate(final String time) {
//         matcher = pattern.matcher(time);
//         return matcher.matches();
//     }
// 
// }


import java.util.Locale;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import de.codecentric.validate.TimeValidator;
import de.codecentric.validate.impl.Time24HoursValidator;
package de.codecentric.config;




@Configuration
public class ApplicationWebConfiguration extends WebMvcConfigurerAdapter {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        super.addViewControllers(registry);
        registry.addViewController("/").setViewName("redirect:/currentSessions");
    }

    @Bean
    public ObjectMapper objectMapper() {
        return new ObjectMapper();
    }

    @Bean
    public TimeValidator timeValidator() {
// Path: app/src/main/java/de/codecentric/validate/TimeValidator.java
// public interface TimeValidator {
// 
//     /**
//      * Validate time in 24 hours format with regular expression
//      * 
//      * @param time
//      *            time address for validation
//      * @return true valid time format, false invalid time format
//      */
//     public abstract boolean validate(String time);
// 
// }
// 
// Path: app/src/main/java/de/codecentric/validate/impl/Time24HoursValidator.java
// public class Time24HoursValidator implements TimeValidator {
// 
//     private Pattern pattern;
//     private Matcher matcher;
// 
//     private static final String TIME24HOURS_PATTERN = "([01]?[0-9]|2[0-3]):[0-5][0-9]";
// 
//     public Time24HoursValidator() {
//         pattern = Pattern.compile(TIME24HOURS_PATTERN);
//     }
// 
//     /*
//      * (non-Javadoc)
//      * 
//      * @see
//      * de.codecentric.validate.impl.TimeValidator#validate(java.lang.String)
//      */
//     @Override
//     public boolean validate(final String time) {
//         matcher = pattern.matcher(time);
//         return matcher.matches();
//     }
// 
// }


// Path: app/src/main/java/de/codecentric/config/ApplicationWebConfiguration.java
import java.util.Locale;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import de.codecentric.validate.TimeValidator;
import de.codecentric.validate.impl.Time24HoursValidator;

package de.codecentric.config;




@Configuration
public class ApplicationWebConfiguration extends WebMvcConfigurerAdapter {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        super.addViewControllers(registry);
        registry.addViewController("/").setViewName("redirect:/currentSessions");
    }

    @Bean
    public ObjectMapper objectMapper() {
        return new ObjectMapper();
    }

    @Bean
    public TimeValidator timeValidator() {
        return new Time24HoursValidator();