Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ForeignObject.java 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.area.inline;
  19. import org.apache.fop.area.Area;
  20. import org.w3c.dom.Document;
  21. // cacheable object
  22. /**
  23. * Foreign object inline area.
  24. * This inline area represents an instream-foreign object.
  25. * This holds an xml document and the associated namespace.
  26. */
  27. public class ForeignObject extends Area {
  28. private static final long serialVersionUID = -214947698798577885L;
  29. private Document doc;
  30. private String namespace;
  31. /**
  32. * Create a new foreign object with the given dom and namespace.
  33. *
  34. * @param d the xml document
  35. * @param ns the namespace of the document
  36. */
  37. public ForeignObject(Document d, String ns) {
  38. doc = d;
  39. namespace = ns;
  40. }
  41. /**
  42. * Create a new empty foreign object for which the DOM Document will be set later.
  43. *
  44. * @param ns the namespace of the document
  45. */
  46. public ForeignObject(String ns) {
  47. namespace = ns;
  48. }
  49. /**
  50. * Sets the DOM document for this foreign object.
  51. * @param document the DOM document
  52. */
  53. public void setDocument(Document document) {
  54. this.doc = document;
  55. }
  56. /**
  57. * Get the document for this foreign object.
  58. *
  59. * @return the xml document
  60. */
  61. public Document getDocument() {
  62. return doc;
  63. }
  64. /**
  65. * Get the namespace of this foreign object.
  66. *
  67. * @return the namespace of this document
  68. */
  69. public String getNameSpace() {
  70. return namespace;
  71. }
  72. }