harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r546390 - in /harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi: ./ CurrencyNameProvider.java LocaleNameProvider.java LocaleServiceProvider.java TimeZoneNameProvider.java
Date Tue, 12 Jun 2007 06:19:19 GMT
Author: pyang
Date: Mon Jun 11 23:19:18 2007
New Revision: 546390

URL: http://svn.apache.org/viewvc?view=rev&rev=546390
Log:
Apply patch for HARMONY-4128([classlib][luni][java6] New package java.util.spi for java6)

Added:
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/CurrencyNameProvider.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/LocaleNameProvider.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/LocaleServiceProvider.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/TimeZoneNameProvider.java

Added: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/CurrencyNameProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/CurrencyNameProvider.java?view=auto&rev=546390
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/CurrencyNameProvider.java
(added)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/CurrencyNameProvider.java
Mon Jun 11 23:19:18 2007
@@ -0,0 +1,54 @@
+/*
+ *  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.util.spi;
+
+import java.util.Locale;
+
+/**
+ * CurrencyNameProvider is an abstract class to get localized currency symbols
+ * from service providers.
+ * 
+ * @since 1.6
+ * 
+ */
+public abstract class CurrencyNameProvider extends LocaleServiceProvider {
+
+	/**
+	 * The constructor
+	 * 
+	 */
+	protected CurrencyNameProvider() {
+		// do nothing
+	}
+
+	/**
+	 * Returns the symbol for the specified currency
+	 * 
+	 * @param code
+	 *            the code of the specified currency in "ISO 4217"
+	 * @param locale
+	 *            the locale
+	 * @return the symbol or null if there is no available symbol in the locale
+	 * @throws NullPointerException
+	 *             if code or locale is null
+	 * @throws IllegalArgumentException
+	 *             if code or locale is not in a legal format or not available
+	 */
+	public abstract String getSymbol(String code, Locale locale);
+
+}

Added: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/LocaleNameProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/LocaleNameProvider.java?view=auto&rev=546390
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/LocaleNameProvider.java
(added)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/LocaleNameProvider.java
Mon Jun 11 23:19:18 2007
@@ -0,0 +1,86 @@
+/*
+ *  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.util.spi;
+
+import java.util.Locale;
+
+/**
+ * LocaleNameProvider is an abstract class to get localized names from service
+ * providers.
+ * 
+ * @since 1.6
+ * 
+ */
+public abstract class LocaleNameProvider extends LocaleServiceProvider {
+
+	/**
+	 * The constructor
+	 * 
+	 */
+	protected LocaleNameProvider() {
+		// do nothing
+	}
+
+	/**
+	 * Gets the localized name for the specified language code in "ISO 639" and
+	 * the specified locale to display.
+	 * 
+	 * @param code
+	 *            the code of language in "ISO 639"
+	 * @param locale
+	 *            the locale
+	 * @return the name or null if unavailable
+	 * @throws NullPointerException
+	 *             if code or locale is null
+	 * @throws IllegalArgumentException
+	 *             if code or locale is not in a legal format or not available
+	 */
+	public abstract String getDisplayLanguage(String code, Locale locale);
+
+	/**
+	 * Gets the localized name for the specified country code in "ISO 3166" and
+	 * the specified locale to display.
+	 * 
+	 * @param code
+	 *            the code of country in "ISO 3166"
+	 * @param locale
+	 *            the locale
+	 * @return the name or null if unavailable
+	 * @throws NullPointerException
+	 *             if code or locale is null
+	 * @throws IllegalArgumentException
+	 *             if code or locale is not in a legal format or not available
+	 */
+	public abstract String getDisplayCountry(String code, Locale locale);
+
+	/**
+	 * Gets the localized name for the specified variant code and the specified
+	 * locale to display.
+	 * 
+	 * @param code
+	 *            the variant code
+	 * @param locale
+	 *            the locale
+	 * @return the name or null if unavailable
+	 * @throws NullPointerException
+	 *             if variant code or locale is null
+	 * @throws IllegalArgumentException
+	 *             if locale is not available
+	 */
+	public abstract String getDisplayVariant(String variant, Locale locale);
+}

Added: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/LocaleServiceProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/LocaleServiceProvider.java?view=auto&rev=546390
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/LocaleServiceProvider.java
(added)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/LocaleServiceProvider.java
Mon Jun 11 23:19:18 2007
@@ -0,0 +1,44 @@
+/*
+ *  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.util.spi;
+
+import java.util.Locale;
+
+/**
+ * The base class for all the locale related service provider interfaces (SPIs).
+ * 
+ * @since 1.6
+ */
+public abstract class LocaleServiceProvider {
+	/**
+	 * The constructor
+	 * 
+	 */
+	protected LocaleServiceProvider() {
+		// do nothing
+	}
+
+	/**
+	 * Gets all available locales that has localized objects or names from this
+	 * locale service provider.
+	 * 
+	 * @return all available locales that has localized objects or names from
+	 *         this locale service provider
+	 */
+	public abstract Locale[] getAvailableLocales();
+}

Added: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/TimeZoneNameProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/TimeZoneNameProvider.java?view=auto&rev=546390
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/TimeZoneNameProvider.java
(added)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/spi/TimeZoneNameProvider.java
Mon Jun 11 23:19:18 2007
@@ -0,0 +1,59 @@
+/*
+ *  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.util.spi;
+
+import java.util.Locale;
+
+/**
+ * TimeZoneNameProvider is an abstract class to get localized time zone names
+ * from service providers.
+ * 
+ * @since 1.6
+ * 
+ */
+public abstract class TimeZoneNameProvider extends LocaleServiceProvider {
+
+	/**
+	 * The constructor
+	 * 
+	 */
+	protected TimeZoneNameProvider() {
+		// do nothing
+	}
+
+	/**
+	 * Gets the name of the specified time zone ID that's suitable to display to
+	 * the user.
+	 * 
+	 * @param id
+	 *            id of time zone
+	 * @param daylight
+	 *            true to return the daylight saving time.
+	 * @param style
+	 *            TimeZone.LONG or TimeZone.SHORT
+	 * @param locale
+	 *            the locale
+	 * @return the readable time zone name, or null if it is unavailable
+	 * @throws NullPointerException
+	 *             if id or locale is null
+	 * @throws IllegalArgumentException
+	 *             if locale is not available or style is invalid
+	 */
+	public abstract String getDisplayName(String id, boolean daylight,
+			int style, Locale locale);
+}



Mime
View raw message