<!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.6.0_18) on Sun Jun 12 19:55:30 JST 2011 --> <TITLE> Validator (JAXP 1.4, DOM3, SAX2.0.2(sax2r3), StAX 1.0, SAC 1.3) </TITLE> <META NAME="date" CONTENT="2011-06-12"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Validator (JAXP 1.4, DOM3, SAX2.0.2(sax2r3), StAX 1.0, SAC 1.3)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= 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=2 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?javax/xml/validation/Validator.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><PRE>public abstract class <B>Validator</B><DT>extends java.lang.Object</DL> </PRE> <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>, <code>DOMSource</code>, <code>StAXSource</code> or <code>StreamSource</code>. <P> <P> <DL> <DT><B>Since:</B></DT> <DD>1.5</DD> <DT><B>Version:</B></DT> <DD>$Revision: 888884 $, $Date: 2009-12-09 19:36:46 +0200 (Wed, 09 Dec 2009) $</DD> <DT><B>Author:</B></DT> <DD><a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a></DD> </DL> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </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"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>abstract <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax">ErrorHandler</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#getErrorHandler()">getErrorHandler</A></B>()</CODE> <BR> Gets the current <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> 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 <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls">LSResourceResolver</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/validation/Validator.html#getResourceResolver()">getResourceResolver</A></B>()</CODE> <BR> Gets the current <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls"><CODE>LSResourceResolver</CODE></A> 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>(<A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax">ErrorHandler</A> errorHandler)</CODE> <BR> Sets the <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> 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>(<A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls">LSResourceResolver</A> resourceResolver)</CODE> <BR> Sets the <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls"><CODE>LSResourceResolver</CODE></A> 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"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </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> <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> and <tt>null</tt> <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls"><CODE>LSResourceResolver</CODE></A>. <P> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </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 <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls"><CODE>LSResourceResolver</CODE></A> or <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> <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 <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A>, 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><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></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 <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A>, 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> <td><A HREF="../../../javax/xml/transform/stax/StAXSource.html" title="class in javax.xml.transform.stax"><CODE>StAXSource</CODE></A></td> <td><A HREF="../../../javax/xml/transform/stream/StreamSource.html" title="class in javax.xml.transform.stream"><CODE>StreamSource</CODE></A></td> </tr> </thead> <tbody> <tr> <td><tt>null</tt></td> <td>OK</td> <td>OK</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> <td>Err</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> <td>Err</td> <td>Err</td> </tr> <tr> <td><A HREF="../../../javax/xml/transform/stax/StAXResult.html" title="class in javax.xml.transform.stax"><CODE>StAXResult</CODE></A></td> <td>Err</td> <td>Err</td> <td>OK</td> <td>Err</td> </tr> <tr> <td><A HREF="../../../javax/xml/transform/stream/StreamResult.html" title="class in javax.xml.transform.stream"><CODE>StreamResult</CODE></A></td> <td>Err</td> <td>Err</td> <td>Err</td> <td>OK</td> </tr> </tbody> </table> <p> 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 <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A>. <p> If a document is valid, or if a document contains some errors but none of them were fatal and the <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> 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 not a <A HREF="../../../javax/xml/transform/sax/SAXSource.html" title="class in javax.xml.transform.sax"><CODE>SAXSource</CODE></A>, <A HREF="../../../javax/xml/transform/dom/DOMSource.html" title="class in javax.xml.transform.dom"><CODE>DOMSource</CODE></A>, <A HREF="../../../javax/xml/transform/stax/StAXSource.html" title="class in javax.xml.transform.stax"><CODE>StAXSource</CODE></A> or <A HREF="../../../javax/xml/transform/stream/StreamSource.html" title="class in javax.xml.transform.stream"><CODE>StreamSource</CODE></A>. <DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - If the <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> throws a <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax"><CODE>SAXException</CODE></A> or if a fatal error is found and the <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> 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 <A HREF="../../../org/xml/sax/XMLReader.html" title="interface in org.xml.sax"><CODE>XMLReader</CODE></A> 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>(<A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax">ErrorHandler</A> errorHandler)</PRE> <DL> <DD>Sets the <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> 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 <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> is set, errors found during the validation will be first sent to the <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A>. <p> The error handler can abort further validation immediately by throwing <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax"><CODE>SAXException</CODE></A> 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 <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> <p> If any <CODE>Throwable</CODE> is thrown from an <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A>, 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 <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax"><CODE>SAXException</CODE></A> without first reporting it to <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A>. <p> When the <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> is null, the implementation will behave as if the following <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> is set: <pre> class DraconianErrorHandler implements <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> { public void fatalError( <A HREF="../../../org/xml/sax/SAXParseException.html" title="class in org.xml.sax"><CODE>SAXParseException</CODE></A> e ) throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax"><CODE>SAXException</CODE></A> { throw e; } public void error( <A HREF="../../../org/xml/sax/SAXParseException.html" title="class in org.xml.sax"><CODE>SAXParseException</CODE></A> e ) throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax"><CODE>SAXException</CODE></A> { throw e; } public void warning( <A HREF="../../../org/xml/sax/SAXParseException.html" title="class in org.xml.sax"><CODE>SAXParseException</CODE></A> e ) throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax"><CODE>SAXException</CODE></A> { // 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 <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax">ErrorHandler</A> <B>getErrorHandler</B>()</PRE> <DL> <DD>Gets the current <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> 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>(<A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls">LSResourceResolver</A> resourceResolver)</PRE> <DL> <DD>Sets the <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls"><CODE>LSResourceResolver</CODE></A> 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 <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls"><CODE>LSResourceResolver</CODE></A> 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 <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls"><CODE>LSResourceResolver</CODE></A> is null, the implementation will behave as if the following <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls"><CODE>LSResourceResolver</CODE></A> is set: <pre> class DumbLSResourceResolver implements <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls"><CODE>LSResourceResolver</CODE></A> { public <A HREF="../../../org/w3c/dom/ls/LSInput.html" title="interface in org.w3c.dom.ls"><CODE>LSInput</CODE></A> resolveResource( String publicId, String systemId, String baseURI) { return null; // always return null } } </pre> <p> If a <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls"><CODE>LSResourceResolver</CODE></A> 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 <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls">LSResourceResolver</A> <B>getResourceResolver</B>()</PRE> <DL> <DD>Gets the current <A HREF="../../../org/w3c/dom/ls/LSResourceResolver.html" title="interface in org.w3c.dom.ls"><CODE>LSResourceResolver</CODE></A> 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 <A HREF="../../../org/xml/sax/SAXNotRecognizedException.html" title="class in org.xml.sax">SAXNotRecognizedException</A>, <A HREF="../../../org/xml/sax/SAXNotSupportedException.html" title="class in org.xml.sax">SAXNotSupportedException</A></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><A HREF="../../../org/xml/sax/SAXNotRecognizedException.html" title="class in org.xml.sax">SAXNotRecognizedException</A></CODE> - If the feature value can't be assigned or retrieved. <DD><CODE><A HREF="../../../org/xml/sax/SAXNotSupportedException.html" title="class in org.xml.sax">SAXNotSupportedException</A></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 <A HREF="../../../org/xml/sax/SAXNotRecognizedException.html" title="class in org.xml.sax">SAXNotRecognizedException</A>, <A HREF="../../../org/xml/sax/SAXNotSupportedException.html" title="class in org.xml.sax">SAXNotSupportedException</A></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><A HREF="../../../org/xml/sax/SAXNotRecognizedException.html" title="class in org.xml.sax">SAXNotRecognizedException</A></CODE> - If the feature value can't be assigned or retrieved. <DD><CODE><A HREF="../../../org/xml/sax/SAXNotSupportedException.html" title="class in org.xml.sax">SAXNotSupportedException</A></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 <A HREF="../../../org/xml/sax/SAXNotRecognizedException.html" title="class in org.xml.sax">SAXNotRecognizedException</A>, <A HREF="../../../org/xml/sax/SAXNotSupportedException.html" title="class in org.xml.sax">SAXNotSupportedException</A></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><A HREF="../../../org/xml/sax/SAXNotRecognizedException.html" title="class in org.xml.sax">SAXNotRecognizedException</A></CODE> - If the property value can't be assigned or retrieved. <DD><CODE><A HREF="../../../org/xml/sax/SAXNotSupportedException.html" title="class in org.xml.sax">SAXNotSupportedException</A></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 <A HREF="../../../org/xml/sax/SAXNotRecognizedException.html" title="class in org.xml.sax">SAXNotRecognizedException</A>, <A HREF="../../../org/xml/sax/SAXNotSupportedException.html" title="class in org.xml.sax">SAXNotSupportedException</A></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><A HREF="../../../org/xml/sax/SAXNotRecognizedException.html" title="class in org.xml.sax">SAXNotRecognizedException</A></CODE> - If the property value can't be assigned or retrieved. <DD><CODE><A HREF="../../../org/xml/sax/SAXNotSupportedException.html" title="class in org.xml.sax">SAXNotSupportedException</A></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=2 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?javax/xml/validation/Validator.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>