source: release-kits/lirk3/bin/ant-installer/web/java2html/antinstaller/org/tp23/antinstaller/input/Validator.java.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 4.2 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2<HTML>
3<HEAD>
4<LINK REL=STYLESHEET TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
5<META NAME="GENERATOR" CONTENT="Java2HTML Version 1.4">
6<TITLE>org.tp23.antinstaller.input.Validator (Java2HTML)</TITLE>
7</HEAD>
8<BODY><TABLE id="Header" border="0" cellpadding="0" cellspacing="0" width="100%">
9<tr>
10<td colspan="2" width="33%">&nbsp;</td>
11<td align="center" colspan="2" width="33%">
12<font size="4" class="ClassName">Validator.java</font>
13</td>
14<td align="right" colspan="2" width="33%">&nbsp;</td>
15</tr>
16</TABLE>
17<pre CLASS="Classes">
18<FONT CLASS="LN">1 </FONT><A NAME="1"></A><FONT CLASS="Package">package</FONT> <A HREF="../../../../org.tp23.antinstaller.input.index.html" target="packageFrame">org.tp23.antinstaller.input</A>;
19<FONT CLASS="LN">2 </FONT><A NAME="2"></A>
20<FONT CLASS="LN">3 </FONT><A NAME="3"></A><FONT CLASS="Import">import</FONT> java.util.Locale;
21<FONT CLASS="LN">4 </FONT><A NAME="4"></A>
22<FONT CLASS="LN">5 </FONT><A NAME="5"></A><FONT CLASS="Import">import</FONT> <A HREF="../../../../org/tp23/antinstaller/InstallerContext.java.html">org.tp23.antinstaller.InstallerContext</A>;
23<FONT CLASS="LN">6 </FONT><A NAME="6"></A>
24<FONT CLASS="LN">7 </FONT><A NAME="7"></A>
25<FONT CLASS="LN">8 </FONT><A NAME="8"></A><FONT CLASS="FormalComment">/**
26<FONT CLASS="LN">9 </FONT><A NAME="9"></A> * A no args constructor should be provided
27<FONT CLASS="LN">10</FONT><A NAME="10"></A> * @author Paul Hinds
28<FONT CLASS="LN">11</FONT><A NAME="11"></A> * @version $Id: Validator.java,v 1.1.1.1 2005/10/18 18:20:54 teknopaul Exp $
29<FONT CLASS="LN">12</FONT><A NAME="12"></A> */</FONT>
30<FONT CLASS="LN">13</FONT><A NAME="13"></A><FONT CLASS="Public">public</FONT> <FONT CLASS="Interface">interface</FONT> Validator {
31<FONT CLASS="LN">14</FONT><A NAME="14"></A>
32<FONT CLASS="LN">15</FONT><A NAME="15"></A> <FONT CLASS="FormalComment">/**
33<FONT CLASS="LN">16</FONT><A NAME="16"></A> * Validate the user entry. The InstallerContext is provided to allow
34<FONT CLASS="LN">17</FONT><A NAME="17"></A> * conditional failure based on user input. for example the implementation
35<FONT CLASS="LN">18</FONT><A NAME="18"></A> * of this class could call the following code after failing to open a socket
36<FONT CLASS="LN">19</FONT><A NAME="19"></A> * &lt;pre&gt;
37<FONT CLASS="LN">20</FONT><A NAME="20"></A> * boolean usrOverride = ctx.getMessageRenderer().prompt("Prot not available are you sure?");
38<FONT CLASS="LN">21</FONT><A NAME="21"></A> * if(userOverride)return true;
39<FONT CLASS="LN">22</FONT><A NAME="22"></A> * else{
40<FONT CLASS="LN">23</FONT><A NAME="23"></A> * throw new SocketException();
41<FONT CLASS="LN">24</FONT><A NAME="24"></A> * }
42<FONT CLASS="LN">25</FONT><A NAME="25"></A> * &lt;/pre&gt;
43<FONT CLASS="LN">26</FONT><A NAME="26"></A> * @param text may be null it is up to the validator to decide if null or ""
44<FONT CLASS="LN">27</FONT><A NAME="27"></A> * is acceptable
45<FONT CLASS="LN">28</FONT><A NAME="28"></A> * @throws Exception
46<FONT CLASS="LN">29</FONT><A NAME="29"></A> */</FONT>
47<FONT CLASS="LN">30</FONT><A NAME="30"></A> <FONT CLASS="Public">public</FONT> <FONT CLASS="Void">void</FONT> validate(String text,<A HREF="../../../../org/tp23/antinstaller/InstallerContext.java.html">InstallerContext</A> ctx)<FONT CLASS="Throws">throws</FONT> Exception;
48<FONT CLASS="LN">31</FONT><A NAME="31"></A> <FONT CLASS="FormalComment">/**
49<FONT CLASS="LN">32</FONT><A NAME="32"></A> * This method should return a string for every exception that might be
50<FONT CLASS="LN">33</FONT><A NAME="33"></A> * thrown by the validate method. The top level Throwable should be
51<FONT CLASS="LN">34</FONT><A NAME="34"></A> * handled at least.
52<FONT CLASS="LN">35</FONT><A NAME="35"></A> * @param ex
53<FONT CLASS="LN">36</FONT><A NAME="36"></A> * @param l Locale (ignored, but one day we should be internationalized)
54<FONT CLASS="LN">37</FONT><A NAME="37"></A> * @return
55<FONT CLASS="LN">38</FONT><A NAME="38"></A> */</FONT>
56<FONT CLASS="LN">39</FONT><A NAME="39"></A> <FONT CLASS="Public">public</FONT> String getErrorMessage(Throwable ex,Locale l);
57<FONT CLASS="LN">40</FONT><A NAME="40"></A>}
58<FONT CLASS="LN">41</FONT><A NAME="41"></A></pre>
59</BODY>
60</HTML>
Note: See TracBrowser for help on using the repository browser.