KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > area > inline > ForeignObject


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
18 /* $Id: ForeignObject.java 426576 2006-07-28 15:44:37Z jeremias $ */
19  
20 package org.apache.fop.area.inline;
21
22 import org.apache.fop.area.Area;
23
24 import org.w3c.dom.Document JavaDoc;
25
26 // cacheable object
27
/**
28  * Foreign object inline area.
29  * This inline area represents an instream-foreign object.
30  * This holds an xml document and the associated namespace.
31  */

32 public class ForeignObject extends Area {
33     
34     private Document JavaDoc doc;
35     private String JavaDoc namespace;
36
37     /**
38      * Create a new foreign object with the given dom and namespace.
39      *
40      * @param d the xml document
41      * @param ns the namespace of the document
42      */

43     public ForeignObject(Document JavaDoc d, String JavaDoc ns) {
44         doc = d;
45         namespace = ns;
46     }
47
48     /**
49      * Create a new empty foreign object for which the DOM Document will be set later.
50      *
51      * @param ns the namespace of the document
52      */

53     public ForeignObject(String JavaDoc ns) {
54         namespace = ns;
55     }
56
57     /**
58      * Sets the DOM document for this foreign object.
59      * @param document the DOM document
60      */

61     public void setDocument(Document JavaDoc document) {
62         this.doc = document;
63     }
64     
65     /**
66      * Get the document for this foreign object.
67      *
68      * @return the xml document
69      */

70     public Document JavaDoc getDocument() {
71         return doc;
72     }
73
74     /**
75      * Get the namespace of this foreign object.
76      *
77      * @return the namespace of this document
78      */

79     public String JavaDoc getNameSpace() {
80         return namespace;
81     }
82 }
83
84
Popular Tags