Examples of ILocalized


Examples of org.apache.wookie.w3c.ILocalized

   * @param locales
   * @param defaultLocale the default locale in case none of the supplied locales provide a match
   * @return an ILocalizedElement, or null if there are no valid entries
   */ 
  public static ILocalized getLocalizedElement(ILocalized[] elements, String[] locales, String defaultLocale){
    ILocalized element =  getLocalizedElement(elements, locales);
    // If using the algorithm did not return ANY results, try again using defaultlocale
    if (element == null && elements != null){
      for(ILocalized elem:elements){
        if (elem.getLang().equals(defaultLocale)) return elem;
      }
View Full Code Here

Examples of org.apache.wookie.w3c.ILocalized

  }
 
  @Test
  public void nullTest5(){
    ILocalized[] elements = elements(LANG_LIST_11);
    ILocalized element = LocalizationUtils.getLocalizedElement(elements,null,null);
    assertEquals(null, element.getLang());
  }
View Full Code Here

Examples of org.apache.wookie.w3c.ILocalized

 
  @Test
  public void nullTest6(){
    try {
      ILocalized[] elements = null;
      ILocalized element = LocalizationUtils.getLocalizedElement(elements,null,null);
      assertNull(element);
    } catch (Exception e) {
      e.printStackTrace();
      fail();
    }
View Full Code Here

Examples of org.apache.wookie.w3c.ILocalized

  }
 
  @Test
  public void noMatch3(){
    ILocalized[] elements = elements(LANG_LIST_11);
    ILocalized element = LocalizationUtils.getLocalizedElement(elements, LANG_LIST_4,null);
    assertEquals(null,element.getLang());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.