エラーセルの値を評価する。
@param cell
@param locale
@return
772984
private CellFormatResult getErrorCellValue(final Cell cell, final Locale locale) {

        final CellType cellType = cell.getCellTypeEnum();
        assert cellType == CellType.ERROR;

        return getErrorCellValue(cell.getErrorCellValue(), locale);
    }
909771
private CellFormatResult getCellValue(final POICell poiCell, final Locale locale) {

        final short formatIndex = poiCell.getFormatIndex();
        final String formatPattern = poiCell.getFormatPattern();

        if(formatterResolver.canResolve(formatIndex)) {
            final CellFormatter cellFormatter = formatterResolver.getFormatter(formatIndex);
            return cellFormatter.format(poiCell, locale);

        } else if(formatterResolver.canResolve(formatPattern)) {
            final CellFormatter cellFormatter = formatterResolver.getFormatter(formatPattern);
            return cellFormatter.format(poiCell, locale);

        } else {
            // キャッシュに存在しない場合
            final CellFormatter cellFormatter = formatterResolver.createFormatter(formatPattern) ;
            if(isCache()) {
                formatterResolver.registerFormatter(formatPattern, cellFormatter);
            }
            return cellFormatter.format(poiCell, locale);

        }
    }
592560
public static List<Locale> getCandidateLocales(Locale locale) {

        String language = LanguageMatch.getAlias(locale);
        String country = FormatUtils.getRegion(locale);
        String variant = locale.getVariant();

        if (language.equals("zh") && locale.getScript().equals("Hant")) {
            country = "TW";
        }

        List<Locale> list = new LinkedList<>();

        if (!variant.isEmpty()) {
            list.add(new Locale(language, country, variant));
        }

        if (!country.isEmpty()) {
            list.add(new Locale(language, country, ""));
        }

        if (!language.isEmpty()) {
            list.add(new Locale(language, "", ""));
            if (language.equals("nn")) {
                list.add(new Locale("nb", "", ""));
            }
        }

        list.add(Locale.ROOT);
        return list;

    }
600953
public String formatAsString(final ObjectCell<?> cell, final Locale locale) {
        return format(cell, locale).getText();
    }
269117
private CellFormatResult getErrorCellValue(final byte errorValue, final Locale locale) {

       final FormulaError error = FormulaError.forInt(errorValue);
       final CellFormatResult result = new CellFormatResult();
       result.setCellType(FormatCellType.Error);
       result.setValue(error.getCode());

       if(isErrorCellAsEmpty()) {
           result.setText("");
       } else {
           result.setText(error.getString());
       }

       return result;

    }
1251392
private Object getCellValue(Cell cell) {
    Object value;

    // Empty cells are null, instead of BLANK
    if (cell == null) {
      return null;
    }

    switch (cell.getCellTypeEnum()) {
      case STRING:
        value = cell.getStringCellValue();
        break;
      case NUMERIC:
        if (isCellDateFormatted(cell)) {
          try {
            // Excel dates are LocalDateTime, stored without timezone.
            // Interpret them as UTC to prevent ambiguous DST overlaps which happen in other
            // timezones.
            setUserTimeZone(LocaleUtil.TIMEZONE_UTC);
            Date dateCellValue = cell.getDateCellValue();
            value = formatUTCDateAsLocalDateTime(dateCellValue);
          } finally {
            resetUserTimeZone();
          }
        } else {
          value = cell.getNumericCellValue();
        }
        break;
      case BOOLEAN:
        value = cell.getBooleanCellValue();
        break;
      case FORMULA:
        value = getTypedFormulaValue(cell);
        break;
      default:
        value = null;
        break;
    }
    return value;
  }
473604
private Locale getLocale(FacesContext context) {

        // PENDING(craigmcc) - JSTL localization context?
        Locale locale = this.locale;
        if (locale == null) {
            locale = context.getViewRoot().getLocale();
        }
        return (locale);

    }
170328
public CLDR.Locale fromJavaLocale(java.util.Locale javaLocale) {
    return MetaLocale.fromJavaLocale(javaLocale);
  }
1137
public static PrettyTimeFormat prettyTimeFormat(final Locale locale)
    {
        return withinLocale(new Callable<PrettyTimeFormat>()
        {
            public PrettyTimeFormat call() throws Exception
            {
                return context.get().getPrettyTimeFormat();
            }
        }, locale);
    }
540526
@Override
	public String retrieveLocale(String lang) {
		String r = locales.get(lang);
		if (r == null) {
			try {
				URL u = getClass().getResource("/locales-" + lang + ".xml");
				if (u == null) {
					throw new IllegalArgumentException("Unable to load locale " +
							lang + ". Make sure you have a file called " +
							"'/locales-" + lang + ".xml' at the root of your " +
							"classpath. Did you add the CSL locale files to "
							+ "your classpath?");
				}
				r = CSLUtils.readURLToString(u, "UTF-8");
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
			locales.put(lang, r);
		}
		return r;
	}
245268
public static Locale getLocaleFromString(String locale) throws LocaleException {
		for(Locale l : Locale.getAvailableLocales()) {
			if(locale.toLowerCase().equals(l.toString().toLowerCase())) {
				return l;
			}
		}
		throw new LocaleException();
	}
1176626
@Override
    public String getEncodingFromLocale(Locale locale) {
        if (null == locale) {
            return null;
        }
        if (locale.equals(this.cachedLocale)) {
            return this.cachedEncoding;
        }

        String encoding = localeMap.get(locale.toString());
        if (null == encoding) {
            final String lang = locale.getLanguage();
            encoding = localeMap.get(lang + '_' + locale.getCountry());
            if (null == encoding) {
                encoding = localeMap.get(lang);
            }
        }

        this.cachedEncoding = encoding;
        this.cachedLocale = locale;

        return encoding;
    }
720116
private CellFormatResult getMergedCellValue(final Cell cell, final Locale locale) {

        final Sheet sheet = cell.getSheet();
        final int size = sheet.getNumMergedRegions();

        for(int i=0; i < size; i++) {
            final CellRangeAddress range = sheet.getMergedRegion(i);
            if(!range.isInRange(cell.getRowIndex(), cell.getColumnIndex())) {
                continue;
            }

            // 非BLANKまたはnullでないセルを取得する。
            for(int rowIdx=range.getFirstRow(); rowIdx <= range.getLastRow(); rowIdx++) {
                final Row row = sheet.getRow(rowIdx);
                if(row == null) {
                    continue;
                }

                for(int colIdx=range.getFirstColumn(); colIdx <= range.getLastColumn(); colIdx++) {
                    final Cell valueCell = row.getCell(colIdx);
                    if(valueCell == null || valueCell.getCellTypeEnum() == CellType.BLANK) {
                        continue;
                    }

                    return format(valueCell, locale);
                }
            }

        }

        return createBlankCellResult();
    }
590286
public void setLocale(Locale locale) {
		for (int i = 0; i < 5; i++) {
			components[i].setLocale(locale);
		}
	}
474510
public Translation getWithFallBack(Locale locale) {
        Translation tr = get(locale.toString());
        if (tr == null) {
            tr = get(locale.getLanguage());
            if (tr == null)
                tr = get("en");
        }
        return tr;
    }
329320
public void removeTranslation(String locale) {
        LocaleCodeSpecification.assertCode(locale);

        Translation translation = getTranslation(locale);
        if (translation != null) {
            this.translations.remove(translation.getId());
        }
    }
1308618
public String getMessage(final MSLocale locale, final String key, final String defaultValue) {
        String message = getMessage(locale, key);
        return message == null ? defaultValue : message;
    }