1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.security.auth.callback;
  6. import java.util.Locale;
  7. /**
  8. * <p> Underlying security services instantiate and pass a
  9. * <code>LanguageCallback</code> to the <code>invokeCallback</code>
  10. * method of a <code>CallbackHandler</code> to retrieve the <code>Locale</code>
  11. * used for localizing text.
  12. *
  13. * @version 1.6, 01/11/00
  14. * @see javax.security.auth.callback.CallbackHandler
  15. */
  16. public class LanguageCallback implements Callback {
  17. private Locale locale;
  18. /**
  19. * Construct a <code>LanguageCallback</code>.
  20. */
  21. public LanguageCallback() { }
  22. /**
  23. * Set the retrieved <code>Locale</code>.
  24. *
  25. * <p>
  26. *
  27. * @param locale the retrieved <code>Locale</code>.
  28. */
  29. public void setLocale(Locale locale) {
  30. this.locale = locale;
  31. }
  32. /**
  33. * Get the retrieved <code>Locale</code>.
  34. *
  35. * <p>
  36. *
  37. * @return the retrieved <code>Locale</code>, or null
  38. * if no <code>Locale</code> could be retrieved.
  39. */
  40. public Locale getLocale() {
  41. return locale;
  42. }
  43. }