You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ResourceEventProducer.java 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.events;
  19. import java.io.File;
  20. import java.io.FileNotFoundException;
  21. import java.io.IOException;
  22. import org.w3c.dom.Document;
  23. import org.xml.sax.Locator;
  24. import org.apache.xmlgraphics.image.loader.ImageException;
  25. /**
  26. * Event producer interface for resource events (missing images, fonts etc.).
  27. */
  28. public interface ResourceEventProducer extends EventProducer {
  29. /**
  30. * Provider class for the event producer.
  31. */
  32. class Provider {
  33. /**
  34. * Returns an event producer.
  35. * @param broadcaster the event broadcaster to use
  36. * @return the requested event producer
  37. */
  38. public static ResourceEventProducer get(EventBroadcaster broadcaster) {
  39. return (ResourceEventProducer)broadcaster.getEventProducerFor(
  40. ResourceEventProducer.class);
  41. }
  42. }
  43. /**
  44. * Image not found.
  45. * @param source the event source
  46. * @param uri the original URI of the image
  47. * @param fnfe the "file not found" exception
  48. * @param loc the location of the error or null
  49. * @event.severity ERROR
  50. */
  51. void imageNotFound(Object source, String uri, FileNotFoundException fnfe, Locator loc);
  52. /**
  53. * Error while processing image.
  54. * @param source the event source
  55. * @param uri the original URI of the image
  56. * @param e the image exception
  57. * @param loc the location of the error or null
  58. * @event.severity ERROR
  59. */
  60. void imageError(Object source, String uri, ImageException e, Locator loc);
  61. /**
  62. * I/O error while loading an image.
  63. * @param source the event source
  64. * @param uri the original URI of the image
  65. * @param ioe the I/O exception
  66. * @param loc the location of the error or null
  67. * @event.severity ERROR
  68. */
  69. void imageIOError(Object source, String uri, IOException ioe, Locator loc);
  70. /**
  71. * Error while writing/serializing an image to an output format.
  72. * @param source the event source
  73. * @param e the original exception
  74. * @event.severity ERROR
  75. */
  76. void imageWritingError(Object source, Exception e);
  77. /**
  78. * Error while handling a URI.
  79. * @param source the event source
  80. * @param uri the original URI of the image
  81. * @param e the original exception
  82. * @param loc the location of the error or null
  83. * @event.severity ERROR
  84. */
  85. void uriError(Object source, String uri, Exception e, Locator loc);
  86. /**
  87. * Intrinsic size of fo:instream-foreign-object could not be determined.
  88. * @param source the event source
  89. * @param loc the location of the error or null
  90. * @event.severity ERROR
  91. */
  92. void ifoNoIntrinsicSize(Object source, Locator loc);
  93. /**
  94. * Error processing foreign XML content.
  95. * @param source the event source
  96. * @param doc the foreign XML
  97. * @param namespaceURI the namespace URI of the foreign XML
  98. * @param e the original exception
  99. * @event.severity ERROR
  100. */
  101. void foreignXMLProcessingError(Object source, Document doc, String namespaceURI, Exception e);
  102. /**
  103. * No handler for foreign XML content.
  104. * @param source the event source
  105. * @param doc the foreign XML
  106. * @param namespaceURI the namespace URI of the foreign XML
  107. * @event.severity ERROR
  108. */
  109. void foreignXMLNoHandler(Object source, Document doc, String namespaceURI);
  110. /**
  111. * Cannot delete a temporary file.
  112. * @param source the event source
  113. * @param tempFile the temporary file
  114. * @event.severity ERROR
  115. */
  116. void cannotDeleteTempFile(Object source, File tempFile);
  117. }