final case class Declarations(prefixNamespaceMap: Map[String, String]) extends Immutable with Product with Serializable
Namespace declarations (and undeclarations), typically at the level of one element.
For example, consider the following XML:
<book:Bookstore xmlns:book="http://bookstore/book" xmlns:auth="http://bookstore/author"> <book:Book ISBN="978-0321356680" Price="35" Edition="2"> <book:Title>Effective Java (2nd Edition)</book:Title> <book:Authors> <auth:Author> <auth:First_Name>Joshua</auth:First_Name> <auth:Last_Name>Bloch</auth:Last_Name> </auth:Author> </book:Authors> </book:Book> </book:Bookstore>
Then only the root element contains namespace declarations, viz.:
Declarations.from("book" -> "http://bookstore/book", "auth" -> "http://bookstore/author")
The Declarations
is backed by a map from prefixes (or the empty string for the default namespace) to namespace URIs (or the empty string).
If the mapped value is the empty string, it is an undeclaration.
Prefix 'xml' is not allowed as key in this map. That prefix, mapping to namespace URI 'http://www.w3.org/XML/1998/namespace', is always available, without needing any declaration.
This class does not depend on the Scope
class.
There are no methods for subset relationships on namespace declarations (unlike for class Scope
).
After all, in the presence of namespace undeclarations, such a subset relationship would become a bit unnatural.
- Alphabetic
- By Inheritance
- Declarations
- Serializable
- Serializable
- Product
- Equals
- Immutable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Declarations(prefixNamespaceMap: Map[String, String])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
++(declarations: Declarations): Declarations
Alias for
append
-
def
--(prefixes: Set[String]): Declarations
Alias for
minus
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
append(prefix: String, namespace: String): Declarations
Alias for
append(Declarations.from((prefix, namespace)))
-
def
append(declarations: Declarations): Declarations
Returns
Declarations(this.prefixNamespaceMap ++ declarations.prefixNamespaceMap)
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isEmpty: Boolean
Returns true if this Declarations is empty.
Returns true if this Declarations is empty. Faster than comparing this Declarations against the empty Declarations.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
minus(prefixes: Set[String]): Declarations
Returns
Declarations(this.prefixNamespaceMap -- prefixes)
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nonEmpty: Boolean
Returns true if this Declarations is not empty.
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val prefixNamespaceMap: Map[String, String]
-
def
retainingDefaultNamespace: Declarations
Returns an adapted copy of this Declarations, but retaining only the default namespace, if any
-
def
retainingUndeclarations: Declarations
Returns an adapted copy of this Declarations, but retaining only the undeclarations, if any
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toStringInXml: String
Creates a
String
representation of thisDeclarations
, as it is shown in an XML element -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
withoutDefaultNamespace: Declarations
Returns an adapted copy of this Declarations, but without the default namespace, if any
-
def
withoutUndeclarations: Declarations
Returns an adapted copy of this Declarations, but without any undeclarations, if any