1. /*
  2. * @(#)IIOReadWarningListener.java 1.20 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.imageio.event;
  8. import java.util.EventListener;
  9. import javax.imageio.ImageReader;
  10. /**
  11. * An interface used by <code>ImageReader</code> implementations to
  12. * notify callers of their image and thumbnail reading methods of
  13. * warnings (non-fatal errors). Fatal errors cause the relevant
  14. * read method to throw an <code>IIOException</code>.
  15. *
  16. * <p> Localization is handled by associating a <code>Locale</code>
  17. * with each <code>IIOReadWarningListener</code> as it is registered
  18. * with an <code>ImageReader</code>. It is up to the
  19. * <code>ImageReader</code> to provide localized messages.
  20. *
  21. * @see javax.imageio.ImageReader#addIIOReadWarningListener
  22. * @see javax.imageio.ImageReader#removeIIOReadWarningListener
  23. *
  24. * @version 0.5
  25. */
  26. public interface IIOReadWarningListener extends EventListener {
  27. /**
  28. * Reports the occurence of a non-fatal error in decoding. Decoding
  29. * will continue following the call to this method. The application
  30. * may choose to display a dialog, print the warning to the console,
  31. * ignore the warning, or take any other action it chooses.
  32. *
  33. * @param source the <code>ImageReader</code> object calling this method.
  34. * @param warning a <code>String</code> containing the warning.
  35. */
  36. void warningOccurred(ImageReader source, String warning);
  37. }