1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | package Torello.HTML.NodeSearch; /** * Indicates that an HTML segment, or a single HTML-Tag, was not found at a particular location * on an HTML Page-<CODE>Vector</CODE> where that piece of HTML was expected. * * <BR /><BR />One of the more difficult issues that can happen when writing HTML Methods that * parse and search for sections and elements that are not actually present on the page or sub-page * being searched. If a section of HTML does not contain an element that a programmer expects it * to contain, any search method that returns a {@code DotPair} would return 'null'. * * <BR /><BR />Rather than allowing a method to throw an unintended {@code NullPointerException} * just because the <B>'Find'</B> returned a null reference - <I>it is better to check the result * of a search, and if the section was not found to throw an {@code HTMLNotFoundException}.</I> */ public class HTMLNotFoundException extends RuntimeException { /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDEX> */ public static final long serialVersionUID = 1; /** Constructs an {@code HTMLNotFoundException} with no detail message. */ public HTMLNotFoundException() { super(); } /** * Constructs an {@code HTMLNotFoundException} with the specified detail message. * @param message the detail message. */ public HTMLNotFoundException(String message) { super(message); } /** * Constructs a new exception with the specified detail message and cause. * * <BR /><BR /><B CLASS=JDDescLabel>NOTE:</B> * * <BR /><BR />The detail message associated with cause is not automatically incorporated into * this exception's detail message. * * @param message The detail message (which is saved for later retrieval by the * {@code Throwable.getMessage()} method). * * @param cause the cause (which is saved for later retrieval by the * {@code Throwable.getCause()} method). (A null value is permitted, and indicates that the * cause is nonexistent or unknown.) */ public HTMLNotFoundException(String message, Throwable cause) { super(message, cause); } /** * Constructs a new exception with the specified cause and a detail message of * {@code (cause==null ? null : cause.toString())} (which typically contains the class and * detail message of cause). This constructor is useful for exceptions that are little more * than wrappers for other throwables. * * @param cause The cause (which is saved for later retrieval by the * {@code Throwable.getCause()} method). (A null value is permitted, and indicates that the * cause is nonexistent or unknown.) */ public HTMLNotFoundException(Throwable cause) { super(cause); } } |