Package jnode.core

Examples of jnode.core.ConcurrentDateFormatAccess


            public String formatValue(Object s) {
                return s == null ? "" : String.valueOf(s);
            }
        });
        formatters.put("D", new FieldFormatter() {
            private final ConcurrentDateFormatAccess dateFormat = new ConcurrentDateFormatAccess("dd.MM.yyyy");

            @Override
            public String formatValue(Object s) {

                if (!(s instanceof String)) {
                    return "";
                }

                String str = (String) s;

                long time;
                try {
                    time = Long.parseLong(str);
                } catch (NumberFormatException e) {
                    return "Bad date(1)";
                }

                if (time <= 0) {
                    return "Bad date(2)";
                }

                Date date = new Date(time);

                return dateFormat.format(date);
            }
        });

    }
View Full Code Here

TOP

Related Classes of jnode.core.ConcurrentDateFormatAccess

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.