Codota Logo
WeightedLanguage.getLocale
Code IndexAdd Codota to your IDE (free)

How to use
getLocale
method
in
org.jboss.resteasy.util.WeightedLanguage

Best Java code snippets using org.jboss.resteasy.util.WeightedLanguage.getLocale (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: resteasy/Resteasy

@Override
public List<Locale> getAcceptableLanguages()
{
 List<String> vals = requestHeaders.get(ACCEPT_LANGUAGE);
 if (vals == null || vals.isEmpty()) {
   return Collections.emptyList();
 }
 List<WeightedLanguage> languages = new ArrayList<WeightedLanguage>();
 for (String v : vals) {
   StringTokenizer tokenizer = new StringTokenizer(v, ",");
   while (tokenizer.hasMoreElements()) {
    String item = tokenizer.nextToken().trim();
    languages.add(WeightedLanguage.parse(item));
   }
 }
 Collections.sort(languages);
 List<Locale> list = new ArrayList<Locale>(languages.size());
 for (WeightedLanguage language : languages) list.add(language.getLocale());
 return Collections.unmodifiableList(list);
}
origin: resteasy/Resteasy

public List<Locale> getAcceptableLanguages()
{
 List<Locale> list = new ArrayList<Locale>();
 List accepts = headers.get(HttpHeaders.ACCEPT_LANGUAGE);
 if (accepts == null) return list;
 List<WeightedLanguage> languages = new ArrayList<WeightedLanguage>();
 for (Object obj : accepts)
 {
   if (obj instanceof Locale)
   {
    languages.add(new WeightedLanguage((Locale)obj, 1.0F));
    continue;
   }
   String accept = configuration.toHeaderString(obj);
   StringTokenizer tokenizer = new StringTokenizer(accept, ",");
   while (tokenizer.hasMoreElements())
   {
    String item = tokenizer.nextToken().trim();
    languages.add(WeightedLanguage.parse(item));
   }
 }
 Collections.sort(languages);
 for (WeightedLanguage language : languages) list.add(language.getLocale());
 return list;
}
origin: org.jboss.resteasy/resteasy-core

@Override
public List<Locale> getAcceptableLanguages()
{
 List<String> vals = requestHeaders.get(ACCEPT_LANGUAGE);
 if (vals == null || vals.isEmpty()) {
   return Collections.emptyList();
 }
 List<WeightedLanguage> languages = new ArrayList<WeightedLanguage>();
 for (String v : vals) {
   StringTokenizer tokenizer = new StringTokenizer(v, ",");
   while (tokenizer.hasMoreElements()) {
    String item = tokenizer.nextToken().trim();
    languages.add(WeightedLanguage.parse(item));
   }
 }
 Collections.sort(languages);
 List<Locale> list = new ArrayList<Locale>(languages.size());
 for (WeightedLanguage language : languages) list.add(language.getLocale());
 return Collections.unmodifiableList(list);
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

@Override
public List<Locale> getAcceptableLanguages()
{
 String accepts = getHeaderString(ACCEPT_LANGUAGE);
 if (accepts == null) return Collections.emptyList();
 List<Locale> list = new ArrayList<Locale>();
 List<WeightedLanguage> languages = new ArrayList<WeightedLanguage>();
 StringTokenizer tokenizer = new StringTokenizer(accepts, ",");
 while (tokenizer.hasMoreElements())
 {
   String item = tokenizer.nextToken().trim();
   languages.add(WeightedLanguage.parse(item));
 }
 Collections.sort(languages);
 for (WeightedLanguage language : languages) list.add(language.getLocale());
 return Collections.unmodifiableList(list);
}

origin: org.jboss.resteasy/resteasy-client

public List<Locale> getAcceptableLanguages()
{
 List<Locale> list = new ArrayList<Locale>();
 List accepts = headers.get(HttpHeaders.ACCEPT_LANGUAGE);
 if (accepts == null) return list;
 List<WeightedLanguage> languages = new ArrayList<WeightedLanguage>();
 for (Object obj : accepts)
 {
   if (obj instanceof Locale)
   {
    languages.add(new WeightedLanguage((Locale)obj, 1.0F));
    continue;
   }
   String accept = configuration.toHeaderString(obj);
   StringTokenizer tokenizer = new StringTokenizer(accept, ",");
   while (tokenizer.hasMoreElements())
   {
    String item = tokenizer.nextToken().trim();
    languages.add(WeightedLanguage.parse(item));
   }
 }
 Collections.sort(languages);
 for (WeightedLanguage language : languages) list.add(language.getLocale());
 return list;
}
origin: org.jboss.resteasy/resteasy-client-20

public List<Locale> getAcceptableLanguages()
{
 List<Locale> list = new ArrayList<Locale>();
 List accepts = headers.get(HttpHeaders.ACCEPT_LANGUAGE);
 if (accepts == null) return list;
 List<WeightedLanguage> languages = new ArrayList<WeightedLanguage>();
 for (Object obj : accepts)
 {
   if (obj instanceof Locale)
   {
    languages.add(new WeightedLanguage((Locale)obj, 1.0F));
    continue;
   }
   String accept = configuration.toHeaderString(obj);
   StringTokenizer tokenizer = new StringTokenizer(accept, ",");
   while (tokenizer.hasMoreElements())
   {
    String item = tokenizer.nextToken().trim();
    languages.add(WeightedLanguage.parse(item));
   }
 }
 Collections.sort(languages);
 for (WeightedLanguage language : languages) list.add(language.getLocale());
 return list;
}
org.jboss.resteasy.utilWeightedLanguagegetLocale

Popular methods of WeightedLanguage

  • <init>
  • parse
  • getQWithParamInfo
  • toString

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now