Package org.conventionsframework.qualifier

Examples of org.conventionsframework.qualifier.DateFormat


    Map<String,SimpleDateFormat> dateFormatCache = new HashMap<String,SimpleDateFormat>();

    @Produces
    @DateFormat
    public SimpleDateFormat getDateFormat(InjectionPoint ip){
        DateFormat df = ip.getAnnotated().getAnnotation(DateFormat.class);
        String pattern = df.pattern();
        if(dateFormatCache.containsKey(pattern)){
            return dateFormatCache.get(pattern);
        }
        SimpleDateFormat sdf = new SimpleDateFormat(df.pattern());
        dateFormatCache.put(pattern,sdf);
        return sdf;
    }
View Full Code Here

TOP

Related Classes of org.conventionsframework.qualifier.DateFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.