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.

AbstractIFDocumentHandler.java 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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.render.intermediate;
  19. import org.apache.commons.logging.Log;
  20. import org.apache.commons.logging.LogFactory;
  21. import org.apache.fop.apps.FOUserAgent;
  22. /**
  23. * Abstract base class for {@code IFDocumentHandler} implementations.
  24. */
  25. public abstract class AbstractIFDocumentHandler implements IFDocumentHandler {
  26. /** logging instance */
  27. private static Log log = LogFactory.getLog(AbstractIFDocumentHandler.class);
  28. private FOUserAgent userAgent;
  29. /**
  30. * Default constructor.
  31. */
  32. public AbstractIFDocumentHandler() {
  33. }
  34. /** {@inheritDoc} */
  35. public void setUserAgent(FOUserAgent ua) {
  36. if (this.userAgent != null) {
  37. throw new IllegalStateException("The user agent was already set");
  38. }
  39. this.userAgent = ua;
  40. }
  41. /** {@inheritDoc} */
  42. public FOUserAgent getUserAgent() {
  43. return this.userAgent;
  44. }
  45. /** {@inheritDoc} */
  46. public IFDocumentNavigationHandler getDocumentNavigationHandler() {
  47. return null; //By default, this is not supported
  48. }
  49. /** {@inheritDoc} */
  50. public void startDocumentHeader() throws IFException {
  51. //nop
  52. }
  53. /** {@inheritDoc} */
  54. public void endDocumentHeader() throws IFException {
  55. //nop
  56. }
  57. /** {@inheritDoc} */
  58. public void startDocumentTrailer() throws IFException {
  59. //nop
  60. }
  61. /** {@inheritDoc} */
  62. public void endDocumentTrailer() throws IFException {
  63. //nop
  64. }
  65. /** {@inheritDoc} */
  66. public void startPageHeader() throws IFException {
  67. //nop
  68. }
  69. /** {@inheritDoc} */
  70. public void endPageHeader() throws IFException {
  71. //nop
  72. }
  73. /** {@inheritDoc} */
  74. public void startPageTrailer() throws IFException {
  75. //nop
  76. }
  77. /** {@inheritDoc} */
  78. public void endPageTrailer() throws IFException {
  79. //nop
  80. }
  81. }