Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 90145 invoked from network); 15 Apr 2008 09:55:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Apr 2008 09:55:01 -0000 Received: (qmail 1821 invoked by uid 500); 15 Apr 2008 09:55:01 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 1806 invoked by uid 500); 15 Apr 2008 09:55:01 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 1797 invoked by uid 99); 15 Apr 2008 09:55:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Apr 2008 02:55:01 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Apr 2008 09:54:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 32B891A9832; Tue, 15 Apr 2008 02:54:36 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r648199 - /harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/ Date: Tue, 15 Apr 2008 09:54:33 -0000 To: commits@harmony.apache.org From: lvjing@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080415095436.32B891A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: lvjing Date: Tue Apr 15 02:54:23 2008 New Revision: 648199 URL: http://svn.apache.org/viewvc?rev=648199&view=rev Log: Apply patch for HARMONY-5732,[classlib][text][java6] Add provider classes for java.text.spi Added: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java (with props) harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java (with props) harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java (with props) harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java (with props) Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java Added: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java?rev=648199&view=auto ============================================================================== --- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java (added) +++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java Tue Apr 15 02:54:23 2008 @@ -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); + +} Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java ------------------------------------------------------------------------------ svn:eol-style = native Added: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java?rev=648199&view=auto ============================================================================== --- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java (added) +++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java Tue Apr 15 02:54:23 2008 @@ -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); +} Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java ------------------------------------------------------------------------------ svn:eol-style = native Added: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java?rev=648199&view=auto ============================================================================== --- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java (added) +++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java Tue Apr 15 02:54:23 2008 @@ -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); +} Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java?rev=648199&r1=648198&r2=648199&view=diff ============================================================================== --- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java (original) +++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java Tue Apr 15 02:54:23 2008 @@ -22,23 +22,30 @@ 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. * */ 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 * 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); } Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java?rev=648199&r1=648198&r2=648199&view=diff ============================================================================== --- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java (original) +++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java Tue Apr 15 02:54:23 2008 @@ -22,14 +22,18 @@ 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 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); Added: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java?rev=648199&view=auto ============================================================================== --- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java (added) +++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java Tue Apr 15 02:54:23 2008 @@ -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); +} Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java ------------------------------------------------------------------------------ svn:eol-style = native