KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > security > auth > callback > LanguageCallback


1 /*
2  * @(#)LanguageCallback.java 1.14 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.security.auth.callback;
9
10 import java.util.Locale JavaDoc;
11
12 /**
13  * <p> Underlying security services instantiate and pass a
14  * <code>LanguageCallback</code> to the <code>handle</code>
15  * method of a <code>CallbackHandler</code> to retrieve the <code>Locale</code>
16  * used for localizing text.
17  *
18  * @version 1.14, 12/19/03
19  * @see javax.security.auth.callback.CallbackHandler
20  */

21 public class LanguageCallback implements Callback JavaDoc, java.io.Serializable JavaDoc {
22
23     private static final long serialVersionUID = 2019050433478903213L;
24
25     /**
26      * @serial
27      * @since 1.4
28      */

29     private Locale JavaDoc locale;
30
31     /**
32      * Construct a <code>LanguageCallback</code>.
33      */

34     public LanguageCallback() { }
35
36     /**
37      * Set the retrieved <code>Locale</code>.
38      *
39      * <p>
40      *
41      * @param locale the retrieved <code>Locale</code>.
42      *
43      * @see #getLocale
44      */

45     public void setLocale(Locale JavaDoc locale) {
46     this.locale = locale;
47     }
48  
49     /**
50      * Get the retrieved <code>Locale</code>.
51      *
52      * <p>
53      *
54      * @return the retrieved <code>Locale</code>, or null
55      * if no <code>Locale</code> could be retrieved.
56      *
57      * @see #setLocale
58      */

59     public Locale JavaDoc getLocale() {
60     return locale;
61     }
62 }
63
Popular Tags