|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
AbstractText.java | - | 60% | 66,7% | 63,6% |
|
1 | /* | |
2 | * Copyright 2001-2004 (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: AbstractText.java,v 1.8 2004/06/25 08:03:41 maartenc Exp $ | |
8 | */ | |
9 | ||
10 | package org.dom4j.tree; | |
11 | ||
12 | import java.io.IOException; | |
13 | import java.io.Writer; | |
14 | ||
15 | import org.dom4j.Text; | |
16 | import org.dom4j.Visitor; | |
17 | ||
18 | /** <p><code>AbstractText</code> is an abstract base class for | |
19 | * tree implementors to use for implementation inheritence.</p> | |
20 | * | |
21 | * @author <a href="mailto:james.strachan@metastuff.com">James Strachan</a> | |
22 | * @version $Revision: 1.8 $ | |
23 | */ | |
24 | public abstract class AbstractText extends AbstractCharacterData implements Text { | |
25 | ||
26 | 212962 | public AbstractText() { |
27 | } | |
28 | ||
29 | 343480 | public short getNodeType() { |
30 | 343480 | return TEXT_NODE; |
31 | } | |
32 | ||
33 | 138504 | public String toString() { |
34 | 138504 | return super.toString() + " [Text: \"" + getText() + "\"]"; |
35 | } | |
36 | ||
37 | 4 | public String asXML() { |
38 | 4 | return getText(); |
39 | } | |
40 | ||
41 | 0 | public void write(Writer writer) throws IOException { |
42 | 0 | writer.write( getText() ); |
43 | } | |
44 | ||
45 | 0 | public void accept(Visitor visitor) { |
46 | 0 | visitor.visit(this); |
47 | } | |
48 | } | |
49 | ||
50 | ||
51 | ||
52 | ||
53 | /* | |
54 | * Redistribution and use of this software and associated documentation | |
55 | * ("Software"), with or without modification, are permitted provided | |
56 | * that the following conditions are met: | |
57 | * | |
58 | * 1. Redistributions of source code must retain copyright | |
59 | * statements and notices. Redistributions must also contain a | |
60 | * copy of this document. | |
61 | * | |
62 | * 2. Redistributions in binary form must reproduce the | |
63 | * above copyright notice, this list of conditions and the | |
64 | * following disclaimer in the documentation and/or other | |
65 | * materials provided with the distribution. | |
66 | * | |
67 | * 3. The name "DOM4J" must not be used to endorse or promote | |
68 | * products derived from this Software without prior written | |
69 | * permission of MetaStuff, Ltd. For written permission, | |
70 | * please contact dom4j-info@metastuff.com. | |
71 | * | |
72 | * 4. Products derived from this Software may not be called "DOM4J" | |
73 | * nor may "DOM4J" appear in their names without prior written | |
74 | * permission of MetaStuff, Ltd. DOM4J is a registered | |
75 | * trademark of MetaStuff, Ltd. | |
76 | * | |
77 | * 5. Due credit should be given to the DOM4J Project - | |
78 | * http://www.dom4j.org | |
79 | * | |
80 | * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS | |
81 | * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT | |
82 | * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
83 | * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | |
84 | * METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |
85 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
86 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
87 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
88 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
89 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
90 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |
91 | * OF THE POSSIBILITY OF SUCH DAMAGE. | |
92 | * | |
93 | * Copyright 2001-2004 (C) MetaStuff, Ltd. All Rights Reserved. | |
94 | * | |
95 | * $Id: AbstractText.java,v 1.8 2004/06/25 08:03:41 maartenc Exp $ | |
96 | */ |
|