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.3KB

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