commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r883363 [31/48] - in /websites/production/commons/content/proper/commons-lang: ./ apidocs/ apidocs/org/apache/commons/lang3/ apidocs/org/apache/commons/lang3/builder/ apidocs/org/apache/commons/lang3/builder/class-use/ apidocs/org/apache/co...
Date Sat, 19 Oct 2013 17:17:59 GMT
Modified: websites/production/commons/content/proper/commons-lang/testapidocs/src-html/org/apache/commons/lang3/text/ExtendedMessageFormatTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-lang/testapidocs/src-html/org/apache/commons/lang3/text/ExtendedMessageFormatTest.html
(original)
+++ websites/production/commons/content/proper/commons-lang/testapidocs/src-html/org/apache/commons/lang3/text/ExtendedMessageFormatTest.html
Sat Oct 19 17:17:55 2013
@@ -45,7 +45,7 @@
 <FONT color="green">042</FONT>     * Test case for {@link ExtendedMessageFormat}.<a
name="line.42"></a>
 <FONT color="green">043</FONT>     *<a name="line.43"></a>
 <FONT color="green">044</FONT>     * @since 2.4<a name="line.44"></a>
-<FONT color="green">045</FONT>     * @version $Id: ExtendedMessageFormatTest.java
1436770 2013-01-22 07:09:45Z ggregory $<a name="line.45"></a>
+<FONT color="green">045</FONT>     * @version $Id: ExtendedMessageFormatTest.java
1533566 2013-10-18 17:21:23Z sebb $<a name="line.45"></a>
 <FONT color="green">046</FONT>     */<a name="line.46"></a>
 <FONT color="green">047</FONT>    public class ExtendedMessageFormatTest {<a
name="line.47"></a>
 <FONT color="green">048</FONT>    <a name="line.48"></a>
@@ -231,21 +231,21 @@
 <FONT color="green">228</FONT>            cal.set(2007, Calendar.JANUARY, 23);<a
name="line.228"></a>
 <FONT color="green">229</FONT>            final Object[] args = new Object[]
{cal.getTime()};<a name="line.229"></a>
 <FONT color="green">230</FONT>            final Locale[] availableLocales = DateFormat.getAvailableLocales();<a
name="line.230"></a>
-<FONT color="green">231</FONT>            final Map&lt;String, ? extends
FormatFactory&gt; registry = Collections.singletonMap("date", new OverrideShortDateFormatFactory());<a
name="line.231"></a>
+<FONT color="green">231</FONT>            final Map&lt;String, ? extends
FormatFactory&gt; dateRegistry = Collections.singletonMap("date", new OverrideShortDateFormatFactory());<a
name="line.231"></a>
 <FONT color="green">232</FONT>    <a name="line.232"></a>
 <FONT color="green">233</FONT>            //check the non-overridden builtins:<a
name="line.233"></a>
-<FONT color="green">234</FONT>            checkBuiltInFormat("1: {0,date}", registry,
         args, availableLocales);<a name="line.234"></a>
-<FONT color="green">235</FONT>            checkBuiltInFormat("2: {0,date,medium}",
registry,   args, availableLocales);<a name="line.235"></a>
-<FONT color="green">236</FONT>            checkBuiltInFormat("3: {0,date,long}",
registry,     args, availableLocales);<a name="line.236"></a>
-<FONT color="green">237</FONT>            checkBuiltInFormat("4: {0,date,full}",
registry,     args, availableLocales);<a name="line.237"></a>
-<FONT color="green">238</FONT>            checkBuiltInFormat("5: {0,date,d MMM
yy}", registry, args, availableLocales);<a name="line.238"></a>
+<FONT color="green">234</FONT>            checkBuiltInFormat("1: {0,date}", dateRegistry,
         args, availableLocales);<a name="line.234"></a>
+<FONT color="green">235</FONT>            checkBuiltInFormat("2: {0,date,medium}",
dateRegistry,   args, availableLocales);<a name="line.235"></a>
+<FONT color="green">236</FONT>            checkBuiltInFormat("3: {0,date,long}",
dateRegistry,     args, availableLocales);<a name="line.236"></a>
+<FONT color="green">237</FONT>            checkBuiltInFormat("4: {0,date,full}",
dateRegistry,     args, availableLocales);<a name="line.237"></a>
+<FONT color="green">238</FONT>            checkBuiltInFormat("5: {0,date,d MMM
yy}", dateRegistry, args, availableLocales);<a name="line.238"></a>
 <FONT color="green">239</FONT>    <a name="line.239"></a>
 <FONT color="green">240</FONT>            //check the overridden format:<a
name="line.240"></a>
 <FONT color="green">241</FONT>            for (int i = -1; i &lt; availableLocales.length;
i++) {<a name="line.241"></a>
 <FONT color="green">242</FONT>                final Locale locale = i &lt;
0 ? null : availableLocales[i];<a name="line.242"></a>
 <FONT color="green">243</FONT>                final MessageFormat dateDefault
= createMessageFormat("{0,date}", locale);<a name="line.243"></a>
 <FONT color="green">244</FONT>                final String pattern = "{0,date,short}";<a
name="line.244"></a>
-<FONT color="green">245</FONT>                final ExtendedMessageFormat dateShort
= new ExtendedMessageFormat(pattern, locale, registry);<a name="line.245"></a>
+<FONT color="green">245</FONT>                final ExtendedMessageFormat dateShort
= new ExtendedMessageFormat(pattern, locale, dateRegistry);<a name="line.245"></a>
 <FONT color="green">246</FONT>                assertEquals("overridden date,short
format", dateDefault.format(args), dateShort.format(args));<a name="line.246"></a>
 <FONT color="green">247</FONT>                assertEquals("overridden date,short
pattern", pattern, dateShort.toPattern());<a name="line.247"></a>
 <FONT color="green">248</FONT>            }<a name="line.248"></a>
@@ -270,11 +270,11 @@
 <FONT color="green">267</FONT>         */<a name="line.267"></a>
 <FONT color="green">268</FONT>        @Test<a name="line.268"></a>
 <FONT color="green">269</FONT>        public void testEqualsHashcode() {<a
name="line.269"></a>
-<FONT color="green">270</FONT>            final Map&lt;String, ? extends
FormatFactory&gt; registry = Collections.singletonMap("testfmt", new LowerCaseFormatFactory());<a
name="line.270"></a>
+<FONT color="green">270</FONT>            final Map&lt;String, ? extends
FormatFactory&gt; fmtRegistry = Collections.singletonMap("testfmt", new LowerCaseFormatFactory());<a
name="line.270"></a>
 <FONT color="green">271</FONT>            final Map&lt;String, ? extends
FormatFactory&gt; otherRegitry = Collections.singletonMap("testfmt", new UpperCaseFormatFactory());<a
name="line.271"></a>
 <FONT color="green">272</FONT>    <a name="line.272"></a>
 <FONT color="green">273</FONT>            final String pattern = "Pattern: {0,testfmt}";<a
name="line.273"></a>
-<FONT color="green">274</FONT>            final ExtendedMessageFormat emf = new
ExtendedMessageFormat(pattern, Locale.US, registry);<a name="line.274"></a>
+<FONT color="green">274</FONT>            final ExtendedMessageFormat emf = new
ExtendedMessageFormat(pattern, Locale.US, fmtRegistry);<a name="line.274"></a>
 <FONT color="green">275</FONT>    <a name="line.275"></a>
 <FONT color="green">276</FONT>            ExtendedMessageFormat other = null;<a
name="line.276"></a>
 <FONT color="green">277</FONT>    <a name="line.277"></a>
@@ -283,17 +283,17 @@
 <FONT color="green">280</FONT>            assertTrue("same, hashcode()", emf.hashCode()
== emf.hashCode());<a name="line.280"></a>
 <FONT color="green">281</FONT>    <a name="line.281"></a>
 <FONT color="green">282</FONT>            // Equal Object<a name="line.282"></a>
-<FONT color="green">283</FONT>            other = new ExtendedMessageFormat(pattern,
Locale.US, registry);<a name="line.283"></a>
+<FONT color="green">283</FONT>            other = new ExtendedMessageFormat(pattern,
Locale.US, fmtRegistry);<a name="line.283"></a>
 <FONT color="green">284</FONT>            assertTrue("equal, equals()",   emf.equals(other));<a
name="line.284"></a>
 <FONT color="green">285</FONT>            assertTrue("equal, hashcode()", emf.hashCode()
== other.hashCode());<a name="line.285"></a>
 <FONT color="green">286</FONT>    <a name="line.286"></a>
 <FONT color="green">287</FONT>            // Different Class<a name="line.287"></a>
-<FONT color="green">288</FONT>            other = new OtherExtendedMessageFormat(pattern,
Locale.US, registry);<a name="line.288"></a>
+<FONT color="green">288</FONT>            other = new OtherExtendedMessageFormat(pattern,
Locale.US, fmtRegistry);<a name="line.288"></a>
 <FONT color="green">289</FONT>            assertFalse("class, equals()",  emf.equals(other));<a
name="line.289"></a>
 <FONT color="green">290</FONT>            assertTrue("class, hashcode()", emf.hashCode()
== other.hashCode()); // same hashcode<a name="line.290"></a>
 <FONT color="green">291</FONT>            <a name="line.291"></a>
 <FONT color="green">292</FONT>            // Different pattern<a name="line.292"></a>
-<FONT color="green">293</FONT>            other = new ExtendedMessageFormat("X"
+ pattern, Locale.US, registry);<a name="line.293"></a>
+<FONT color="green">293</FONT>            other = new ExtendedMessageFormat("X"
+ pattern, Locale.US, fmtRegistry);<a name="line.293"></a>
 <FONT color="green">294</FONT>            assertFalse("pattern, equals()",  
emf.equals(other));<a name="line.294"></a>
 <FONT color="green">295</FONT>            assertFalse("pattern, hashcode()",
emf.hashCode() == other.hashCode());<a name="line.295"></a>
 <FONT color="green">296</FONT>    <a name="line.296"></a>
@@ -303,7 +303,7 @@
 <FONT color="green">300</FONT>            assertFalse("registry, hashcode()",
emf.hashCode() == other.hashCode());<a name="line.300"></a>
 <FONT color="green">301</FONT>    <a name="line.301"></a>
 <FONT color="green">302</FONT>            // Different Locale<a name="line.302"></a>
-<FONT color="green">303</FONT>            other = new ExtendedMessageFormat(pattern,
Locale.FRANCE, registry);<a name="line.303"></a>
+<FONT color="green">303</FONT>            other = new ExtendedMessageFormat(pattern,
Locale.FRANCE, fmtRegistry);<a name="line.303"></a>
 <FONT color="green">304</FONT>            assertFalse("locale, equals()",  emf.equals(other));<a
name="line.304"></a>
 <FONT color="green">305</FONT>            assertTrue("locale, hashcode()", emf.hashCode()
== other.hashCode()); // same hashcode<a name="line.305"></a>
 <FONT color="green">306</FONT>        }<a name="line.306"></a>
@@ -321,14 +321,14 @@
 <FONT color="green">318</FONT>        /**<a name="line.318"></a>
 <FONT color="green">319</FONT>         * Test a built in format for the specified
Locales, plus &lt;code&gt;null&lt;/code&gt; Locale.<a name="line.319"></a>
 <FONT color="green">320</FONT>         * @param pattern MessageFormat pattern<a
name="line.320"></a>
-<FONT color="green">321</FONT>         * @param registry FormatFactory registry
to use<a name="line.321"></a>
+<FONT color="green">321</FONT>         * @param fmtRegistry FormatFactory registry
to use<a name="line.321"></a>
 <FONT color="green">322</FONT>         * @param args MessageFormat arguments<a
name="line.322"></a>
 <FONT color="green">323</FONT>         * @param locales to test<a name="line.323"></a>
 <FONT color="green">324</FONT>         */<a name="line.324"></a>
-<FONT color="green">325</FONT>        private void checkBuiltInFormat(final String
pattern, final Map&lt;String, ?&gt; registry, final Object[] args, final Locale[]
locales) {<a name="line.325"></a>
-<FONT color="green">326</FONT>            checkBuiltInFormat(pattern, registry,
args, (Locale) null);<a name="line.326"></a>
+<FONT color="green">325</FONT>        private void checkBuiltInFormat(final String
pattern, final Map&lt;String, ?&gt; fmtRegistry, final Object[] args, final Locale[]
locales) {<a name="line.325"></a>
+<FONT color="green">326</FONT>            checkBuiltInFormat(pattern, fmtRegistry,
args, (Locale) null);<a name="line.326"></a>
 <FONT color="green">327</FONT>            for (final Locale locale : locales)
{<a name="line.327"></a>
-<FONT color="green">328</FONT>                checkBuiltInFormat(pattern, registry,
args, locale);<a name="line.328"></a>
+<FONT color="green">328</FONT>                checkBuiltInFormat(pattern, fmtRegistry,
args, locale);<a name="line.328"></a>
 <FONT color="green">329</FONT>            }<a name="line.329"></a>
 <FONT color="green">330</FONT>        }<a name="line.330"></a>
 <FONT color="green">331</FONT>    <a name="line.331"></a>
@@ -336,11 +336,11 @@
 <FONT color="green">333</FONT>         * Create an ExtendedMessageFormat for
the specified pattern and locale and check the<a name="line.333"></a>
 <FONT color="green">334</FONT>         * formated output matches the expected
result for the parameters.<a name="line.334"></a>
 <FONT color="green">335</FONT>         * @param pattern string<a name="line.335"></a>
-<FONT color="green">336</FONT>         * @param registry map<a name="line.336"></a>
+<FONT color="green">336</FONT>         * @param registryUnused map (currently
unused)<a name="line.336"></a>
 <FONT color="green">337</FONT>         * @param args Object[]<a name="line.337"></a>
 <FONT color="green">338</FONT>         * @param locale Locale<a name="line.338"></a>
 <FONT color="green">339</FONT>         */<a name="line.339"></a>
-<FONT color="green">340</FONT>        private void checkBuiltInFormat(final String
pattern, final Map&lt;String, ?&gt; registry, final Object[] args, final Locale locale)
{<a name="line.340"></a>
+<FONT color="green">340</FONT>        private void checkBuiltInFormat(final String
pattern, final Map&lt;String, ?&gt; registryUnused, final Object[] args, final Locale
locale) {<a name="line.340"></a>
 <FONT color="green">341</FONT>            final StringBuilder buffer = new StringBuilder();<a
name="line.341"></a>
 <FONT color="green">342</FONT>            buffer.append("Pattern=[");<a name="line.342"></a>
 <FONT color="green">343</FONT>            buffer.append(pattern);<a name="line.343"></a>
@@ -387,73 +387,79 @@
 <FONT color="green">384</FONT>         * {@link Format} implementation which
converts to lower case.<a name="line.384"></a>
 <FONT color="green">385</FONT>         */<a name="line.385"></a>
 <FONT color="green">386</FONT>        private static class LowerCaseFormat extends
Format {<a name="line.386"></a>
-<FONT color="green">387</FONT>            @Override<a name="line.387"></a>
-<FONT color="green">388</FONT>            public StringBuffer format(final Object
obj, final StringBuffer toAppendTo, final FieldPosition pos) {<a name="line.388"></a>
-<FONT color="green">389</FONT>                return toAppendTo.append(((String)obj).toLowerCase());<a
name="line.389"></a>
-<FONT color="green">390</FONT>            }<a name="line.390"></a>
-<FONT color="green">391</FONT>            @Override<a name="line.391"></a>
-<FONT color="green">392</FONT>            public Object parseObject(final String
source, final ParsePosition pos) {throw new UnsupportedOperationException();}<a name="line.392"></a>
-<FONT color="green">393</FONT>        }<a name="line.393"></a>
-<FONT color="green">394</FONT>    <a name="line.394"></a>
-<FONT color="green">395</FONT>        /**<a name="line.395"></a>
-<FONT color="green">396</FONT>         * {@link Format} implementation which
converts to upper case.<a name="line.396"></a>
-<FONT color="green">397</FONT>         */<a name="line.397"></a>
-<FONT color="green">398</FONT>        private static class UpperCaseFormat extends
Format {<a name="line.398"></a>
-<FONT color="green">399</FONT>            @Override<a name="line.399"></a>
-<FONT color="green">400</FONT>            public StringBuffer format(final Object
obj, final StringBuffer toAppendTo, final FieldPosition pos) {<a name="line.400"></a>
-<FONT color="green">401</FONT>                return toAppendTo.append(((String)obj).toUpperCase());<a
name="line.401"></a>
-<FONT color="green">402</FONT>            }<a name="line.402"></a>
+<FONT color="green">387</FONT>                    private static final long serialVersionUID
= 1L;<a name="line.387"></a>
+<FONT color="green">388</FONT>    <a name="line.388"></a>
+<FONT color="green">389</FONT>            @Override<a name="line.389"></a>
+<FONT color="green">390</FONT>            public StringBuffer format(final Object
obj, final StringBuffer toAppendTo, final FieldPosition pos) {<a name="line.390"></a>
+<FONT color="green">391</FONT>                return toAppendTo.append(((String)obj).toLowerCase());<a
name="line.391"></a>
+<FONT color="green">392</FONT>            }<a name="line.392"></a>
+<FONT color="green">393</FONT>            @Override<a name="line.393"></a>
+<FONT color="green">394</FONT>            public Object parseObject(final String
source, final ParsePosition pos) {throw new UnsupportedOperationException();}<a name="line.394"></a>
+<FONT color="green">395</FONT>        }<a name="line.395"></a>
+<FONT color="green">396</FONT>    <a name="line.396"></a>
+<FONT color="green">397</FONT>        /**<a name="line.397"></a>
+<FONT color="green">398</FONT>         * {@link Format} implementation which
converts to upper case.<a name="line.398"></a>
+<FONT color="green">399</FONT>         */<a name="line.399"></a>
+<FONT color="green">400</FONT>        private static class UpperCaseFormat extends
Format {<a name="line.400"></a>
+<FONT color="green">401</FONT>                    private static final long serialVersionUID
= 1L;<a name="line.401"></a>
+<FONT color="green">402</FONT>    <a name="line.402"></a>
 <FONT color="green">403</FONT>            @Override<a name="line.403"></a>
-<FONT color="green">404</FONT>            public Object parseObject(final String
source, final ParsePosition pos) {throw new UnsupportedOperationException();}<a name="line.404"></a>
-<FONT color="green">405</FONT>        }<a name="line.405"></a>
-<FONT color="green">406</FONT>    <a name="line.406"></a>
-<FONT color="green">407</FONT>    <a name="line.407"></a>
-<FONT color="green">408</FONT>        // ------------------------ Test Format
Factories ---------------<a name="line.408"></a>
-<FONT color="green">409</FONT>        /**<a name="line.409"></a>
-<FONT color="green">410</FONT>         * {@link FormatFactory} implementation
for lower case format.<a name="line.410"></a>
-<FONT color="green">411</FONT>         */<a name="line.411"></a>
-<FONT color="green">412</FONT>        private static class LowerCaseFormatFactory
implements FormatFactory {<a name="line.412"></a>
-<FONT color="green">413</FONT>            private static final Format LOWER_INSTANCE
= new LowerCaseFormat();<a name="line.413"></a>
-<FONT color="green">414</FONT>            @Override<a name="line.414"></a>
-<FONT color="green">415</FONT>            public Format getFormat(final String
name, final String arguments, final Locale locale) {<a name="line.415"></a>
-<FONT color="green">416</FONT>                return LOWER_INSTANCE;<a name="line.416"></a>
-<FONT color="green">417</FONT>            }<a name="line.417"></a>
-<FONT color="green">418</FONT>        }<a name="line.418"></a>
-<FONT color="green">419</FONT>        /**<a name="line.419"></a>
-<FONT color="green">420</FONT>         * {@link FormatFactory} implementation
for upper case format.<a name="line.420"></a>
-<FONT color="green">421</FONT>         */<a name="line.421"></a>
-<FONT color="green">422</FONT>        private static class UpperCaseFormatFactory
implements FormatFactory {<a name="line.422"></a>
-<FONT color="green">423</FONT>            private static final Format UPPER_INSTANCE
= new UpperCaseFormat();<a name="line.423"></a>
-<FONT color="green">424</FONT>            @Override<a name="line.424"></a>
-<FONT color="green">425</FONT>            public Format getFormat(final String
name, final String arguments, final Locale locale) {<a name="line.425"></a>
-<FONT color="green">426</FONT>                return UPPER_INSTANCE;<a name="line.426"></a>
-<FONT color="green">427</FONT>            }<a name="line.427"></a>
-<FONT color="green">428</FONT>        }<a name="line.428"></a>
-<FONT color="green">429</FONT>        /**<a name="line.429"></a>
-<FONT color="green">430</FONT>         * {@link FormatFactory} implementation
to override date format "short" to "default".<a name="line.430"></a>
-<FONT color="green">431</FONT>         */<a name="line.431"></a>
-<FONT color="green">432</FONT>        private static class OverrideShortDateFormatFactory
implements FormatFactory {<a name="line.432"></a>
-<FONT color="green">433</FONT>            @Override<a name="line.433"></a>
-<FONT color="green">434</FONT>            public Format getFormat(final String
name, final String arguments, final Locale locale) {<a name="line.434"></a>
-<FONT color="green">435</FONT>                return !"short".equals(arguments)
? null<a name="line.435"></a>
-<FONT color="green">436</FONT>                        : locale == null ? DateFormat<a
name="line.436"></a>
-<FONT color="green">437</FONT>                                .getDateInstance(DateFormat.DEFAULT)
: DateFormat<a name="line.437"></a>
-<FONT color="green">438</FONT>                                .getDateInstance(DateFormat.DEFAULT,
locale);<a name="line.438"></a>
-<FONT color="green">439</FONT>            }<a name="line.439"></a>
-<FONT color="green">440</FONT>        }<a name="line.440"></a>
-<FONT color="green">441</FONT>    <a name="line.441"></a>
-<FONT color="green">442</FONT>        /**<a name="line.442"></a>
-<FONT color="green">443</FONT>         * Alternative ExtendedMessageFormat impl.<a
name="line.443"></a>
-<FONT color="green">444</FONT>         */<a name="line.444"></a>
-<FONT color="green">445</FONT>        private static class OtherExtendedMessageFormat
extends ExtendedMessageFormat {<a name="line.445"></a>
-<FONT color="green">446</FONT>            public OtherExtendedMessageFormat(final
String pattern, final Locale locale,<a name="line.446"></a>
-<FONT color="green">447</FONT>                    final Map&lt;String, ?
extends FormatFactory&gt; registry) {<a name="line.447"></a>
-<FONT color="green">448</FONT>                super(pattern, locale, registry);<a
name="line.448"></a>
-<FONT color="green">449</FONT>            }<a name="line.449"></a>
-<FONT color="green">450</FONT>            <a name="line.450"></a>
-<FONT color="green">451</FONT>        }<a name="line.451"></a>
-<FONT color="green">452</FONT>    <a name="line.452"></a>
-<FONT color="green">453</FONT>    }<a name="line.453"></a>
+<FONT color="green">404</FONT>            public StringBuffer format(final Object
obj, final StringBuffer toAppendTo, final FieldPosition pos) {<a name="line.404"></a>
+<FONT color="green">405</FONT>                return toAppendTo.append(((String)obj).toUpperCase());<a
name="line.405"></a>
+<FONT color="green">406</FONT>            }<a name="line.406"></a>
+<FONT color="green">407</FONT>            @Override<a name="line.407"></a>
+<FONT color="green">408</FONT>            public Object parseObject(final String
source, final ParsePosition pos) {throw new UnsupportedOperationException();}<a name="line.408"></a>
+<FONT color="green">409</FONT>        }<a name="line.409"></a>
+<FONT color="green">410</FONT>    <a name="line.410"></a>
+<FONT color="green">411</FONT>    <a name="line.411"></a>
+<FONT color="green">412</FONT>        // ------------------------ Test Format
Factories ---------------<a name="line.412"></a>
+<FONT color="green">413</FONT>        /**<a name="line.413"></a>
+<FONT color="green">414</FONT>         * {@link FormatFactory} implementation
for lower case format.<a name="line.414"></a>
+<FONT color="green">415</FONT>         */<a name="line.415"></a>
+<FONT color="green">416</FONT>        private static class LowerCaseFormatFactory
implements FormatFactory {<a name="line.416"></a>
+<FONT color="green">417</FONT>            private static final Format LOWER_INSTANCE
= new LowerCaseFormat();<a name="line.417"></a>
+<FONT color="green">418</FONT>            @Override<a name="line.418"></a>
+<FONT color="green">419</FONT>            public Format getFormat(final String
name, final String arguments, final Locale locale) {<a name="line.419"></a>
+<FONT color="green">420</FONT>                return LOWER_INSTANCE;<a name="line.420"></a>
+<FONT color="green">421</FONT>            }<a name="line.421"></a>
+<FONT color="green">422</FONT>        }<a name="line.422"></a>
+<FONT color="green">423</FONT>        /**<a name="line.423"></a>
+<FONT color="green">424</FONT>         * {@link FormatFactory} implementation
for upper case format.<a name="line.424"></a>
+<FONT color="green">425</FONT>         */<a name="line.425"></a>
+<FONT color="green">426</FONT>        private static class UpperCaseFormatFactory
implements FormatFactory {<a name="line.426"></a>
+<FONT color="green">427</FONT>            private static final Format UPPER_INSTANCE
= new UpperCaseFormat();<a name="line.427"></a>
+<FONT color="green">428</FONT>            @Override<a name="line.428"></a>
+<FONT color="green">429</FONT>            public Format getFormat(final String
name, final String arguments, final Locale locale) {<a name="line.429"></a>
+<FONT color="green">430</FONT>                return UPPER_INSTANCE;<a name="line.430"></a>
+<FONT color="green">431</FONT>            }<a name="line.431"></a>
+<FONT color="green">432</FONT>        }<a name="line.432"></a>
+<FONT color="green">433</FONT>        /**<a name="line.433"></a>
+<FONT color="green">434</FONT>         * {@link FormatFactory} implementation
to override date format "short" to "default".<a name="line.434"></a>
+<FONT color="green">435</FONT>         */<a name="line.435"></a>
+<FONT color="green">436</FONT>        private static class OverrideShortDateFormatFactory
implements FormatFactory {<a name="line.436"></a>
+<FONT color="green">437</FONT>            @Override<a name="line.437"></a>
+<FONT color="green">438</FONT>            public Format getFormat(final String
name, final String arguments, final Locale locale) {<a name="line.438"></a>
+<FONT color="green">439</FONT>                return !"short".equals(arguments)
? null<a name="line.439"></a>
+<FONT color="green">440</FONT>                        : locale == null ? DateFormat<a
name="line.440"></a>
+<FONT color="green">441</FONT>                                .getDateInstance(DateFormat.DEFAULT)
: DateFormat<a name="line.441"></a>
+<FONT color="green">442</FONT>                                .getDateInstance(DateFormat.DEFAULT,
locale);<a name="line.442"></a>
+<FONT color="green">443</FONT>            }<a name="line.443"></a>
+<FONT color="green">444</FONT>        }<a name="line.444"></a>
+<FONT color="green">445</FONT>    <a name="line.445"></a>
+<FONT color="green">446</FONT>        /**<a name="line.446"></a>
+<FONT color="green">447</FONT>         * Alternative ExtendedMessageFormat impl.<a
name="line.447"></a>
+<FONT color="green">448</FONT>         */<a name="line.448"></a>
+<FONT color="green">449</FONT>        private static class OtherExtendedMessageFormat
extends ExtendedMessageFormat {<a name="line.449"></a>
+<FONT color="green">450</FONT>                    private static final long serialVersionUID
= 1L;<a name="line.450"></a>
+<FONT color="green">451</FONT>    <a name="line.451"></a>
+<FONT color="green">452</FONT>            public OtherExtendedMessageFormat(final
String pattern, final Locale locale,<a name="line.452"></a>
+<FONT color="green">453</FONT>                    final Map&lt;String, ?
extends FormatFactory&gt; registry) {<a name="line.453"></a>
+<FONT color="green">454</FONT>                super(pattern, locale, registry);<a
name="line.454"></a>
+<FONT color="green">455</FONT>            }<a name="line.455"></a>
+<FONT color="green">456</FONT>            <a name="line.456"></a>
+<FONT color="green">457</FONT>        }<a name="line.457"></a>
+<FONT color="green">458</FONT>    <a name="line.458"></a>
+<FONT color="green">459</FONT>    }<a name="line.459"></a>
 
 
 



Mime
View raw message