1 7 8 package javax.security.auth.callback; 9 10 19 public class TextInputCallback implements Callback , java.io.Serializable { 20 21 private static final long serialVersionUID = -8064222478852811804L; 22 23 27 private String prompt; 28 32 private String defaultText; 33 37 private String inputText; 38 39 49 public TextInputCallback(String prompt) { 50 if (prompt == null || prompt.length() == 0) 51 throw new IllegalArgumentException (); 52 this.prompt = prompt; 53 } 54 55 71 public TextInputCallback(String prompt, String defaultText) { 72 if (prompt == null || prompt.length() == 0 || 73 defaultText == null || defaultText.length() == 0) 74 throw new IllegalArgumentException (); 75 76 this.prompt = prompt; 77 this.defaultText = defaultText; 78 } 79 80 87 public String getPrompt() { 88 return prompt; 89 } 90 91 99 public String getDefaultText() { 100 return defaultText; 101 } 102 103 112 public void setText(String text) { 113 this.inputText = text; 114 } 115 116 125 public String getText() { 126 return inputText; 127 } 128 } 129 | Popular Tags |