1 7 8 package javax.security.auth.callback; 9 10 18 public class NameCallback implements Callback , java.io.Serializable { 19 20 private static final long serialVersionUID = 3770938795909392253L; 21 22 26 private String prompt; 27 31 private String defaultName; 32 36 private String inputName; 37 38 48 public NameCallback(String prompt) { 49 if (prompt == null || prompt.length() == 0) 50 throw new IllegalArgumentException (); 51 this.prompt = prompt; 52 } 53 54 70 public NameCallback(String prompt, String defaultName) { 71 if (prompt == null || prompt.length() == 0 || 72 defaultName == null || defaultName.length() == 0) 73 throw new IllegalArgumentException (); 74 75 this.prompt = prompt; 76 this.defaultName = defaultName; 77 } 78 79 86 public String getPrompt() { 87 return prompt; 88 } 89 90 98 public String getDefaultName() { 99 return defaultName; 100 } 101 102 111 public void setName(String name) { 112 this.inputName = name; 113 } 114 115 124 public String getName() { 125 return inputName; 126 } 127 } 128 | Popular Tags |