Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

AbstractStructuredObject.java 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.afp.modca;
  19. import java.io.IOException;
  20. import java.io.OutputStream;
  21. /**
  22. * An abstract class encapsulating an MODCA structured object
  23. */
  24. public abstract class AbstractStructuredObject extends AbstractAFPObject {
  25. /**
  26. * Default constructor
  27. */
  28. protected AbstractStructuredObject() {
  29. }
  30. /**
  31. * Helper method to write the start of the Object.
  32. *
  33. * @param os The stream to write to
  34. * @throws IOException throws an I/O exception if one occurred
  35. */
  36. protected void writeStart(OutputStream os) throws IOException {
  37. }
  38. /**
  39. * Helper method to write the end of the Object.
  40. *
  41. * @param os The stream to write to
  42. * @throws IOException an I/O exception if one occurred
  43. */
  44. protected void writeEnd(OutputStream os) throws IOException {
  45. }
  46. /**
  47. * Helper method to write the contents of the Object.
  48. *
  49. * @param os The stream to write to
  50. * @throws IOException throws an I/O exception if one occurred
  51. */
  52. protected void writeContent(OutputStream os) throws IOException {
  53. }
  54. /** {@inheritDoc} */
  55. public void writeToStream(OutputStream os) throws IOException {
  56. writeStart(os);
  57. writeContent(os);
  58. writeEnd(os);
  59. }
  60. }