001package Torello.HTML; 002 003import Torello.Java.ExceptionCheckError; 004 005/** 006 * If, when attempting to instantiate or construct a {@code TagNode}, the {@code String} used to 007 * instantiate that node is invalid, this exception will be thrown to inform the programmer that 008 * his passed constructor-{@code String} was invalid. That failed-{@code String} will be available 009 * as a {@code public final String} field inside this exception class. 010 * 011 * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=EXPM> 012 */ 013public class MalformedTagNodeException extends IllegalArgumentException 014{ 015 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDEX> */ 016 public static final long serialVersionUID = 1; 017 018 /** 019 * <EMBED CLASS='external-html' DATA-FILE-ID=EXPF> 020 * 021 * <BR /><BR />This public final field contains the {@code String} that, when a {@code TagNode} 022 * attempted to build this {@code String} into a {@code TagNode} instance, caused an exception 023 * to throw. 024 */ 025 public final String htmlElementStr; 026 027 /** 028 * Constructs a new exception with the specified detail message, and one {@code public, final} 029 * parameter: {@code htmlElementStr}. 030 * 031 * @param message the detail message. 032 * 033 * @param htmlElementStr This will be passed the constructor-string that was passed to the 034 * constructor which caused this {@code Exception} to throw in the first place. This 035 * {@code String} will be available in the {@code public final String htmlElementStr} field, 036 * for inspection and reference. <I><B>It ought not to be left null.</B></I> 037 * 038 * <EMBED CLASS='external-html' DATA-FILE-ID=EXPF_PARAM> 039 * @see #htmlElementStr 040 */ 041 public MalformedTagNodeException(String message, String htmlElementStr) 042 { 043 super(message); 044 045 if (htmlElementStr == null) throw new ExceptionCheckError 046 ("'htmlElementStr' was passed a null reference"); 047 048 this.htmlElementStr = htmlElementStr; 049 } 050 051 /** 052 * Constructs a new exception with the specified detail message, cause-chain throwable, and one 053 * {@code public, final} parameter: {@code htmlElementStr}. 054 * 055 * @param message The detail message (which is saved for later retrieval by the 056 * {@code Throwable.getMessage()} method). 057 * 058 * @param cause the cause (which is saved for later retrieval by the {@code Throwable.getCause()} 059 * method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.) 060 * 061 * @param htmlElementStr This will be passed the constructor-string that was passed to the 062 * constructor which caused this {@code Exception} to throw in the first place. This 063 * {@code String} will be available in the {@code public final String htmlElementStr} field, 064 * for inspection and reference. <I><B>It ought not to be left null.</B></I> 065 * 066 * <EMBED CLASS='external-html' DATA-FILE-ID=EXPF_PARAM> 067 * 068 * @see #htmlElementStr 069 */ 070 public MalformedTagNodeException(String message, Throwable cause, String htmlElementStr) 071 { 072 super(message, cause); 073 074 if (htmlElementStr == null) throw new ExceptionCheckError 075 ("'htmlElementStr' was passed a null reference"); 076 077 this.htmlElementStr = htmlElementStr; 078 } 079}