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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_06) on Thu Nov 24 12:17:56 GMT 2005 -->
<TITLE>
Validator
</TITLE>
<META NAME="keywords" CONTENT="javax.xml.validation.Validator class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Validator";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/xml/validation/TypeInfoProvider.html" title="class in javax.xml.validation"><B>PREV CLASS</B></A>
<A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="Validator.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.xml.validation</FONT>
<BR>
Class Validator</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>javax.xml.validation.Validator</B>
</PRE>
<HR>
<DL>
<DT>public abstract class <B>Validator</B><DT>extends java.lang.Object</DL>
<P>
<p>A processor that checks an XML document against <A HREF="../../../javax/xml/validation/Schema.html" title="class in javax.xml.validation"><CODE>Schema</CODE></A>.</p>
<p>
A validator is a thread-unsafe and non-reentrant object.
In other words, it is the application's responsibility to make
sure that one <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> object is not used from
more than one thread at any given time, and while the <tt>validate</tt>
method is invoked, applications may not recursively call
the <tt>validate</tt> method.
<p>
Note that while the <A HREF="../../../javax/xml/validation/Validator.html#validate(javax.xml.transform.Source)"><CODE>validate(javax.xml.transform.Source)</CODE></A> and <A HREF="../../../javax/xml/validation/Validator.html#validate(javax.xml.transform.Source, javax.xml.transform.Result)"><CODE>validate(javax.xml.transform.Source, javax.xml.transform.Result)</CODE></A>
methods take a <A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform"><CODE>Source</CODE></A> instance, the <code>Source</code>
instance must be a <code>SAXSource</code> or <code>DOMSource</code>.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>1.5</DD>
</DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected </CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#Validator()">Validator</A></B>()</CODE>
<BR>
Constructor for derived classes.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract org.xml.sax.ErrorHandler</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#getErrorHandler()">getErrorHandler</A></B>()</CODE>
<BR>
Gets the current <CODE>ErrorHandler</CODE> set to this <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#getFeature(java.lang.String)">getFeature</A></B>(java.lang.String name)</CODE>
<BR>
Look up the value of a feature flag.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#getProperty(java.lang.String)">getProperty</A></B>(java.lang.String name)</CODE>
<BR>
Look up the value of a property.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract org.w3c.dom.ls.LSResourceResolver</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#getResourceResolver()">getResourceResolver</A></B>()</CODE>
<BR>
Gets the current <CODE>LSResourceResolver</CODE> set to this <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#reset()">reset</A></B>()</CODE>
<BR>
Reset this <code>Validator</code> to its original configuration.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#setErrorHandler(org.xml.sax.ErrorHandler)">setErrorHandler</A></B>(org.xml.sax.ErrorHandler errorHandler)</CODE>
<BR>
Sets the <CODE>ErrorHandler</CODE> to receive errors encountered
during the <code>validate</code> method invocation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#setFeature(java.lang.String, boolean)">setFeature</A></B>(java.lang.String name,
boolean value)</CODE>
<BR>
Set the value of a feature flag.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#setProperty(java.lang.String, java.lang.Object)">setProperty</A></B>(java.lang.String name,
java.lang.Object object)</CODE>
<BR>
Set the value of a property.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#setResourceResolver(org.w3c.dom.ls.LSResourceResolver)">setResourceResolver</A></B>(org.w3c.dom.ls.LSResourceResolver resourceResolver)</CODE>
<BR>
Sets the <CODE>LSResourceResolver</CODE> to customize
resource resolution while in a validation episode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#validate(javax.xml.transform.Source)">validate</A></B>(<A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform">Source</A> source)</CODE>
<BR>
Validates the specified input.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#validate(javax.xml.transform.Source, javax.xml.transform.Result)">validate</A></B>(<A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform">Source</A> source,
<A HREF="../../../javax/xml/transform/Result.html" title="interface in javax.xml.transform">Result</A> result)</CODE>
<BR>
Validates the specified input and send the augmented validation
result to the specified output.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="Validator()"><!-- --></A><H3>
Validator</H3>
<PRE>
protected <B>Validator</B>()</PRE>
<DL>
<DD>Constructor for derived classes.
<p>
The constructor does nothing.
<p>
Derived classes must create <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> objects that have
<tt>null</tt> <CODE>ErrorHandler</CODE> and
<tt>null</tt> <CODE>LSResourceResolver</CODE>.
<P>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
public abstract void <B>reset</B>()</PRE>
<DL>
<DD><p>Reset this <code>Validator</code> to its original configuration.</p>
<p><code>Validator</code> is reset to the same state as when it was created with
<A HREF="../../../javax/xml/validation/Schema.html#newValidator()"><CODE>Schema.newValidator()</CODE></A>.
<code>reset()</code> is designed to allow the reuse of existing <code>Validator</code>s
thus saving resources associated with the creation of new <code>Validator</code>s.</p>
<p>The reset <code>Validator</code> is not guaranteed to have the same <CODE>LSResourceResolver</CODE> or <CODE>ErrorHandler</CODE>
<code>Object</code>s, e.g. <CODE>Object.equals(Object obj)</CODE>. It is guaranteed to have a functionally equal
<code>LSResourceResolver</code> and <code>ErrorHandler</code>.</p>
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="validate(javax.xml.transform.Source)"><!-- --></A><H3>
validate</H3>
<PRE>
public void <B>validate</B>(<A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform">Source</A> source)
throws org.xml.sax.SAXException,
java.io.IOException</PRE>
<DL>
<DD>Validates the specified input.
<p>
This is just a convenience method of:
<pre>
validate(source,null);
</pre>
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>org.xml.sax.SAXException</CODE>
<DD><CODE>java.io.IOException</CODE><DT><B>See Also:</B><DD><A HREF="../../../javax/xml/validation/Validator.html#setErrorHandler(org.xml.sax.ErrorHandler)"><CODE>setErrorHandler(ErrorHandler)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="validate(javax.xml.transform.Source, javax.xml.transform.Result)"><!-- --></A><H3>
validate</H3>
<PRE>
public abstract void <B>validate</B>(<A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform">Source</A> source,
<A HREF="../../../javax/xml/transform/Result.html" title="interface in javax.xml.transform">Result</A> result)
throws org.xml.sax.SAXException,
java.io.IOException</PRE>
<DL>
<DD>Validates the specified input and send the augmented validation
result to the specified output.
<p>
This method places the following restrictions on the types of
the <A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform"><CODE>Source</CODE></A>/<A HREF="../../../javax/xml/transform/Result.html" title="interface in javax.xml.transform"><CODE>Result</CODE></A> accepted.
<h4><A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform"><CODE>Source</CODE></A>/<A HREF="../../../javax/xml/transform/Result.html" title="interface in javax.xml.transform"><CODE>Result</CODE></A> accepted:</h4>
<table border=1>
<thead>
<tr>
<td></td>
<td><A HREF="../../../javax/xml/transform/sax/SAXSource.html" title="class in javax.xml.transform.sax"><CODE>SAXSource</CODE></A></td>
<td><A HREF="../../../javax/xml/transform/dom/DOMSource.html" title="class in javax.xml.transform.dom"><CODE>DOMSource</CODE></A></td>
</tr>
</thead>
<tbody>
<tr>
<td><tt>null</tt></td>
<td>OK</td>
<td>OK</td>
</tr>
<tr>
<td><A HREF="../../../javax/xml/transform/sax/SAXResult.html" title="class in javax.xml.transform.sax"><CODE>SAXResult</CODE></A></td>
<td>OK</td>
<td>Err</td>
</tr>
<tr>
<td><A HREF="../../../javax/xml/transform/dom/DOMResult.html" title="class in javax.xml.transform.dom"><CODE>DOMResult</CODE></A></td>
<td>Err</td>
<td>OK</td>
</tr>
</tbody>
</table>
<p>
<strong>Note that <A HREF="../../../javax/xml/transform/stream/StreamSource.html" title="class in javax.xml.transform.stream"><CODE>StreamSource</CODE></A> instances are not allowed.</strong> To process
a <code>StreamSource</code>, or to validate one <A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform"><CODE>Source</CODE></A> into another kind of <A HREF="../../../javax/xml/transform/Result.html" title="interface in javax.xml.transform"><CODE>Result</CODE></A>, use the identity transformer
(see <A HREF="../../../javax/xml/transform/TransformerFactory.html#newTransformer()"><CODE>TransformerFactory.newTransformer()</CODE></A>).
<p>
Errors found during the validation is sent to the specified
<CODE>ErrorHandler</CODE>.
<p>
If a document is valid, or if a document contains some errors
but none of them were fatal and the <CODE>ErrorHandler</CODE> didn't
throw any exception, then the method returns normally.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - XML to be validated. Must not be null.<DD><CODE>result</CODE> - The <A HREF="../../../javax/xml/transform/Result.html" title="interface in javax.xml.transform"><CODE>Result</CODE></A> object that receives (possibly augmented)
XML. This parameter can be null if the caller is not interested
in it.
Note that when a <A HREF="../../../javax/xml/transform/dom/DOMResult.html" title="class in javax.xml.transform.dom"><CODE>DOMResult</CODE></A> is used,
a validator might just pass the same DOM node from
<A HREF="../../../javax/xml/transform/dom/DOMSource.html" title="class in javax.xml.transform.dom"><CODE>DOMSource</CODE></A> to
<A HREF="../../../javax/xml/transform/dom/DOMResult.html" title="class in javax.xml.transform.dom"><CODE>DOMResult</CODE></A>
(in which case <tt>source.getNode()==result.getNode()</tt>),
it might copy the entire DOM tree, or it might alter the
node given by the source.
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - If the <A HREF="../../../javax/xml/transform/Result.html" title="interface in javax.xml.transform"><CODE>Result</CODE></A> type doesn't match the <A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform"><CODE>Source</CODE></A> type,
or if the specified source is neither
<A HREF="../../../javax/xml/transform/sax/SAXSource.html" title="class in javax.xml.transform.sax"><CODE>SAXSource</CODE></A> nor
<A HREF="../../../javax/xml/transform/dom/DOMSource.html" title="class in javax.xml.transform.dom"><CODE>DOMSource</CODE></A>.
<DD><CODE>org.xml.sax.SAXException</CODE> - If the <CODE>ErrorHandler</CODE> throws a <CODE>SAXException</CODE> or
if a fatal error is found and the <CODE>ErrorHandler</CODE> returns
normally.
<DD><CODE>java.io.IOException</CODE> - If the validator is processing a
<A HREF="../../../javax/xml/transform/sax/SAXSource.html" title="class in javax.xml.transform.sax"><CODE>SAXSource</CODE></A> and the
underlying <CODE>XMLReader</CODE> throws an
<CODE>IOException</CODE>.
<DD><CODE>java.lang.NullPointerException</CODE> - If the <tt>source</tt> parameter is null.<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/validation/Validator.html#validate(javax.xml.transform.Source)"><CODE>validate(Source)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setErrorHandler(org.xml.sax.ErrorHandler)"><!-- --></A><H3>
setErrorHandler</H3>
<PRE>
public abstract void <B>setErrorHandler</B>(org.xml.sax.ErrorHandler errorHandler)</PRE>
<DL>
<DD>Sets the <CODE>ErrorHandler</CODE> to receive errors encountered
during the <code>validate</code> method invocation.
<p>
Error handler can be used to customize the error handling process
during a validation. When an <CODE>ErrorHandler</CODE> is set,
errors found during the validation will be first sent
to the <CODE>ErrorHandler</CODE>.
<p>
The error handler can abort further validation immediately
by throwing <CODE>SAXException</CODE> from the handler. Or for example
it can print an error to the screen and try to continue the
validation by returning normally from the <CODE>ErrorHandler</CODE>
<p>
If any <CODE>Throwable</CODE> is thrown from an <CODE>ErrorHandler</CODE>,
the caller of the <code>validate</code> method will be thrown
the same <CODE>Throwable</CODE> object.
<p>
<A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> is not allowed to
throw <CODE>SAXException</CODE> without first reporting it to
<CODE>ErrorHandler</CODE>.
<p>
When the <CODE>ErrorHandler</CODE> is null, the implementation will
behave as if the following <CODE>ErrorHandler</CODE> is set:
<pre>
class DraconianErrorHandler implements <CODE>ErrorHandler</CODE> {
public void fatalError( <CODE>SAXParseException</CODE> e ) throws <CODE>SAXException</CODE> {
throw e;
}
public void error( <CODE>SAXParseException</CODE> e ) throws <CODE>SAXException</CODE> {
throw e;
}
public void warning( <CODE>SAXParseException</CODE> e ) throws <CODE>SAXException</CODE> {
// noop
}
}
</pre>
<p>
When a new <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> object is created, initially
this field is set to null.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>errorHandler</CODE> - A new error handler to be set. This parameter can be null.</DL>
</DD>
</DL>
<HR>
<A NAME="getErrorHandler()"><!-- --></A><H3>
getErrorHandler</H3>
<PRE>
public abstract org.xml.sax.ErrorHandler <B>getErrorHandler</B>()</PRE>
<DL>
<DD>Gets the current <CODE>ErrorHandler</CODE> set to this <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A>.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>This method returns the object that was last set through
the <A HREF="../../../javax/xml/validation/Validator.html#setErrorHandler(org.xml.sax.ErrorHandler)"><CODE>setErrorHandler(ErrorHandler)</CODE></A> method, or null
if that method has never been called since this <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A>
has created.<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/validation/Validator.html#setErrorHandler(org.xml.sax.ErrorHandler)"><CODE>setErrorHandler(ErrorHandler)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setResourceResolver(org.w3c.dom.ls.LSResourceResolver)"><!-- --></A><H3>
setResourceResolver</H3>
<PRE>
public abstract void <B>setResourceResolver</B>(org.w3c.dom.ls.LSResourceResolver resourceResolver)</PRE>
<DL>
<DD>Sets the <CODE>LSResourceResolver</CODE> to customize
resource resolution while in a validation episode.
<p>
<A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> uses a <CODE>LSResourceResolver</CODE>
when it needs to locate external resources while a validation,
although exactly what constitutes "locating external resources" is
up to each schema language.
<p>
When the <CODE>LSResourceResolver</CODE> is null, the implementation will
behave as if the following <CODE>LSResourceResolver</CODE> is set:
<pre>
class DumbLSResourceResolver implements <CODE>LSResourceResolver</CODE> {
public <CODE>LSInput</CODE> resolveResource(
String publicId, String systemId, String baseURI) {
return null; // always return null
}
}
</pre>
<p>
If a <CODE>LSResourceResolver</CODE> throws a <CODE>RuntimeException</CODE>
(or instances of its derived classes),
then the <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> will abort the parsing and
the caller of the <code>validate</code> method will receive
the same <CODE>RuntimeException</CODE>.
<p>
When a new <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> object is created, initially
this field is set to null.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>resourceResolver</CODE> - A new resource resolver to be set. This parameter can be null.</DL>
</DD>
</DL>
<HR>
<A NAME="getResourceResolver()"><!-- --></A><H3>
getResourceResolver</H3>
<PRE>
public abstract org.w3c.dom.ls.LSResourceResolver <B>getResourceResolver</B>()</PRE>
<DL>
<DD>Gets the current <CODE>LSResourceResolver</CODE> set to this <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A>.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>This method returns the object that was last set through
the <A HREF="../../../javax/xml/validation/Validator.html#setResourceResolver(org.w3c.dom.ls.LSResourceResolver)"><CODE>setResourceResolver(LSResourceResolver)</CODE></A> method, or null
if that method has never been called since this <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A>
has created.<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/validation/Validator.html#setErrorHandler(org.xml.sax.ErrorHandler)"><CODE>setErrorHandler(ErrorHandler)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getFeature(java.lang.String)"><!-- --></A><H3>
getFeature</H3>
<PRE>
public boolean <B>getFeature</B>(java.lang.String name)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException</PRE>
<DL>
<DD>Look up the value of a feature flag.
<p>The feature name is any fully-qualified URI. It is
possible for a <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> to recognize a feature name but
temporarily be unable to return its value.
Some feature values may be available only in specific
contexts, such as before, during, or after a validation.
<p>Implementors are free (and encouraged) to invent their own features,
using names built on their own URIs.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The feature name, which is a non-null fully-qualified URI.
<DT><B>Returns:</B><DD>The current value of the feature (true or false).
<DT><B>Throws:</B>
<DD><CODE>org.xml.sax.SAXNotRecognizedException</CODE> - If the feature
value can't be assigned or retrieved.
<DD><CODE>org.xml.sax.SAXNotSupportedException</CODE> - When the
<A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> recognizes the feature name but
cannot determine its value at this time.
<DD><CODE>java.lang.NullPointerException</CODE> - When the name parameter is null.<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/validation/Validator.html#setFeature(java.lang.String, boolean)"><CODE>setFeature(String, boolean)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setFeature(java.lang.String, boolean)"><!-- --></A><H3>
setFeature</H3>
<PRE>
public void <B>setFeature</B>(java.lang.String name,
boolean value)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException</PRE>
<DL>
<DD>Set the value of a feature flag.
<p>
Feature can be used to control the way a <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A>
parses schemas, although <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A>s are not required
to recognize any specific property names.</p>
<p>The feature name is any fully-qualified URI. It is
possible for a <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> to expose a feature value but
to be unable to change the current value.
Some feature values may be immutable or mutable only
in specific contexts, such as before, during, or after
a validation.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The feature name, which is a non-null fully-qualified URI.<DD><CODE>value</CODE> - The requested value of the feature (true or false).
<DT><B>Throws:</B>
<DD><CODE>org.xml.sax.SAXNotRecognizedException</CODE> - If the feature
value can't be assigned or retrieved.
<DD><CODE>org.xml.sax.SAXNotSupportedException</CODE> - When the
<A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> recognizes the feature name but
cannot set the requested value.
<DD><CODE>java.lang.NullPointerException</CODE> - When the name parameter is null.<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/validation/Validator.html#getFeature(java.lang.String)"><CODE>getFeature(String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setProperty(java.lang.String, java.lang.Object)"><!-- --></A><H3>
setProperty</H3>
<PRE>
public void <B>setProperty</B>(java.lang.String name,
java.lang.Object object)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException</PRE>
<DL>
<DD>Set the value of a property.
<p>The property name is any fully-qualified URI. It is
possible for a <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> to recognize a property name but
to be unable to change the current value.
Some property values may be immutable or mutable only
in specific contexts, such as before, during, or after
a validation.</p>
<p><A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A>s are not required to recognize setting
any specific property names.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The property name, which is a non-null fully-qualified URI.<DD><CODE>object</CODE> - The requested value for the property.
<DT><B>Throws:</B>
<DD><CODE>org.xml.sax.SAXNotRecognizedException</CODE> - If the property
value can't be assigned or retrieved.
<DD><CODE>org.xml.sax.SAXNotSupportedException</CODE> - When the
<A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> recognizes the property name but
cannot set the requested value.
<DD><CODE>java.lang.NullPointerException</CODE> - When the name parameter is null.</DL>
</DD>
</DL>
<HR>
<A NAME="getProperty(java.lang.String)"><!-- --></A><H3>
getProperty</H3>
<PRE>
public java.lang.Object <B>getProperty</B>(java.lang.String name)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException</PRE>
<DL>
<DD>Look up the value of a property.
<p>The property name is any fully-qualified URI. It is
possible for a <A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A> to recognize a property name but
temporarily be unable to return its value.
Some property values may be available only in specific
contexts, such as before, during, or after a validation.</p>
<p><A HREF="../../../javax/xml/validation/Validator.html" title="class in javax.xml.validation"><CODE>Validator</CODE></A>s are not required to recognize any specific
property names.</p>
<p>Implementors are free (and encouraged) to invent their own properties,
using names built on their own URIs.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The property name, which is a non-null fully-qualified URI.
<DT><B>Returns:</B><DD>The current value of the property.
<DT><B>Throws:</B>
<DD><CODE>org.xml.sax.SAXNotRecognizedException</CODE> - If the property
value can't be assigned or retrieved.
<DD><CODE>org.xml.sax.SAXNotSupportedException</CODE> - When the
XMLReader recognizes the property name but
cannot determine its value at this time.
<DD><CODE>java.lang.NullPointerException</CODE> - When the name parameter is null.<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/validation/Validator.html#setProperty(java.lang.String, java.lang.Object)"><CODE>setProperty(String, Object)</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/xml/validation/TypeInfoProvider.html" title="class in javax.xml.validation"><B>PREV CLASS</B></A>
<A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="Validator.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
|