Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * $Id$
  3. * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
  4. * For details on use and redistribution please refer to the
  5. * LICENSE file included with these sources.
  6. */
  7. package org.apache.fop.apps;
  8. // Imported SAX classes
  9. import org.xml.sax.InputSource;
  10. import org.xml.sax.XMLReader;
  11. // java
  12. import java.io.File;
  13. import java.net.URL;
  14. /**
  15. * Manages input if it is an xsl:fo file
  16. */
  17. public class FOInputHandler extends InputHandler {
  18. File fofile = null;
  19. URL foURL = null;
  20. public FOInputHandler (File fofile) {
  21. this.fofile = fofile;
  22. }
  23. public FOInputHandler (URL url) {
  24. this.foURL = url;
  25. }
  26. public InputSource getInputSource () {
  27. if (fofile != null) {
  28. return super.fileInputSource(fofile);
  29. }
  30. return super.urlInputSource(foURL);
  31. }
  32. public XMLReader getParser() throws FOPException {
  33. return super.createParser();
  34. }
  35. }