ErrorListener


ErrorListener javax.xml.transform

Java 1.4

This interface defines methods that transformer and TRansformerFactory use for reporting warnings, errors, and fatal errors to an application. To use an ErrorListener , an application must implement this interface and pass an implementing object to the setErrorListener( ) method of transformer or transformerFactory . The argument to each method of this interface is a TRansformerException object, and the implementation of these methods can throw that exception if it chooses, or it can simply log the warning or error in some way and return. A transformer or transformerFactory is not required to continue processing after reporting a nonrecoverable error with an invocation of the fatalError( ) method.

If you are familiar with the SAX API for parsing XML documents, you'll recognize that this interface is very similar to org.xml.sax.ErrorHandler .

 public interface  ErrorListener  {  // Public Instance Methods  void  error  (TransformerException  exception  ) throws TransformerException;        void  fatalError  (TransformerException  exception  ) throws TransformerException;        void  warning  (TransformerException  exception  ) throws TransformerException;   } 

Passed To

transformer.setErrorListener( ) , transformerFactory.setErrorListener( )

Returned By

transformer.getErrorListener( ) , transformerFactory.getErrorListener( )



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net