KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > xml > dom4j > o3impl > DefaultCDATA


1 /*
2  * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
3  *
4  * This software is open source.
5  * See the bottom of this file for the licence.
6  *
7  * $Id: DefaultCDATA.java,v 1.2 2003/06/10 16:18:36 per_nyfelt Exp $
8  */

9
10 package org.ozoneDB.xml.dom4j.o3impl;
11
12 import org.dom4j.Element;
13
14 /** <p><code>DefaultCDATA</code> is the default CDATA implementation.
15  * It is a doubly linked node which supports the parent relationship
16  * and can be modified in place.</p>
17  *
18  * @author <a HREF="mailto:jstrachan@apache.org">James Strachan</a>
19  * @version $Revision: 1.2 $
20  */

21 public class DefaultCDATA extends FlyweightCDATA {
22
23     /** The parent of this node */
24     private Element parent;
25
26     /** @param text is the CDATA text
27      */

28     public DefaultCDATA(String JavaDoc text) {
29         super(text);
30     }
31
32     /** @param parent is the parent element
33      * @param text is the CDATA text
34      */

35     public DefaultCDATA(Element parent, String JavaDoc text) {
36         super(text);
37         this.parent = parent;
38     }
39
40     public void setText(String JavaDoc text) {
41         this.text = text;
42     }
43
44     public Element getParent() {
45         return parent;
46     }
47
48     public void setParent(Element parent) {
49         this.parent = parent;
50     }
51
52     public boolean supportsParent() {
53         return true;
54     }
55
56     public boolean isReadOnly() {
57         return false;
58     }
59 }
60
61
62 /*
63  * Redistribution and use of this software and associated documentation
64  * ("Software"), with or without modification, are permitted provided
65  * that the following conditions are met:
66  *
67  * 1. Redistributions of source code must retain copyright
68  * statements and notices. Redistributions must also contain a
69  * copy of this document.
70  *
71  * 2. Redistributions in binary form must reproduce the
72  * above copyright notice, this list of conditions and the
73  * following disclaimer in the documentation and/or other
74  * materials provided with the distribution.
75  *
76  * 3. The name "DOM4J" must not be used to endorse or promote
77  * products derived from this Software without prior written
78  * permission of MetaStuff, Ltd. For written permission,
79  * please contact dom4j-info@metastuff.com.
80  *
81  * 4. Products derived from this Software may not be called "DOM4J"
82  * nor may "DOM4J" appear in their names without prior written
83  * permission of MetaStuff, Ltd. DOM4J is a registered
84  * trademark of MetaStuff, Ltd.
85  *
86  * 5. Due credit should be given to the DOM4J Project
87  * (http://dom4j.org/).
88  *
89  * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
90  * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
91  * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
92  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
93  * METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
94  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
95  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
96  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
97  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
98  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
99  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
100  * OF THE POSSIBILITY OF SUCH DAMAGE.
101  *
102  * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
103  *
104  * $Id: DefaultCDATA.java,v 1.2 2003/06/10 16:18:36 per_nyfelt Exp $
105  */

106
Popular Tags