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.

StructureHandler.java 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. /*
  2. * $Id: StructureHandler.java,v 1.7 2003/02/27 10:13:07 jeremias Exp $
  3. * ============================================================================
  4. * The Apache Software License, Version 1.1
  5. * ============================================================================
  6. *
  7. * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without modifica-
  10. * tion, are permitted provided that the following conditions are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright notice,
  13. * this list of conditions and the following disclaimer.
  14. *
  15. * 2. Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. *
  19. * 3. The end-user documentation included with the redistribution, if any, must
  20. * include the following acknowledgment: "This product includes software
  21. * developed by the Apache Software Foundation (http://www.apache.org/)."
  22. * Alternately, this acknowledgment may appear in the software itself, if
  23. * and wherever such third-party acknowledgments normally appear.
  24. *
  25. * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  26. * endorse or promote products derived from this software without prior
  27. * written permission. For written permission, please contact
  28. * apache@apache.org.
  29. *
  30. * 5. Products derived from this software may not be called "Apache", nor may
  31. * "Apache" appear in their name, without prior written permission of the
  32. * Apache Software Foundation.
  33. *
  34. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  35. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  36. * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  37. * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  38. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  39. * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  40. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  41. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  42. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  43. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  44. * ============================================================================
  45. *
  46. * This software consists of voluntary contributions made by many individuals
  47. * on behalf of the Apache Software Foundation and was originally created by
  48. * James Tauber <jtauber@jtauber.com>. For more information on the Apache
  49. * Software Foundation, please see <http://www.apache.org/>.
  50. */
  51. package org.apache.fop.apps;
  52. // Java
  53. import java.util.Set;
  54. import java.util.HashSet;
  55. // Avalon
  56. import org.apache.avalon.framework.logger.AbstractLogEnabled;
  57. // FOP
  58. import org.apache.fop.fo.Title;
  59. import org.apache.fop.fo.flow.Block;
  60. import org.apache.fop.fo.flow.ExternalGraphic;
  61. import org.apache.fop.fo.flow.Flow;
  62. import org.apache.fop.fo.flow.InstreamForeignObject;
  63. import org.apache.fop.fo.flow.Leader;
  64. import org.apache.fop.fo.flow.ListBlock;
  65. import org.apache.fop.fo.flow.ListItem;
  66. import org.apache.fop.fo.flow.Table;
  67. import org.apache.fop.fo.flow.TableBody;
  68. import org.apache.fop.fo.flow.TableCell;
  69. import org.apache.fop.fo.flow.TableRow;
  70. import org.apache.fop.fo.pagination.LayoutMasterSet;
  71. import org.apache.fop.fo.pagination.PageSequence;
  72. import org.apache.fop.layout.FontInfo;
  73. import org.xml.sax.SAXException;
  74. /**
  75. * This class receives structure events from the FO Tree.
  76. * Sub-classes can then implement various methods to handle
  77. * the FO Tree when the SAX events occur.
  78. */
  79. public class StructureHandler extends AbstractLogEnabled {
  80. /**
  81. * The current set of id's in the FO tree.
  82. * This is used so we know if the FO tree contains duplicates.
  83. */
  84. private Set idReferences = new HashSet();
  85. /**
  86. * Main constructor
  87. */
  88. public StructureHandler() {
  89. }
  90. /**
  91. * Retuns the set of ID references.
  92. * @return the ID references
  93. */
  94. public Set getIDReferences() {
  95. return idReferences;
  96. }
  97. /**
  98. * Returns the FontInfo object associated with this StructureHandler.
  99. * @return the FontInof object
  100. */
  101. public FontInfo getFontInfo() {
  102. return null;
  103. }
  104. /**
  105. * This method is called to indicate the start of a new document run.
  106. * @throws SAXException In case of a problem
  107. */
  108. public void startDocument() throws SAXException {
  109. }
  110. /**
  111. * This method is called to indicate the end of a document run.
  112. * @throws SAXException In case of a problem
  113. */
  114. public void endDocument() throws SAXException {
  115. }
  116. public void startPageSequence(PageSequence pageSeq, Title seqTitle, LayoutMasterSet lms) {
  117. }
  118. public void endPageSequence(PageSequence pageSeq) throws FOPException {
  119. }
  120. public void startFlow(Flow fl) {
  121. }
  122. public void endFlow(Flow fl) {
  123. }
  124. public void startBlock(Block bl) {
  125. }
  126. public void endBlock(Block bl) {
  127. }
  128. // Tables
  129. public void startTable(Table tbl) {
  130. }
  131. public void endTable(Table tbl) {
  132. }
  133. public void startHeader(TableBody th) {
  134. }
  135. public void endHeader(TableBody th) {
  136. }
  137. public void startFooter(TableBody tf) {
  138. }
  139. public void endFooter(TableBody tf) {
  140. }
  141. public void startBody(TableBody tb) {
  142. }
  143. public void endBody(TableBody tb) {
  144. }
  145. public void startRow(TableRow tr) {
  146. }
  147. public void endRow(TableRow tr) {
  148. }
  149. public void startCell(TableCell tc) {
  150. }
  151. public void endCell(TableCell tc) {
  152. }
  153. // Lists
  154. public void startList(ListBlock lb) {
  155. }
  156. public void endList(ListBlock lb) {
  157. }
  158. public void startListItem(ListItem li) {
  159. }
  160. public void endListItem(ListItem li) {
  161. }
  162. public void startListLabel() {
  163. }
  164. public void endListLabel() {
  165. }
  166. public void startListBody() {
  167. }
  168. public void endListBody() {
  169. }
  170. // Static Regions
  171. public void startStatic() {
  172. }
  173. public void endStatic() {
  174. }
  175. public void startMarkup() {
  176. }
  177. public void endMarkup() {
  178. }
  179. public void startLink() {
  180. }
  181. public void endLink() {
  182. }
  183. public void image(ExternalGraphic eg) {
  184. }
  185. public void pageRef() {
  186. }
  187. public void foreignObject(InstreamForeignObject ifo) {
  188. }
  189. public void footnote() {
  190. }
  191. public void leader(Leader l) {
  192. }
  193. public void characters(char data[], int start, int length) {
  194. }
  195. public void pageBreak() {
  196. }
  197. }