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
63
64
65
66
67
68
69
70
71
72
73 | package Torello.Browser;
/**
* This exception throws if, when building a CDP instance with the 'advanced' {@link TypeBuilder}
* class, but a unknown field name has been passed by the user. The class {@link TypeBuilder} may
* be used in lieu of a class' constructor for a CDP data class in situation where the constructor
* would be completely unwieldy and inconvenient given the number of fields in the class.
*
* <BR /><BR /><DIV CLASS=JDHint>
* 👉 This class offers a number of "convenience fields" to provide more comprehensive error
* reporting when something has failed.
* </DIV>
*
* @see TypeBuilder
*/
public class AssignmentNameException extends IllegalArgumentException
{
/** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDEX> */
public static final long serialVersionUID = 1;
/**
* The unknown assignment name that was passed to one of the builder's
* {@code accept(...)} methods.
*
* <BR /><BR /><DIV CLASS=JDHint>
* 👉 For a {@link TypeBuilder}, this name usually identifies a field in the CDP type being
* built. For a {@link CommandBuilder}, it usually identifies one of the command's input
* parameters.
* </DIV>
*/
public final String name;
/**
* The descriptor used by the builder when this exception was thrown.
*
* <BR /><BR /><DIV CLASS=JDHint>
* 👉 This field is provided as a programmer convenience, to make debugging and error
* investigation easier.
* </DIV>
*/
public final AbstractDescriptor descriptor;
/**
* Constructs a {@code AssignmentNameException} with the default error message.
*
* @param name the unknown assignment name passed to the builder.
* @param descriptor the descriptor used by the builder.
*/
public AssignmentNameException(final String name, final AbstractDescriptor descriptor)
{
super("The assignment name \"" + name + "\" is not listed by this builder's descriptor.");
this.name = name;
this.descriptor = descriptor;
}
/**
* Constructs a {@code AssignmentNameException} with the specified detail message.
*
* @param message the detail message.
* @param name the unknown assignment name passed to the builder.
* @param descriptor the descriptor used by the builder.
*/
public AssignmentNameException(
final String message,
final String name,
final AbstractDescriptor descriptor
)
{
super(message);
this.name = name;
this.descriptor = descriptor;
}
}
|