/** * Writes a string formatted by an intermediate {@link Formatter} to this * stream using the specified locale, format string and arguments. * * @param l * the locale used in the method. No localization will be applied * if {@code l} is {@code null}. * @param format * the format string used for {@link java.util.Formatter#format}. * @param args * the list of arguments passed to the formatter. If there are * more arguments than required by the {@code format} string, * then the additional arguments are ignored. * @return this stream. * @throws IllegalFormatException * if the format string is illegal or incompatible with the * arguments, if there are not enough arguments or if any other * error regarding the format string or arguments is detected. * @throws NullPointerException * if {@code format} is {@code null}. */ public PrintStream format(java.util.Locale l, String format, params Object[] args) { if (format == null) { throw new java.lang.NullPointerException("format is null"); //$NON-NLS-1$ } new java.util.Formatter(this, l).format(format, args); return(this); }
/* * Writes a string formatted by an intermediate {@code Formatter} to the * target using the specified locale, format string and arguments. If * automatic flushing is enabled then this writer is flushed. * * @param l * the locale used in the method. No localization will be applied * if {@code l} is {@code null}. * @param format * the format string used for {@link java.util.Formatter#format}. * @param args * the list of arguments passed to the formatter. If there are * more arguments than required by the {@code format} string, * then the additional arguments are ignored. * @return this writer. * @throws IllegalFormatException * if the format string is illegal or incompatible with the * arguments, if there are not enough arguments or if any other * error regarding the format string or arguments is detected. * @throws NullPointerException * if {@code format} is {@code null}. */ public virtual PrintWriter format(java.util.Locale l, String formatS, params Object[] args) { if (formatS == null) { throw new java.lang.NullPointerException("format is null"); //$NON-NLS-1$ } throw new java.lang.UnsupportedOperationException("java.util.Formatter is not yet implemented"); /* * new java.util.Formatter(this, l).format(formatS, args); * if (autoflush) { * flush(); * } * return this; */ }
public static ComponentOrientation getOrientation(java.util.ResourceBundle bdl) { Object obj = null; try { obj = bdl.getObject("Orientation"); //$NON-NLS-1$ } catch (java.util.MissingResourceException mre) { obj = null; } if (obj is ComponentOrientation) { return((ComponentOrientation)obj); } java.util.Locale locale = bdl.getLocale(); if (locale == null) { locale = java.util.Locale.getDefault(); } return(getOrientation(locale)); }
public static ComponentOrientation getOrientation(java.util.Locale locale) { String lang = locale.getLanguage(); return(rlLangs.contains(lang) ? RIGHT_TO_LEFT : LEFT_TO_RIGHT); }
/* * Gets the name of this charset for the specified locale. * * <p>The default implementation returns the canonical name of this charset. * Subclasses may return a localized display name. * * @param l * a certain locale * @return the name of this charset for the specified locale */ public virtual String displayName(java.util.Locale l) { return(this.canonicalName); }
public static String toUpperCase(this String str, java.util.Locale locale) { return(str.ToUpper(locale.delegateInstance)); }
/** * <p/>Convert this <code>XMLGregorianCalendar</code> along with provided parameters * to a {@link GregorianCalendar} instance. * * <p/> Since XML Schema 1.0 date/time datetypes has no concept of * timezone ids or daylight savings timezone ids, this conversion operation * allows the user to explicitly specify one with * <code>timezone</code> parameter. * * <p/>To compute the return value's <code>TimeZone</code> field, * <ul> * <li>when parameter <code>timeZone</code> is non-null, * it is the timezone field.</li> * <li>else when <code>this.getTimezone() != FIELD_UNDEFINED</code>, * create a <code>java.util.TimeZone</code> with a custom timezone id * using the <code>this.getTimezone()</code>.</li> * <li>else when <code>defaults.getTimezone() != FIELD_UNDEFINED</code>, * create a <code>java.util.TimeZone</code> with a custom timezone id * using <code>defaults.getTimezone()</code>.</li> * <li>else use the <code>GregorianCalendar</code> default timezone value * for the host is defined as specified by * <code>java.util.TimeZone.getDefault()</code>.</li></ul> * * <p/>To ensure consistency in conversion implementations, the new * <code>GregorianCalendar</code> should be instantiated in following * manner. * <ul> * <li>Create a new <code>java.util.GregorianCalendar(TimeZone, * Locale)</code> with TimeZone set as specified above and the * <code>Locale</code> parameter. * </li> * <li>Initialize all GregorianCalendar fields by calling {@link GregorianCalendar#clear()}</li> * <li>Obtain a pure Gregorian Calendar by invoking * <code>GregorianCalendar.setGregorianChange( * new Date(Long.MIN_VALUE))</code>.</li> * <li>Its fields ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY, * MINUTE, SECOND and MILLISECOND are set using the method * <code>Calendar.set(int,int)</code></li> * </ul> * * @param timezone provide Timezone. <code>null</code> is a legal value. * @param aLocale provide explicit Locale. Use default GregorianCalendar locale if * value is <code>null</code>. * @param defaults provide default field values to use when corresponding * field for this instance is FIELD_UNDEFINED or null. * If <code>defaults</code>is <code>null</code> or a field * within the specified <code>defaults</code> is undefined, * just use <code>java.util.GregorianCalendar</code> defaults. * @return a java.util.GregorianCalendar conversion of this instance. */ public abstract java.util.GregorianCalendar toGregorianCalendar( java.util.TimeZone timezone, java.util.Locale aLocale, XMLGregorianCalendar defaults);
//////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.Parser. //////////////////////////////////////////////////////////////////// /** * Set the locale for error reporting. * * <p>This is not supported in SAX2, and will always throw * an exception.</p> * * @param locale the locale for error reporting. * @see org.xml.sax.Parser#setLocale * @exception org.xml.sax.SAXException Thrown unless overridden. */ public void setLocale(java.util.Locale locale) //throws SAXException { throw new SAXNotSupportedException("setLocale not supported"); }
/** * Prints a formatted string. The behavior of this method is the same as * this stream's {@code #format(Locale, String, Object...)} method. * * @param l * the locale used in the method. No localization will be applied * if {@code l} is {@code null}. * @param format * the format string used for {@link java.util.Formatter#format}. * @param args * the list of arguments passed to the formatter. If there are * more arguments than required by the {@code format} string, * then the additional arguments are ignored. * @return this stream. * @throws IllegalFormatException * if the format string is illegal or incompatible with the * arguments, if there are not enough arguments or if any other * error regarding the format string or arguments is detected. * @throws NullPointerException * if {@code format} is {@code null}. */ public PrintStream printf(java.util.Locale l, String format, params Object[] args) { return(this.format(l, format, args)); }
/** * Get an instance of <code>NumberFormat</code> class which formats * percentage values for the given locale. * * @param locale * the specified locale * @return an instance of <code>NumberFormat</code> class * @throws NullPointerException, * if locale is null * @throws IllegalArgumentException, * if locale isn't one of the locales returned from * getAvailableLocales(). */ public abstract NumberFormat getPercentInstance(java.util.Locale locale);
/** * Get an instance of <code>NumberFormat</code> 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 <code>NumberFormat</code> class * @throws NullPointerException, * if locale is null * @throws IllegalArgumentException, * if locale isn't one of the locales returned from * getAvailableLocales(). */ public abstract NumberFormat getIntegerInstance(java.util.Locale locale);
/** * Get an instance of <code>NumberFormat</code> class which formats * monetary values for the given locale. * * @param locale * the specified locale * @return an instance of <code>NumberFormat</code> class * @throws NullPointerException, * if locale is null * @throws IllegalArgumentException, * if locale isn't one of the locales returned from * getAvailableLocales(). */ public abstract NumberFormat getCurrencyInstance(java.util.Locale locale);
/* * Prints a formatted string. The behavior of this method is the same as * this writer's {@code #format(Locale, String, Object...)} method. * * @param l * the locale used in the method. No localization will be applied * if {@code l} is {@code null}. * @param format * the format string used for {@link java.util.Formatter#format}. * @param args * the list of arguments passed to the formatter. If there are * more arguments than required by the {@code format} string, * then the additional arguments are ignored. * @return this writer. * @throws IllegalFormatException * if the format string is illegal or incompatible with the * arguments, if there are not enough arguments or if any other * error regarding the format string or arguments is detected. * @throws NullPointerException * if {@code format} is {@code null}. */ public virtual PrintWriter printf(java.util.Locale l, String formatS, params Object[] args) { return(format(l, formatS, args)); }
internal Formatter(java.lang.Appendable a, java.util.Locale l) { throw new java.lang.UnsupportedOperationException(); }