You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LocaleContext.java 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. Copyright (c) 2018 James Ahlborn
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package com.healthmarketscience.jackcess.expr;
  14. import java.text.DecimalFormat;
  15. import java.time.ZoneId;
  16. import java.time.format.DateTimeFormatter;
  17. /**
  18. * LocaleContext encapsulates all shared localization state for expression
  19. * parsing and evaluation.
  20. *
  21. * @author James Ahlborn
  22. */
  23. public interface LocaleContext
  24. {
  25. /**
  26. * @return the currently configured TemporalConfig (from the
  27. * {@link EvalConfig})
  28. */
  29. public TemporalConfig getTemporalConfig();
  30. /**
  31. * @return an appropriately configured (i.e. locale) DateTimeFormatter for
  32. * the given format.
  33. */
  34. public DateTimeFormatter createDateFormatter(String formatStr);
  35. /**
  36. * @return the currently configured ZoneId
  37. */
  38. public ZoneId getZoneId();
  39. /**
  40. * @return the currently configured NumericConfig (from the
  41. * {@link EvalConfig})
  42. */
  43. public NumericConfig getNumericConfig();
  44. /**
  45. * @return an appropriately configured (i.e. DecimalFormatSymbols)
  46. * DecimalFormat for the given format.
  47. */
  48. public DecimalFormat createDecimalFormat(String formatStr);
  49. }