選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

FOInputHandler.java 936B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * $Id$
  3. * Copyright (C) 2001 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. return super.urlInputSource(foURL);
  30. }
  31. public XMLReader getParser() throws FOPException {
  32. return super.createParser();
  33. }
  34. }