⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 entityresolver.html

📁 SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Jan 17 03:51:42 PST 2002 -->
<TITLE>
Java 2 Platform EE v1.3: Interface  EntityResolver
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../org/xml/sax/DTDHandler.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/xml/sax/ErrorHandler.html"><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>  &nbsp;
&nbsp;<A HREF="EntityResolver.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.xml.sax</FONT>
<BR>
Interface  EntityResolver</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../org/xml/sax/HandlerBase.html">HandlerBase</A>, <A HREF="../../../org/xml/sax/helpers/XMLFilterImpl.html">XMLFilterImpl</A>, <A HREF="../../../org/xml/sax/helpers/DefaultHandler.html">DefaultHandler</A></DD>
</DL>
<HR>
<DL>
<DT>public interface <B>EntityResolver</B></DL>

<P>
Basic interface for resolving entities.

 <blockquote>
 <em>This module, both source code and documentation, is in the
 Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
 </blockquote>

 <p>If a SAX application needs to implement customized handling
 for external entities, it must implement this interface and
 register an instance with the SAX driver using the
 <A HREF="../../../org/xml/sax/XMLReader.html#setEntityResolver(org.xml.sax.EntityResolver)"><CODE>setEntityResolver</CODE></A>
 method.</p>

 <p>The XML reader will then allow the application to intercept any
 external entities (including the external DTD subset and external
 parameter entities, if any) before including them.</p>

 <p>Many SAX applications will not need to implement this interface,
 but it will be especially useful for applications that build
 XML documents from databases or other specialised input sources,
 or for applications that use URI types other than URLs.</p>

 <p>The following resolver would provide the application
 with a special character stream for the entity with the system
 identifier "http://www.myhost.com/today":</p>

 <pre>
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;

 public class MyResolver implements EntityResolver {
   public InputSource resolveEntity (String publicId, String systemId)
   {
     if (systemId.equals("http://www.myhost.com/today")) {
              // return a special input source
       MyReader reader = new MyReader();
       return new InputSource(reader);
     } else {
              // use the default behaviour
       return null;
     }
   }
 }
 </pre>

 <p>The application can also use this interface to redirect system
 identifiers to local URIs or to look up replacements in a catalog
 (possibly by using the public identifier).</p>
<P>
<DL>
<DT><B>Since: </B><DD>SAX 1.0</DD>
<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/Parser.html#setEntityResolver(org.xml.sax.EntityResolver)"><CODE>Parser.setEntityResolver(org.xml.sax.EntityResolver)</CODE></A>, 
<A HREF="../../../org/xml/sax/InputSource.html"><CODE>InputSource</CODE></A></DL>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->


<!-- ======== CONSTRUCTOR SUMMARY ======== -->


<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<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>&nbsp;<A HREF="../../../org/xml/sax/InputSource.html">InputSource</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/xml/sax/EntityResolver.html#resolveEntity(java.lang.String, java.lang.String)">resolveEntity</A></B>(java.lang.String&nbsp;publicId,
              java.lang.String&nbsp;systemId)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allow the application to resolve external entities.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->


<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="resolveEntity(java.lang.String, java.lang.String)"><!-- --></A><H3>
resolveEntity</H3>
<PRE>
public <A HREF="../../../org/xml/sax/InputSource.html">InputSource</A> <B>resolveEntity</B>(java.lang.String&nbsp;publicId,
                                 java.lang.String&nbsp;systemId)
                          throws <A HREF="../../../org/xml/sax/SAXException.html">SAXException</A>,
                                 java.io.IOException</PRE>
<DL>
<DD>Allow the application to resolve external entities.

 <p>The Parser will call this method before opening any external
 entity except the top-level document entity (including the
 external DTD subset, external entities referenced within the
 DTD, and external entities referenced within the document
 element): the application may request that the parser resolve
 the entity itself, that it use an alternative URI, or that it
 use an entirely different input source.</p>

 <p>Application writers can use this method to redirect external
 system identifiers to secure and/or local URIs, to look up
 public identifiers in a catalogue, or to read an entity from a
 database or other input source (including, for example, a dialog
 box).</p>

 <p>If the system identifier is a URL, the SAX parser must
 resolve it fully before reporting it to the application.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>publicId</CODE> - The public identifier of the external entity
        being referenced, or null if none was supplied.<DD><CODE>systemId</CODE> - The system identifier of the external entity
        being referenced.<DT><B>Returns:</B><DD>An InputSource object describing the new input source,
         or null to request that the parser open a regular
         URI connection to the system identifier.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/xml/sax/SAXException.html">SAXException</A></CODE> - Any SAX exception, possibly
            wrapping another exception.<DD><CODE>java.io.IOException</CODE> - A Java-specific IO exception,
            possibly the result of creating a new InputStream
            or Reader for the InputSource.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/InputSource.html"><CODE>InputSource</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../org/xml/sax/DTDHandler.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/xml/sax/ErrorHandler.html"><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>  &nbsp;
&nbsp;<A HREF="EntityResolver.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>

</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -