Java Reference
In-Depth Information
break
break
;
case
case
x:
iif
(
xmlDecorator
==
null
null
) {
xmlDecorator
=
new
new
ResultsDecoratorXML
(
out
,
verbosity
);
}
newDecorator
=
xmlDecorator
;
break
break
;
case
case
j:
iif
(
jtableDecorator
==
null
null
) {
iif
(
gui
==
null
null
) {
throw
throw new
new
IllegalArgumentException
(
"Can't set mode to JTable before calling setGUI()"
);
}
jtableDecorator
=
new
new
ResultsDecoratorJTable
(
gui
.
getJTable
(),
out
,
verbosity
);
}
newDecorator
=
jtableDecorator
;
break
break
;
default
default
:
System
.
err
.
println
(
"invalid mode: "
+
outputMode
+
"; must be one of: "
);
for
for
(
OutputMode t
:
OutputMode
.
values
()) {
out
.
print
(
t
);
out
.
print
(
' '
);
}
out
.
println
();
}
iif
(
currentDecorator
!=
newDecorator
) {
currentDecorator
=
newDecorator
;
iif
(
debug
)
System
.
out
.
println
(
"Mode set to "
+
outputMode
);
}
currentDecorator
.
setWriter
(
out
);
}
/** Run one script file, by name. Called from cmd line main
* or from user code. Deprecated because of the poor capability
* for error handling; it would be better for the user interface
* code to create a Reader and then say:
* <pre>while ((stmt = SQLRunner.getStatement(is)) != null) {
stmt = stmt.trim();
try {
myRunner.runStatement(stmt);
} catch (Exception e) {
// Display the message to the user ...
}
}