99package scala
1010package xml
1111
12- /** This singleton object contains the `apply` and `unapplySeq` methods for
12+ /**
13+ * This singleton object contains the `apply` and `unapplySeq` methods for
1314 * convenient construction and deconstruction. It is possible to deconstruct
1415 * any `Node` instance (that is not a `SpecialNode` or a `Group`) using the
1516 * syntax `case Elem(prefix, label, attribs, scope, child @ _*) => ...`
@@ -18,7 +19,8 @@ package xml
1819 * @author Burak Emir <bqe@google.com>
1920 */
2021object Elem {
21- /** Build an Elem, setting its minimizeEmpty property to `true` if it has no children. Note that this
22+ /**
23+ * Build an Elem, setting its minimizeEmpty property to `true` if it has no children. Note that this
2224 * default may not be exactly what you want, as some XML dialects don't permit some elements to be minimized.
2325 *
2426 * @deprecated This factory method is retained for backward compatibility; please use the other one, with which you
@@ -32,35 +34,37 @@ object Elem {
3234 new Elem (prefix, label, attributes, scope, minimizeEmpty, child : _* )
3335
3436 def unapplySeq (n : Node ) = n match {
35- case _ : SpecialNode | _ : Group => None
36- case _ => Some ((n.prefix, n.label, n.attributes, n.scope, n.child))
37+ case _ : SpecialNode | _ : Group => None
38+ case _ => Some ((n.prefix, n.label, n.attributes, n.scope, n.child))
3739 }
3840
3941 import scala .sys .process ._
40- /** Implicitly convert a [[scala.xml.Elem ]] into a
41- * [[scala.sys.process.ProcessBuilder ]]. This is done by obtaining the text
42- * elements of the element, trimming spaces, and then converting the result
43- * from string to a process. Importantly, tags are completely ignored, so
44- * they cannot be used to separate parameters.
45- */
42+ /**
43+ * Implicitly convert a [[scala.xml.Elem ]] into a
44+ * [[scala.sys.process.ProcessBuilder ]]. This is done by obtaining the text
45+ * elements of the element, trimming spaces, and then converting the result
46+ * from string to a process. Importantly, tags are completely ignored, so
47+ * they cannot be used to separate parameters.
48+ */
4649 @ deprecated(" To create a scala.sys.process.Process from an xml.Elem, please use Process(elem.text.trim)." , " 2.11.0" )
4750 implicit def xmlToProcess (command : scala.xml.Elem ): ProcessBuilder = Process (command.text.trim)
4851
4952 @ deprecated(" To create a scala.sys.process.Process from an xml.Elem, please use Process(elem.text.trim)." , " 2.11.0" )
5053 implicit def processXml (p : Process .type ) = new {
51- /** Creates a [[scala.sys.process.ProcessBuilder ]] from a Scala XML Element.
52- * This can be used as a way to template strings.
53- *
54- * @example {{{
55- * apply(<x> {dxPath.absolutePath} --dex --output={classesDexPath.absolutePath} {classesMinJarPath.absolutePath}</x>)
56- * }}}
57- */
54+ /**
55+ * Creates a [[scala.sys.process.ProcessBuilder ]] from a Scala XML Element.
56+ * This can be used as a way to template strings.
57+ *
58+ * @example {{{
59+ * apply(<x> {dxPath.absolutePath} --dex --output={classesDexPath.absolutePath} {classesMinJarPath.absolutePath}</x>)
60+ * }}}
61+ */
5862 def apply (command : Elem ): ProcessBuilder = Process (command.text.trim)
5963 }
6064}
6165
62-
63- /* * The case class `Elem` extends the `Node` class,
66+ /**
67+ * The case class `Elem` extends the `Node` class,
6468 * providing an immutable data object representing an XML element.
6569 *
6670 * @param prefix namespace prefix (may be null, but not the empty string)
@@ -81,15 +85,14 @@ class Elem(
8185 override val scope : NamespaceBinding ,
8286 val minimizeEmpty : Boolean ,
8387 val child : Node * )
84- extends Node with Serializable
85- {
88+ extends Node with Serializable {
8689 @ deprecated(" This constructor is retained for backward compatibility. Please use the primary constructor, which lets you specify your own preference for `minimizeEmpty`." , " 2.10.0" )
8790 def this (prefix : String , label : String , attributes : MetaData , scope : NamespaceBinding , child : Node * ) = {
8891 this (prefix, label, attributes, scope, child.isEmpty, child : _* )
8992 }
9093
9194 final override def doCollectNamespaces = true
92- final override def doTransform = true
95+ final override def doTransform = true
9396
9497 override val attributes = MetaData .normalize(attributes1, scope)
9598
@@ -106,7 +109,8 @@ extends Node with Serializable
106109 override protected def basisForHashCode : Seq [Any ] =
107110 prefix :: label :: attributes :: child.toList
108111
109- /** Returns a new element with updated attributes, resolving namespace uris
112+ /**
113+ * Returns a new element with updated attributes, resolving namespace uris
110114 * from this element's scope. See MetaData.update for details.
111115 *
112116 * @param updates MetaData with new and updated attributes
@@ -115,7 +119,8 @@ extends Node with Serializable
115119 final def % (updates : MetaData ): Elem =
116120 copy(attributes = MetaData .update(attributes, scope, updates))
117121
118- /** Returns a copy of this element with any supplied arguments replacing
122+ /**
123+ * Returns a copy of this element with any supplied arguments replacing
119124 * this element's value for that field.
120125 *
121126 * @return a new symbol with updated attributes
@@ -126,10 +131,10 @@ extends Node with Serializable
126131 attributes : MetaData = this .attributes,
127132 scope : NamespaceBinding = this .scope,
128133 minimizeEmpty : Boolean = this .minimizeEmpty,
129- child : Seq [Node ] = this .child.toSeq
130- ): Elem = Elem (prefix, label, attributes, scope, minimizeEmpty, child : _* )
134+ child : Seq [Node ] = this .child.toSeq): Elem = Elem (prefix, label, attributes, scope, minimizeEmpty, child : _* )
131135
132- /** Returns concatenation of `text(n)` for each child `n`.
136+ /**
137+ * Returns concatenation of `text(n)` for each child `n`.
133138 */
134139 override def text = (child map (_.text)).mkString
135140}
0 commit comments