Index: src/main/java/java/text/spi/BreakIteratorProvider.java =================================================================== --- src/main/java/java/text/spi/BreakIteratorProvider.java (revision 0) +++ src/main/java/java/text/spi/BreakIteratorProvider.java (revision 0) @@ -0,0 +1,98 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package java.text.spi; + +import java.text.BreakIterator; +import java.util.Locale; +import java.util.spi.LocaleServiceProvider; + +/** + * This abstract class should be extended by service provider which provides + * instances of BreakIterator class. + */ +public abstract class BreakIteratorProvider extends LocaleServiceProvider { + + /** + * The constructor + * + */ + protected BreakIteratorProvider() { + // Do nothing. + } + + /** + * Get an instance of BreakIterator for word breaks for the + * given locale. + * + * @param locale + * the specified locale + * @return an intance of BreakIterator class + * @throws NullPointerException, + * if locale is null + * @throws IllegalArgumentException, + * if locale isn't one of the locales returned from + * getAvailableLocales(). + */ + public abstract BreakIterator getWordInstance(Locale locale); + + /** + * Get an instance of BreakIterator for line breaks for the + * given locale. + * + * @param locale + * the specified locale + * @return an instance of BreakIterator class + * @throws NullPointerException, + * if locale is null + * @throws IllegalArgumentException, + * if locale isn't one of the locales returned from + * getAvailableLocales(). + */ + public abstract BreakIterator getLineInstance(Locale locale); + + /** + * Get an instance of BreakIterator for character breaks for + * the given locale. + * + * @param locale + * the specified locale + * @return an instance of BreakIterator class + * @throws NullPointerException, + * if locale is null + * @throws IllegalArgumentException, + * if locale isn't one of the locales returned from + * getAvailableLocales(). + */ + public abstract BreakIterator getCharacterInstance(Locale locale); + + /** + * Get an instance of BreakIterator for sentence breaks for + * the given locale. + * + * @param locale + * the specified locale + * @return an instance of BreakIterator class + * @throws NullPointerException, + * if locale is null + * @throws IllegalArgumentException, + * if locale isn't one of the locales returned from + * getAvailableLocales(). + */ + public abstract BreakIterator getSentenceInstance(Locale locale); + +} Index: src/main/java/java/text/spi/CollatorProvider.java =================================================================== --- src/main/java/java/text/spi/CollatorProvider.java (revision 0) +++ src/main/java/java/text/spi/CollatorProvider.java (revision 0) @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package java.text.spi; + +import java.text.Collator; +import java.util.Locale; +import java.util.spi.LocaleServiceProvider; + +/** + * This abstract class should be extended by service provider which provides + * instances of Collator class. + */ +public abstract class CollatorProvider extends LocaleServiceProvider { + + /** + * The constructor + * + */ + protected CollatorProvider() { + // Do nothing. + } + + /** + * Get an instance of Collator for the given locale + * + * @param locale + * the specified locale + * @return an instance of Collator class + * @throws NullPointerException, + * if locale is null + * @throws IllegalArgumentException, + * if locale isn't one of the locales returned from + * getAvailableLocales(). + */ + public abstract Collator getInstance(Locale locale); +} Index: src/main/java/java/text/spi/DateFormatProvider.java =================================================================== --- src/main/java/java/text/spi/DateFormatProvider.java (revision 0) +++ src/main/java/java/text/spi/DateFormatProvider.java (revision 0) @@ -0,0 +1,91 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package java.text.spi; + +import java.text.DateFormat; +import java.util.Locale; +import java.util.spi.LocaleServiceProvider; + +/** + * This abstract class should be extended by service provider which provides + * instances of DateFormat class. + */ +public abstract class DateFormatProvider extends LocaleServiceProvider { + + /** + * The constructor + * + */ + protected DateFormatProvider() { + // Do nothing. + } + + /** + * Get an instance of DateFormat class which formats time + * with the given formatting style for the given locale + * + * @param style + * the given formatting style. + * @param locale + * the desired locale + * @return an instance of DateFormat class + * @throws IllegalArgumentException + * if style is invalid, or if locale isn't one of the locales + * returned from getAvailableLocales(). + * @throws NullPointerException + * if locale is null + */ + public abstract DateFormat getTimeInstance(int style, Locale locale); + + /** + * Get an instance of DateFormat class which formats date + * with the given formatting style for the given locale + * + * @param style + * the given formatting style. + * @param locale + * the desired locale + * @return an instance of DateFormat class + * @throws IllegalArgumentException + * if style is invalid, or if locale isn't one of the locales + * returned from getAvailableLocales(). + * @throws NullPointerException + * if locale is null + */ + public abstract DateFormat getDateInstance(int style, Locale locale); + + /** + * Get an instance of DateFormat class which formats date and + * time with the given formatting style for the given locale + * + * @param dateStyle + * the given date formatting style. + * @param timeStyle + * the given time formatting style. + * @param locale + * the desired locale + * @return an instance of DateFormat class + * @throws IllegalArgumentException + * if dateStyle or timeStyle is invalid, or if locale isn't one + * of the locales returned from getAvailableLocales(). + * @throws NullPointerException + * if locale is null + */ + public abstract DateFormat getDateTimeInstance(int dateStyle, + int timeStyle, Locale locale); +} Index: src/main/java/java/text/spi/DateFormatSymbolsProvider.java =================================================================== --- src/main/java/java/text/spi/DateFormatSymbolsProvider.java (revision 648126) +++ src/main/java/java/text/spi/DateFormatSymbolsProvider.java (working copy) @@ -22,7 +22,7 @@ import java.util.spi.LocaleServiceProvider; /** - * This abstract class should be extended by service provider which provide + * This abstract class should be extended by service provider which provides * instances of DateFormatSymbols class. * */ @@ -28,12 +28,16 @@ */ public abstract class DateFormatSymbolsProvider extends LocaleServiceProvider { + /** + * The constructor + * + */ protected DateFormatSymbolsProvider() { - super(); + // Do nothing. } /** - * Get an instance of DateFormatSymbols with specified + * Get an instance of DateFormatSymbols with the specified * locale. * * @param locale @@ -39,6 +43,9 @@ * @param locale * the specified locale * @return a DateFormatSymbols instance + * @throws NullPointerException, if locale is null + * @throws IllegalArgumentException, if locale isn't one of the locales + * returned from getAvailableLocales(). */ public abstract DateFormatSymbols getInstance(Locale locale); } Index: src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java =================================================================== --- src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java (revision 648126) +++ src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java (working copy) @@ -22,7 +22,7 @@ import java.util.spi.LocaleServiceProvider; /** - * This abstract class should be extended by service provider which provide + * This abstract class should be extended by service provider which provides * instances of DecimalFormatSymbols class. */ public abstract class DecimalFormatSymbolsProvider extends @@ -28,8 +28,12 @@ public abstract class DecimalFormatSymbolsProvider extends LocaleServiceProvider { + /** + * The constructor + * + */ protected DecimalFormatSymbolsProvider() { - super(); + // Do nothing. } /** @@ -39,6 +43,9 @@ * @param locale * the specified locale * @return a DecimalFormatSymbols instance + * @throws NullPointerException, if locale is null + * @throws IllegalArgumentException, if locale isn't one of the locales + * returned from getAvailableLocales(). */ public abstract DecimalFormatSymbols getInstance(Locale locale); Index: src/main/java/java/text/spi/NumberFormatProvider.java =================================================================== --- src/main/java/java/text/spi/NumberFormatProvider.java (revision 0) +++ src/main/java/java/text/spi/NumberFormatProvider.java (revision 0) @@ -0,0 +1,100 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package java.text.spi; + +import java.text.NumberFormat; +import java.util.Locale; +import java.util.spi.LocaleServiceProvider; + +/** + * This abstract class should be extended by service provider which provides + * instances of NumberFormat class. + */ +public abstract class NumberFormatProvider extends LocaleServiceProvider { + + /** + * The constructor + * + */ + protected NumberFormatProvider() { + // Do nothing. + } + + /** + * Get an instance of NumberFormat class which formats + * monetary values for the given locale. + * + * @param locale + * the specified locale + * @return an instance of NumberFormat class + * @throws NullPointerException, + * if locale is null + * @throws IllegalArgumentException, + * if locale isn't one of the locales returned from + * getAvailableLocales(). + */ + public abstract NumberFormat getCurrencyInstance(Locale locale); + + /** + * Get an instance of NumberFormat class which formats + * integer values for the given locale. The returned number format instance + * is configured to round floating point numbers to the nearest integer + * using half-even rounding mode for formatting, and to parse only the + * integer part of an input string. + * + * @param locale + * the specified locale + * @return an instance of NumberFormat class + * @throws NullPointerException, + * if locale is null + * @throws IllegalArgumentException, + * if locale isn't one of the locales returned from + * getAvailableLocales(). + */ + public abstract NumberFormat getIntegerInstance(Locale locale); + + /** + * Get an instance of NumberFormat class which is for general + * use for the given locale. + * + * @param locale + * the specified locale + * @return an instance of NumberFormat class + * @throws NullPointerException, + * if locale is null + * @throws IllegalArgumentException, + * if locale isn't one of the locales returned from + * getAvailableLocales(). + */ + public abstract NumberFormat getNumberInstance(Locale locale); + + /** + * Get an instance of NumberFormat class which formats + * percentage values for the given locale. + * + * @param locale + * the specified locale + * @return an instance of NumberFormat class + * @throws NullPointerException, + * if locale is null + * @throws IllegalArgumentException, + * if locale isn't one of the locales returned from + * getAvailableLocales(). + */ + public abstract NumberFormat getPercentInstance(Locale locale); +}