Skip navigation links

Oracle® Ultra Search Java API Reference
11g Release 1 (11.1)

B28329-02


oracle.ultrasearch.query
Class Util

java.lang.Object
  extended by oracle.ultrasearch.query.Util


public class Util
extends java.lang.Object

Utility class for some useful methods.

Since:
9.0.2

Constructor Summary
Util()
           

 

Method Summary
static java.util.Locale getBestLocale(java.util.Locale neededLocale, java.util.Set candidateSet, java.util.Locale defaultLocale, java.util.Locale lastResort)
          Calculate the best locale for from a set of candidate locales.
static java.util.List getLocaleFallbacks(java.util.Locale orig, java.util.Locale def)
          Calculate the search path from a specific locale (orig) to its parent locales, then to the default locale (def), and finally to the default locale's parent locales.
static java.lang.String getVersion()
          Get the version of the Java Query API.
static java.lang.String htmlEncode(java.lang.String input)
          Utility method to apply HTML encoding to a specified string.
static java.util.Locale parseLocale(java.lang.String localeString)
          Utility method parse a string into an java.util.Locale object
static java.util.Locale parseLocale(java.lang.String localeString, char separator)
          Utility method parse a string into an java.util.Locale object

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Util

public Util()

Method Detail

getVersion

public static java.lang.String getVersion()
Get the version of the Java Query API.
Returns:
a version string in the format of '#.#.#'

htmlEncode

public static java.lang.String htmlEncode(java.lang.String input)
Utility method to apply HTML encoding to a specified string.

This method encodes the input string by performing the following substitutions:

Parameters:
input - The input string to convert.
Returns:
the HTML encoded version of the input string.

parseLocale

public static java.util.Locale parseLocale(java.lang.String localeString)
                                    throws java.text.ParseException
Utility method parse a string into an java.util.Locale object

the format of the string should be consistent with the output of java.util.Locale's toString() method.

same as calling parseLocale (localeString, '_').

Parameters:
localeString - The input string to parse.
Returns:
a java.util.Locale object
Throws:
java.text.ParseException
Since:
9.0.3.2

parseLocale

public static java.util.Locale parseLocale(java.lang.String localeString,
                                           char separator)
                                    throws java.text.ParseException
Utility method parse a string into an java.util.Locale object

the format of the string should be consistent with the output of java.util.Locale's toString() method, although the separator can be character other than underscore.

same as calling parseLocale (localeString, '_').

Parameters:
localeString - The input string to parse.
Returns:
a java.util.Locale object
Throws:
java.text.ParseException
Since:
9.0.3.2

getBestLocale

public static java.util.Locale getBestLocale(java.util.Locale neededLocale,
                                             java.util.Set candidateSet,
                                             java.util.Locale defaultLocale,
                                             java.util.Locale lastResort)
Calculate the best locale for from a set of candidate locales. If neededLocale is in the candidateSet, then it is chosen. Otherwise, a list of fallbacks is generated based on the neededLocale and the system default locale (via call to getLocaleFallbacks()). Each fallback is checked against the candidateSet. If found, the fallback is returned. Finally, the lastResort is returned as the best locale.

getLocaleFallbacks

public static java.util.List getLocaleFallbacks(java.util.Locale orig,
                                                java.util.Locale def)
Calculate the search path from a specific locale (orig) to its parent locales, then to the default locale (def), and finally to the default locale's parent locales.
Parameters:
locale - the locale, null allowed
def - the default locale, usually from Locale.getDefault(), null allowed
Returns:
list of Locale objects, not null

Skip navigation links

Oracle® Ultra Search Java API Reference
11g Release 1 (11.1)

B28329-02


Copyright © 2002,2008, Oracle. All Rights Reserved.