pcdata.scala

来自「JAVA 语言的函数式编程扩展」· SCALA 代码 · 共 32 行

SCALA
32
字号
// $Id: PCData.scala 14241 2008-03-03 14:53:47Z washburn $package scala.xml/** This class (which is not used by all XML parsers, but always used by the XHTML one)  *  represents parseable character data, which appeared as CDATA sections in the input  *  and is to be preserved as CDATA section in the output. */case class PCData(_data: String) extends Atom[String](_data) {  /* The following code is a derivative work of scala.xml.Text */  if (null == data)    throw new IllegalArgumentException("tried to construct PCData with null")  final override def equals(x: Any) = x match {    case s: String  => s.equals(data)    case s: Atom[_] => data == s.data    case _ => false  }  /** Returns text, with some characters escaped according to the XML   *  specification.   *   *  @param  sb ...   *  @return ...   */  override def toString(sb: StringBuilder) = {    sb.append("<![CDATA[")    sb.append(data)    sb.append("]]>")  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?