blob: 8f612f28e59c2dfd98446ae85a3aa02f44ce4f92 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
// $Id$
package scala.xml
/** an XML node for text (PCDATA). Used in both non-bound and bound XML
* representations
* @author Burak Emir
* @param text the text contained in this node, may not be null.
*/
case class Text(_data: String) extends Atom[String](_data) {
if (null == data)
throw new java.lang.NullPointerException("tried to construct Text with null")
final override def equals(x: Any) = x match {
case s:String => s.equals(data.toString())
case s:Text => data == s.data
case _ => false
}
/** returns text, with some characters escaped according to XML spec */
override def toString(sb: StringBuffer) =
Utility.escape(data.toString(), sb)
}
|