KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > binding > format > FormatterFactory


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.springframework.binding.format;
17
18 /**
19  * Source for shared and commonly used <code>Formatters</code>.
20  * <p>
21  * Formatters are typically not thread safe as <code>Format</code> objects
22  * aren't thread safe: so implementations of this service should take care to
23  * synchronize them as neccessary.
24  * @author Keith Donald
25  */

26 public interface FormatterFactory {
27
28     /**
29      * Returns a date formatter for the encoded date format
30      * @param encodedFormat the format
31      * @return the formatter
32      */

33     public Formatter getDateFormatter(String JavaDoc encodedFormat);
34
35     /**
36      * Returns the default date format for the current locale
37      * @return the date formatter
38      */

39     public Formatter getDateFormatter();
40
41     /**
42      * Returns the date format with the specified style for the current locale.
43      * @param style the style
44      * @return the formatter
45      */

46     public Formatter getDateFormatter(Style style);
47
48     /**
49      * Returns the default date/time format for the current locale
50      * @return the date/time formatter
51      */

52     public Formatter getDateTimeFormatter();
53
54     /**
55      * Returns the date format with the specified styles for the current locale.
56      * @param dateStyle the date style
57      * @param timeStyle the time style
58      * @return the formatter
59      */

60     public Formatter getDateTimeFormatter(Style dateStyle, Style timeStyle);
61
62     /**
63      * Returns the default time format for the current locale
64      * @return the time formatter
65      */

66     public Formatter getTimeFormatter();
67
68     /**
69      * Returns the time format with the specified style for the current locale.
70      * @param style the style
71      * @return the formatter
72      */

73     public Formatter getTimeFormatter(Style style);
74
75     /**
76      * Returns a number formatter for the specified class.
77      * @param numberClass the number class
78      * @return the number formatter
79      */

80     public Formatter getNumberFormatter(Class JavaDoc numberClass);
81
82     /**
83      * Returns a percent number formatter
84      * @return the percent formatter
85      */

86     public Formatter getPercentFormatter();
87
88     /**
89      * Returns a currency number formatter
90      * @return the currency formatter
91      */

92     public Formatter getCurrencyFormatter();
93
94 }
Popular Tags