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.

DocumentInputSource.java 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* $Id$ */
  17. package org.apache.fop.tools;
  18. import org.w3c.dom.Document;
  19. import org.xml.sax.InputSource;
  20. /**
  21. * This is an InputSource to be used with DocumentReader.
  22. *
  23. * @author Kelly A Campbell
  24. */
  25. public class DocumentInputSource extends InputSource {
  26. private Document document;
  27. /**
  28. * Default constructor.
  29. */
  30. public DocumentInputSource() {
  31. super();
  32. }
  33. /**
  34. * Main constructor
  35. * @param document the DOM document to use as input
  36. */
  37. public DocumentInputSource(Document document) {
  38. this();
  39. setDocument(document);
  40. }
  41. /**
  42. * Returns the input document.
  43. * @return the input DOM document.
  44. */
  45. public Document getDocument() {
  46. return this.document;
  47. }
  48. /**
  49. * Sets the input document.
  50. * @param document the DOM document to use as input
  51. */
  52. public void setDocument(Document document) {
  53. this.document = document;
  54. }
  55. }