001package Torello.HTML;
002
003/**
004 * If an HTML-Page Vector index-position is expected to contain a {@code TagNode} but it turns out
005 * to be an {@code instanceof TextNode} or, possibly, {@code CommentNode} - then this exception
006 * should throw.
007 */
008public class TagNodeExpectedException extends NodeExpectedException
009{
010    /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDEX> */
011    public static final long serialVersionUID = 1;
012
013    /** Constructs a {@code TagNodeExpectedException} with no detail message. */
014    public TagNodeExpectedException()
015    { super(); }
016
017    /**
018     * Constructs a {@code TagNodeExpectedException} with the specified detail message.
019     * @param message the detail message.
020     */
021    public TagNodeExpectedException(String message)
022    { super(message); }
023
024    /**
025     * Constructs a new exception with the specified detail message and cause.
026     *
027     * <BR /><BR /><B CLASS=JDDescLabel>NOTE:</B>
028     * 
029     * <BR /><BR />The detail message associated with cause is not automatically incorporated into
030     * this exception's detail message.
031     * 
032     * @param message The detail message (which is saved for later retrieval by the
033     * {@code Throwable.getMessage()} method).
034     * 
035     * @param cause the cause (which is saved for later retrieval by the
036     * {@code Throwable.getCause()} method).  (A null value is permitted, and indicates that the
037     * cause is nonexistent or unknown).
038     */
039    public TagNodeExpectedException(String message, Throwable cause)
040    { super(message, cause); }
041
042    /**
043     * Constructs a new exception with the specified cause and a detail message of
044     * {@code (cause==null ? null : cause.toString())} (which typically contains the class and
045     * detail message of cause).
046     * 
047     * <BR /><BR />This constructor is useful for exceptions that are little more than wrappers for
048     * other {@code Throwables}.
049     * 
050     * @param cause The cause (which is saved for later retrieval by the
051     * {@code Throwable.getCause()} method).  (A null value is permitted, and indicates that the
052     * cause is nonexistent or unknown).
053     */
054    public TagNodeExpectedException(Throwable cause)
055    { super(cause); }
056
057    /**
058     * Builds a new exception with a consistently worded error message.  The parameter
059     * {@code 'pos'} is used to identify the {@code Vector} location where the error has occurred.
060     * 
061     * @param pos This is the {@code Vector} index where an HTML Tag Element was expected.
062     */
063    public TagNodeExpectedException(int pos)
064    {
065        this(
066            "The Object reference at vector location [" + pos + "] was an not instance of " +
067            "TagNode, but a TagNode was expected here."
068        );
069    } 
070}