Package Torello.HTML.Tools.JavaDoc
Class DetailsException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.IllegalArgumentException
-
- Torello.HTML.Tools.JavaDoc.DetailsException
-
- All Implemented Interfaces:
java.io.Serializable
public class DetailsException extends java.lang.IllegalArgumentException
DetailsException - Documentation.
class Details
will returnclass HNLIInclusive
(a java'Iterator<E>'
andListIterator<E>
sub-class.- See Also:
- Serialized Form
Hi-Lited Source-Code:
- View Here: Torello/HTML/Tools/JavaDoc/DetailsException.java
- Open New Browser-Tab: Torello/HTML/Tools/JavaDoc/DetailsException.java
-
-
Field Summary
Fields Modifier and Type Field protected static String
PLEASE_USE
static long
serialVersionUID
-
Constructor Summary
Constructors Constructor DetailsException()
DetailsException(String message)
DetailsException(String message, Throwable cause)
DetailsException(Throwable cause)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method static void
check(Vector<HTMLNode> details)
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable
. Using theSerializable
Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.
Note that Java'sjava.lang.Exception
andjava.lang.Error
classes implement theSerializable interface
, and a warning-free build expects this field be defined here.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
1
public static final long serialVersionUID = 1;
-
PLEASE_USE
protected static final java.lang.String PLEASE_USE
This is a helpful message explaining how to ensure that a sub-section of a vectorized-HTML Documentation Web-Page is properly formatted according to the 'details' section of a Java-Doc page.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
1 2 3
protected static final String PLEASE_USE = "Please use the Details iterator(); Methods to retrieve a details section for a " + "Method, Field, or Constructor.";
-
-
Constructor Detail
-
DetailsException
public DetailsException()
Constructs aDetailsException
with no detail message.
-
DetailsException
public DetailsException(java.lang.String message)
Constructs aDetailsException
with the specified detail message.- Parameters:
message
- the detail message.
-
DetailsException
public DetailsException(java.lang.String message, java.lang.Throwable cause)
Constructs a new exception with the specified detail message and cause.
NOTE: The detail message associated with cause is not automatically incorporated in this exception's detail message.- Parameters:
message
- The detail message (which is saved for later retrieval by theThrowable.getMessage()
method).cause
- the cause (which is saved for later retrieval by theThrowable.getCause()
method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
-
DetailsException
public DetailsException(java.lang.Throwable cause)
Constructs a new exception with the specified cause and a detail message of(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.- Parameters:
cause
- The cause (which is saved for later retrieval by theThrowable.getCause()
method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
-
-
Method Detail
-
check
public static void check(java.util.Vector<HTMLNode> details)
This check method is used to ensure that a passed-parameter vectorized-HTML sub-page to one of theDetailsMethods, DetailsConstructors
orDetailsFields
is a properly formatted HTML Sub-Section. The purpose of the iterators withinclass Details
is to retrieve the individual, detailed descriptions for the fields, methods and constructors from an HTML Page generated by the Java-Doc tool. This exception class will do some simple, basic parameter checking to ensure that the parameters passed to the extensions toclass Details
- which, again, areDetailsMethods, DetailsConstructors
andDetailsFields
. The priority is to provide more useable and meaningful error information to make it easy to alter, upgrade or modify an HTML Page generated by JavaDoc.- Parameters:
details
- This is supposed to be the return value from a call to theHNLIInclusive iter.next()
method. The iterator should be one returned from theclass Details
iterator' methods. If it was, then it should a guarantee that the section is properly formatted, because it would have been retrieved from a JavaDoc HTML page.- Throws:
DetailsException
- This exception shall throw if any of the requirements of the section have not been met.- See Also:
StrCmpr
,TagNode
- Code:
- Exact Method Body:
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
TagNode first = null; TagNode last = null; // Ensure that the section is not null. if (details == null) throw new NullPointerException ("The vectorized-HTML section vector-reference was null."); // There should quite a number of elements in this vector, besides the beginning and // ending <UL>...</UL> elements. if (details.size() < 3) throw new DetailsException( "The vectorized-HTML section parameter has v.size()=" + details.size() + ". This is not sufficient. " + PLEASE_USE ); // All Details Elements begin with <ul class='blockList'> or <ul class='blockListLast'> try { first = (TagNode) details.elementAt(0); } catch (ClassCastException e) { throw new DetailsException( "This vectorized-HTML section does not begin with a TagNode element. " + "It begins with [" + first.str + "]" + PLEASE_USE ); } // All Details Elements end with </ul> try { last = (TagNode) details.elementAt(details.size() - 1); } catch (ClassCastException e) { throw new DetailsException( "This vectorized-HTML section does not end with a TagNode element. " + "It ends with [" + last.str + "]" + PLEASE_USE ); } // All Details Elements begin with <ul class='blockList'> or <ul class='blockListLast'> if ((! first.tok.equals("ul")) || first.isClosing) throw new DetailsException( "The first node of the vectorized-HTML section is not an Opening <UL> Element. " + "It is a [" + first.str + "]. " + PLEASE_USE ); // All Details Elements end with </ul> if ((! last.tok.equals("ul")) || (! last.isClosing)) throw new DetailsException( "The last node of the vectorized-HTML section is not a Closing </UL> Element. " + "It is a [" + last.str + "]. " + PLEASE_USE ); // All Details Elements begin with <ul class='blockList'> or <ul class='blockListLast'> if (! StrCmpr.containsOR_CI(first.AV("class"), "blockList", "blockListLast")) throw new DetailsException( "The first node of the vectorized-HTML section is not an Opening <UL> Element " + "with 'class' attribute containing string: 'blockList' or 'blockListLast.' " + "Instead it is: [" + first.str + "]." );
-
-