Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

ResourceEventProducer.java 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. import org.apache.fop.events.model.AbstractEventModelFactory;
  26. import org.apache.fop.events.model.EventModel;
  27. /**
  28. * Event producer interface for resource events (missing images, fonts etc.).
  29. */
  30. public interface ResourceEventProducer extends EventProducer {
  31. /**
  32. * Provider class for the event producer.
  33. */
  34. class Provider {
  35. /**
  36. * Returns an event producer.
  37. * @param broadcaster the event broadcaster to use
  38. * @return the requested event producer
  39. */
  40. public static ResourceEventProducer get(EventBroadcaster broadcaster) {
  41. return (ResourceEventProducer)broadcaster.getEventProducerFor(
  42. ResourceEventProducer.class);
  43. }
  44. }
  45. /** Event model factory for Accessibility. */
  46. public static class EventModelFactory extends AbstractEventModelFactory {
  47. /** {@inheritDoc} */
  48. public EventModel createEventModel() {
  49. return loadModel(getClass(), "event-model.xml");
  50. }
  51. }
  52. /**
  53. * Image not found.
  54. * @param source the event source
  55. * @param uri the original URI of the image
  56. * @param fnfe the "file not found" exception
  57. * @param loc the location of the error or null
  58. * @event.severity ERROR
  59. */
  60. void imageNotFound(Object source, String uri, FileNotFoundException fnfe, Locator loc);
  61. /**
  62. * Error while processing image.
  63. * @param source the event source
  64. * @param uri the original URI of the image
  65. * @param e the image exception
  66. * @param loc the location of the error or null
  67. * @event.severity ERROR
  68. */
  69. void imageError(Object source, String uri, ImageException e, Locator loc);
  70. /**
  71. * I/O error while loading an image.
  72. * @param source the event source
  73. * @param uri the original URI of the image
  74. * @param ioe the I/O exception
  75. * @param loc the location of the error or null
  76. * @event.severity ERROR
  77. */
  78. void imageIOError(Object source, String uri, IOException ioe, Locator loc);
  79. /**
  80. * Error while writing/serializing an image to an output format.
  81. * @param source the event source
  82. * @param e the original exception
  83. * @event.severity ERROR
  84. */
  85. void imageWritingError(Object source, Exception e);
  86. /**
  87. * Error while handling a URI.
  88. * @param source the event source
  89. * @param uri the original URI of the image
  90. * @param e the original exception
  91. * @param loc the location of the error or null
  92. * @event.severity ERROR
  93. */
  94. void uriError(Object source, String uri, Exception e, Locator loc);
  95. /**
  96. * Intrinsic size of fo:instream-foreign-object could not be determined.
  97. * @param source the event source
  98. * @param loc the location of the error or null
  99. * @event.severity ERROR
  100. */
  101. void ifoNoIntrinsicSize(Object source, Locator loc);
  102. /**
  103. * Error processing 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. * @param e the original exception
  108. * @event.severity ERROR
  109. */
  110. void foreignXMLProcessingError(Object source, Document doc, String namespaceURI, Exception e);
  111. /**
  112. * No handler for foreign XML content.
  113. * @param source the event source
  114. * @param doc the foreign XML
  115. * @param namespaceURI the namespace URI of the foreign XML
  116. * @event.severity ERROR
  117. */
  118. void foreignXMLNoHandler(Object source, Document doc, String namespaceURI);
  119. /**
  120. * Cannot delete a temporary file.
  121. * @param source the event source
  122. * @param tempFile the temporary file
  123. * @event.severity ERROR
  124. */
  125. void cannotDeleteTempFile(Object source, File tempFile);
  126. /**
  127. * Catalog Resolver not found along the class path
  128. * @param source the event source
  129. * @event.severity ERROR
  130. */
  131. void catalogResolverNotFound(Object source);
  132. /**
  133. * Catalog Resolver not created, due to InstantiationException or IllegalAccessException
  134. * @param source the event source
  135. * @param message the exception message
  136. * @event.severity ERROR
  137. */
  138. void catalogResolverNotCreated(Object source, String message);
  139. }