1313package scala
1414package xml
1515
16+ import xml .Nullables ._
1617import scala .collection .Seq
1718
1819/**
@@ -22,21 +23,21 @@ import scala.collection.Seq
2223 * @author Burak Emir
2324 */
2425object Attribute {
25- def unapply (x : Attribute ): Option [(String , Seq [Node ], MetaData )] = x match {
26+ def unapply (x : Attribute ): Option [(Nullable [ String ], Nullable [ Seq [Node ] ], MetaData )] = x match {
2627 case PrefixedAttribute (_, key, value, next) => Some ((key, value, next))
2728 case UnprefixedAttribute (key, value, next) => Some ((key, value, next))
2829 case _ => None
2930 }
3031
3132 /** Convenience functions which choose Un/Prefixedness appropriately */
32- def apply (key : String , value : Seq [Node ], next : MetaData ): Attribute =
33+ def apply (key : Nullable [ String ] , value : Seq [Node ], next : MetaData ): Attribute =
3334 new UnprefixedAttribute (key, value, next)
3435
35- def apply (pre : String , key : String , value : String , next : MetaData ): Attribute =
36+ def apply (pre : Nullable [ String ] , key : String , value : String , next : MetaData ): Attribute =
3637 if (pre == null || pre == " " ) new UnprefixedAttribute (key, value, next)
3738 else new PrefixedAttribute (pre, key, value, next)
3839
39- def apply (pre : String , key : String , value : Seq [Node ], next : MetaData ): Attribute =
40+ def apply (pre : Nullable [ String ] , key : String , value : Seq [Node ], next : MetaData ): Attribute =
4041 if (pre == null || pre == " " ) new UnprefixedAttribute (key, value, next)
4142 else new PrefixedAttribute (pre, key, value, next)
4243
@@ -54,29 +55,29 @@ object Attribute {
5455 * @author Burak Emir
5556 */
5657trait Attribute extends MetaData with ScalaVersionSpecificMetaData {
57- def pre : String // will be null if unprefixed
58- override val key : String
59- override val value : ScalaVersionSpecific .SeqOfNode
58+ def pre : Nullable [ String ] // will be null if unprefixed
59+ override val key : Nullable [ String ]
60+ override val value : Nullable [ ScalaVersionSpecific .SeqOfNode ]
6061 override val next : MetaData
6162
62- override def apply (key : String ): ScalaVersionSpecific .SeqOfNode
63- override def apply (namespace : String , scope : NamespaceBinding , key : String ): ScalaVersionSpecific .SeqOfNode
63+ override def apply (key : String ): Nullable [ ScalaVersionSpecific .SeqOfNode ]
64+ override def apply (namespace : Nullable [ String ] , scope : NamespaceBinding , key : Nullable [ String ] ): Nullable [ ScalaVersionSpecific .SeqOfNode ]
6465 override def copy (next : MetaData ): Attribute
6566
66- override def remove (key : String ): MetaData =
67+ override def remove (key : Nullable [ String ] ): MetaData =
6768 if (! isPrefixed && this .key == key) next
6869 else copy(next.remove(key))
6970
70- override def remove (namespace : String , scope : NamespaceBinding , key : String ): MetaData =
71+ override def remove (namespace : Nullable [ String ] , scope : NamespaceBinding , key : String ): MetaData =
7172 if (this .key == key && scope.getURI(pre) == namespace) next
7273 else copy(next.remove(namespace, scope, key))
7374
7475 override def isPrefixed : Boolean = pre != null
7576
76- override def getNamespace (owner : Node ): String
77+ override def getNamespace (owner : Node ): Nullable [ String ]
7778
7879 override def wellformed (scope : NamespaceBinding ): Boolean = {
79- val arg : String = if (isPrefixed) scope.getURI(pre) else null
80+ val arg : Nullable [ String ] = if (isPrefixed) scope.getURI(pre) else null
8081 (next(arg, scope, key) == null ) && next.wellformed(scope)
8182 }
8283
0 commit comments