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 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834
|
<!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>
ValidatorHandler
</TITLE>
<META NAME="keywords" CONTENT="javax.xml.validation.ValidatorHandler class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="ValidatorHandler";
}
</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/Validator.html" title="class in javax.xml.validation"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="ValidatorHandler.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 ValidatorHandler</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>javax.xml.validation.ValidatorHandler</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>org.xml.sax.ContentHandler</DD>
</DL>
<HR>
<DL>
<DT>public abstract class <B>ValidatorHandler</B><DT>extends java.lang.Object<DT>implements org.xml.sax.ContentHandler</DL>
<P>
Streaming validator that works on SAX stream.
<p>
A <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> object is a thread-unsafe, non-reentrant object.
In other words, it is the application's responsibility to make
sure that one <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> object is not used from
more than one thread at any given time.
<p>
<A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> checks if the SAX events follow
the set of constraints described in the associated <A HREF="../../../javax/xml/validation/Schema.html" title="class in javax.xml.validation"><CODE>Schema</CODE></A>,
and additionally it may modify the SAX events (for example
by adding default values, etc.)
<p>
<A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> extends from <CODE>ContentHandler</CODE>,
but it refines the underlying <CODE>ContentHandler</CODE> in
the following way:
<ol>
<li>startElement/endElement events must receive non-null String
for <code>uri</code>, <code>localName</code>, and <code>qname</code>,
even though SAX allows some of them to be null.
Similarly, the user-specified <CODE>ContentHandler</CODE> will receive non-null
Strings for all three parameters.
<li>Applications must ensure that <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>'s
<CODE>ContentHandler.startPrefixMapping(String,String)</CODE> and
<CODE>ContentHandler.endPrefixMapping(String)</CODE> are invoked
properly. Similarly, the user-specified <CODE>ContentHandler</CODE>
will receive startPrefixMapping/endPrefixMapping events.
If the <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> introduces additional namespace
bindings, the user-specified <CODE>ContentHandler</CODE> will receive
additional startPrefixMapping/endPrefixMapping events.
<li><CODE>Attributes</CODE> for the
<CODE>ContentHandler.startElement(String,String,String,Attributes)</CODE> method
may or may not include xmlns* attributes.
</ol>
<p>
A <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> is automatically reset every time
the startDocument method is invoked.
<h2>Recognized Properties and Features</h2>
<p>
This spec defines the following feature that must be recognized
by all <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> implementations.
<h3><code>http://xml.org/sax/features/namespace-prefixes</code></h3>
<p>
This feature controls how a <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> introduces
namespace bindings that were not present in the original SAX event
stream.
When this feature is set to true, it must make
sure that the user's <CODE>ContentHandler</CODE> will see
the corresponding <code>xmlns*</code> attribute in
the <CODE>Attributes</CODE> object of the
<CODE>ContentHandler.startElement(String,String,String,Attributes)</CODE>
callback. Otherwise, <code>xmlns*</code> attributes must not be
added to <CODE>Attributes</CODE> that's passed to the
user-specified <CODE>ContentHandler</CODE>.
<p>
(Note that regardless of this switch, namespace bindings are
always notified to applications through
<CODE>ContentHandler.startPrefixMapping(String,String)</CODE> and
<CODE>ContentHandler.endPrefixMapping(String)</CODE> methods of the
<CODE>ContentHandler</CODE> specified by the user.)
<p>
Note that this feature does <em>NOT</em> affect the way
a <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> receives SAX events. It merely
changes the way it augments SAX events.
<p>This feature is set to <code>false</code> by default.</p>
<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/ValidatorHandler.html#ValidatorHandler()">ValidatorHandler</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.ContentHandler</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/ValidatorHandler.html#getContentHandler()">getContentHandler</A></B>()</CODE>
<BR>
Gets the <CODE>ContentHandler</CODE> which receives the
augmented validation result.</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/ValidatorHandler.html#getErrorHandler()">getErrorHandler</A></B>()</CODE>
<BR>
Gets the current <CODE>ErrorHandler</CODE> set to this <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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/ValidatorHandler.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/ValidatorHandler.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/ValidatorHandler.html#getResourceResolver()">getResourceResolver</A></B>()</CODE>
<BR>
Gets the current <CODE>LSResourceResolver</CODE> set to this <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract <A HREF="../../../javax/xml/validation/TypeInfoProvider.html" title="class in javax.xml.validation">TypeInfoProvider</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/validation/ValidatorHandler.html#getTypeInfoProvider()">getTypeInfoProvider</A></B>()</CODE>
<BR>
Obtains the <A HREF="../../../javax/xml/validation/TypeInfoProvider.html" title="class in javax.xml.validation"><CODE>TypeInfoProvider</CODE></A> implementation of this
<A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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/ValidatorHandler.html#setContentHandler(org.xml.sax.ContentHandler)">setContentHandler</A></B>(org.xml.sax.ContentHandler receiver)</CODE>
<BR>
Sets the <CODE>ContentHandler</CODE> which receives
the augmented validation result.</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/ValidatorHandler.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 validation.</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/ValidatorHandler.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/ValidatorHandler.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/ValidatorHandler.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>
</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>
<A NAME="methods_inherited_from_class_org.xml.sax.ContentHandler"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from interface org.xml.sax.ContentHandler</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping</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="ValidatorHandler()"><!-- --></A><H3>
ValidatorHandler</H3>
<PRE>
protected <B>ValidatorHandler</B>()</PRE>
<DL>
<DD>Constructor for derived classes.
<p>
The constructor does nothing.
<p>
Derived classes must create <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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="setContentHandler(org.xml.sax.ContentHandler)"><!-- --></A><H3>
setContentHandler</H3>
<PRE>
public abstract void <B>setContentHandler</B>(org.xml.sax.ContentHandler receiver)</PRE>
<DL>
<DD>Sets the <CODE>ContentHandler</CODE> which receives
the augmented validation result.
<p>
When a <CODE>ContentHandler</CODE> is specified, a
<A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> will work as a filter
and basically copy the incoming events to the
specified <CODE>ContentHandler</CODE>.
<p>
In doing so, a <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> may modify
the events, for example by adding defaulted attributes.
<p>
A <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> may buffer events to certain
extent, but to allow <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> to be used
by a parser, the following requirement has to be met.
<ol>
<li>When
<CODE>ContentHandler.startElement(String, String, String, Attributes)</CODE>,
<CODE>ContentHandler.endElement(String, String, String)</CODE>,
<CODE>ContentHandler.startDocument()</CODE>, or
<CODE>ContentHandler.endDocument()</CODE>
are invoked on a <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>,
the same method on the user-specified <CODE>ContentHandler</CODE>
must be invoked for the same event before the callback
returns.
<li><A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> may not introduce new elements that
were not present in the input.
<li><A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> may not remove attributes that were
present in the input.
</ol>
<p>
When a callback method on the specified <CODE>ContentHandler</CODE>
throws an exception, the same exception object must be thrown
from the <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>. The <CODE>ErrorHandler</CODE>
should not be notified of such an exception.
<p>
This method can be called even during a middle of a validation.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>receiver</CODE> - A <CODE>ContentHandler</CODE> or a null value.</DL>
</DD>
</DL>
<HR>
<A NAME="getContentHandler()"><!-- --></A><H3>
getContentHandler</H3>
<PRE>
public abstract org.xml.sax.ContentHandler <B>getContentHandler</B>()</PRE>
<DL>
<DD>Gets the <CODE>ContentHandler</CODE> which receives the
augmented validation result.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>This method returns the object that was last set through
the <A HREF="../../../javax/xml/validation/ValidatorHandler.html#getContentHandler()"><CODE>getContentHandler()</CODE></A> method, or null
if that method has never been called since this <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>
has created.<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/validation/ValidatorHandler.html#setContentHandler(org.xml.sax.ContentHandler)"><CODE>setContentHandler(ContentHandler)</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 validation.
<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 same <CODE>Throwable</CODE> object will be thrown toward the
root of the call stack.
<p>
<A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> object is created, initially
this field is set to null.
<P>
<DD><DL>
</DL>
</DD>
<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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>This method returns the object that was last set through
the <A HREF="../../../javax/xml/validation/ValidatorHandler.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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>
has created.<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/validation/ValidatorHandler.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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A> object is created, initially
this field is set to null.
<P>
<DD><DL>
</DL>
</DD>
<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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>This method returns the object that was last set through
the <A HREF="../../../javax/xml/validation/ValidatorHandler.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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>
has created.<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/validation/ValidatorHandler.html#setErrorHandler(org.xml.sax.ErrorHandler)"><CODE>setErrorHandler(ErrorHandler)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getTypeInfoProvider()"><!-- --></A><H3>
getTypeInfoProvider</H3>
<PRE>
public abstract <A HREF="../../../javax/xml/validation/TypeInfoProvider.html" title="class in javax.xml.validation">TypeInfoProvider</A> <B>getTypeInfoProvider</B>()</PRE>
<DL>
<DD>Obtains the <A HREF="../../../javax/xml/validation/TypeInfoProvider.html" title="class in javax.xml.validation"><CODE>TypeInfoProvider</CODE></A> implementation of this
<A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>.
<p>
The obtained <A HREF="../../../javax/xml/validation/TypeInfoProvider.html" title="class in javax.xml.validation"><CODE>TypeInfoProvider</CODE></A> can be queried during a parse
to access the type information determined by the validator.
<p>
Some schema languages do not define the notion of type,
for those languages, this method may not be supported.
However, to be compliant with this specification, implementations
for W3C XML Schema 1.0 must support this operation.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>null if the validator / schema language does not support
the notion of <CODE>TypeInfo</CODE>.
Otherwise a non-null valid <A HREF="../../../javax/xml/validation/TypeInfoProvider.html" title="class in javax.xml.validation"><CODE>TypeInfoProvider</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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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>
</DL>
</DD>
<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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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/ValidatorHandler.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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>
parses schemas, although <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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>
</DL>
</DD>
<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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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/ValidatorHandler.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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</CODE></A>s are not required to recognize setting
any specific property names.</p>
<P>
<DD><DL>
</DL>
</DD>
<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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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/ValidatorHandler.html" title="class in javax.xml.validation"><CODE>ValidatorHandler</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>
</DL>
</DD>
<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/ValidatorHandler.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/Validator.html" title="class in javax.xml.validation"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="ValidatorHandler.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>
|