src/javax/xml/transform/ErrorListener.java

Print this page




  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.xml.transform;
  27 
  28 /**
  29  * <p>To provide customized error handling, implement this interface and
  30  * use the <code>setErrorListener</code> method to register an instance of the
  31  * implmentation with the {@link javax.xml.transform.Transformer}.  The
  32  * <code>Transformer</code> then reports all errors and warnings through this
  33  * interface.</p>
  34  *
  35  * <p>If an application does <em>not</em> register its own custom
  36  * <code>ErrorListener</code>, the default <code>ErrorListener</code>
  37  * is used which reports all warnings and errors to <code>System.err</code>
  38  * and does not throw any <code>Exception</code>s.
  39  * Applications are <em>strongly</em> encouraged to register and use
  40  * <code>ErrorListener</code>s that insure proper behavior for warnings and
  41  * errors.</p>
  42  *
  43  * <p>For transformation errors, a <code>Transformer</code> must use this
  44  * interface instead of throwing an <code>Exception</code>: it is up to the
  45  * application to decide whether to throw an <code>Exception</code> for
  46  * different types of errors and warnings.  Note however that the
  47  * <code>Transformer</code> is not required to continue with the transformation
  48  * after a call to {@link #fatalError(TransformerException exception)}.</p>
  49  *
  50  * <p><code>Transformer</code>s may use this mechanism to report XML parsing
  51  * errors as well as transformation errors.</p>




  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.xml.transform;
  27 
  28 /**
  29  * <p>To provide customized error handling, implement this interface and
  30  * use the <code>setErrorListener</code> method to register an instance of the
  31  * implementation with the {@link javax.xml.transform.Transformer}.  The
  32  * <code>Transformer</code> then reports all errors and warnings through this
  33  * interface.</p>
  34  *
  35  * <p>If an application does <em>not</em> register its own custom
  36  * <code>ErrorListener</code>, the default <code>ErrorListener</code>
  37  * is used which reports all warnings and errors to <code>System.err</code>
  38  * and does not throw any <code>Exception</code>s.
  39  * Applications are <em>strongly</em> encouraged to register and use
  40  * <code>ErrorListener</code>s that insure proper behavior for warnings and
  41  * errors.</p>
  42  *
  43  * <p>For transformation errors, a <code>Transformer</code> must use this
  44  * interface instead of throwing an <code>Exception</code>: it is up to the
  45  * application to decide whether to throw an <code>Exception</code> for
  46  * different types of errors and warnings.  Note however that the
  47  * <code>Transformer</code> is not required to continue with the transformation
  48  * after a call to {@link #fatalError(TransformerException exception)}.</p>
  49  *
  50  * <p><code>Transformer</code>s may use this mechanism to report XML parsing
  51  * errors as well as transformation errors.</p>