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.

TableEventProducer.java 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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.fo.flow.table;
  19. import org.xml.sax.Locator;
  20. import org.apache.fop.events.EventBroadcaster;
  21. import org.apache.fop.events.EventProducer;
  22. import org.apache.fop.events.model.AbstractEventModelFactory;
  23. import org.apache.fop.events.model.EventModel;
  24. import org.apache.fop.fo.ValidationException;
  25. import org.apache.fop.fo.expr.PropertyException;
  26. /**
  27. * Event producer interface for table-specific XSL-FO validation messages.
  28. */
  29. public interface TableEventProducer extends EventProducer {
  30. /** Provider class for the event producer. */
  31. class Provider {
  32. /**
  33. * Returns an event producer.
  34. * @param broadcaster the event broadcaster to use
  35. * @return the event producer
  36. */
  37. public static TableEventProducer get(EventBroadcaster broadcaster) {
  38. return (TableEventProducer)broadcaster.getEventProducerFor(
  39. TableEventProducer.class);
  40. }
  41. }
  42. /** Event model factory for Accessibility. */
  43. public static class EventModelFactory extends AbstractEventModelFactory {
  44. /** {@inheritDoc} */
  45. public EventModel createEventModel() {
  46. return loadModel(getClass(), "event-model.xml");
  47. }
  48. }
  49. /**
  50. * A value other than "auto" has been specified on fo:table.
  51. * @param source the event source
  52. * @param loc the location of the error or null
  53. * @event.severity WARN
  54. */
  55. void nonAutoBPDOnTable(Object source, Locator loc);
  56. /**
  57. * Padding on fo:table is ignored if the collapsing border model is active.
  58. * @param source the event source
  59. * @param loc the location of the error or null
  60. * @event.severity WARN
  61. */
  62. void noTablePaddingWithCollapsingBorderModel(Object source, Locator loc);
  63. /**
  64. * No mixing of table-rows and table-cells is allowed for direct children of table-body.
  65. * @param source the event source
  66. * @param elementName the name of the context node
  67. * @param loc the location of the error or null
  68. * @throws ValidationException the validation error provoked by the method call
  69. * @event.severity FATAL
  70. */
  71. void noMixRowsAndCells(Object source, String elementName, Locator loc)
  72. throws ValidationException;
  73. /**
  74. * The table-footer was found after the table-body. FOP cannot recover with collapsed border
  75. * model.
  76. * @param source the event source
  77. * @param elementName the name of the context node
  78. * @param loc the location of the error or null
  79. * @throws ValidationException the validation error provoked by the method call
  80. * @event.severity FATAL
  81. */
  82. void footerOrderCannotRecover(Object source, String elementName, Locator loc)
  83. throws ValidationException;
  84. /**
  85. * starts-row/ends-row for fo:table-cells non-applicable for children of an fo:table-row
  86. * @param source the event source
  87. * @param loc the location of the error or null
  88. * @event.severity WARN
  89. */
  90. void startEndRowUnderTableRowWarning(Object source, Locator loc);
  91. /**
  92. * Column-number or number of cells in the row overflows the number of fo:table-column
  93. * specified for the table.
  94. * @param source the event source
  95. * @param loc the location of the error or null
  96. * @throws ValidationException the validation error provoked by the method call
  97. * @event.severity FATAL
  98. */
  99. void tooManyCells(Object source, Locator loc) throws ValidationException;
  100. /**
  101. * Property value must be 1 or bigger.
  102. * @param source the event source
  103. * @param propName the property name
  104. * @param actualValue the actual value
  105. * @param loc the location of the error or null
  106. * @throws PropertyException the property error provoked by the method call
  107. * @event.severity FATAL
  108. */
  109. void valueMustBeBiggerGtEqOne(Object source, String propName,
  110. int actualValue, Locator loc) throws PropertyException;
  111. /**
  112. * table-layout=\"fixed\" and column-width unspecified
  113. * => falling back to proportional-column-width(1)
  114. * @param source the event source
  115. * @param loc the location of the error or null
  116. * @event.severity WARN
  117. */
  118. void warnImplicitColumns(Object source, Locator loc);
  119. /**
  120. * padding-* properties are not applicable.
  121. * @param source the event source
  122. * @param elementName the name of the context node
  123. * @param loc the location of the error or null
  124. * @event.severity WARN
  125. */
  126. void paddingNotApplicable(Object source, String elementName, Locator loc);
  127. /**
  128. * Cell overlap.
  129. * @param source the event source
  130. * @param elementName the name of the context node
  131. * @param column the column index of the overlapping cell
  132. * @param loc the location of the error or null
  133. * @throws PropertyException the property error provoked by the method call
  134. * @event.severity FATAL
  135. */
  136. void cellOverlap(Object source, String elementName, int column,
  137. Locator loc) throws PropertyException;
  138. /**
  139. * @param source the event source
  140. * @param elementName the name of the context node
  141. * @param propValue the user-specified value of the column-number property
  142. * @param columnNumber the generated value for the column-number property
  143. * @param loc the location of the error or null
  144. * @event.severity WARN
  145. */
  146. void forceNextColumnNumber(Object source, String elementName, Number propValue,
  147. int columnNumber, Locator loc);
  148. /**
  149. * Break ignored due to row spanning.
  150. * @param source the event source
  151. * @param elementName the name of the context node
  152. * @param breakBefore true for "break-before", false for "break-after"
  153. * @param loc the location of the error or null
  154. * @event.severity WARN
  155. */
  156. void breakIgnoredDueToRowSpanning(Object source, String elementName, boolean breakBefore,
  157. Locator loc);
  158. }