Class/Object

eu.cdevreeze.yaidom.core

Declarations

Related Docs: object Declarations | package core

Permalink

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.

Linear Supertypes
Serializable, Serializable, Product, Equals, Immutable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Declarations
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Immutable
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Declarations(prefixNamespaceMap: Map[String, String])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def ++(declarations: Declarations): Declarations

    Permalink

    Alias for append

  4. def --(prefixes: Set[String]): Declarations

    Permalink

    Alias for minus

  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def append(prefix: String, namespace: String): Declarations

    Permalink

    Alias for append(Declarations.from((prefix, namespace)))

  7. def append(declarations: Declarations): Declarations

    Permalink

    Returns Declarations(this.prefixNamespaceMap ++ declarations.prefixNamespaceMap)

  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def isEmpty: Boolean

    Permalink

    Returns true if this Declarations is empty.

    Returns true if this Declarations is empty. Faster than comparing this Declarations against the empty Declarations.

  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. def minus(prefixes: Set[String]): Declarations

    Permalink

    Returns Declarations(this.prefixNamespaceMap -- prefixes)

  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def nonEmpty: Boolean

    Permalink

    Returns true if this Declarations is not empty.

  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. val prefixNamespaceMap: Map[String, String]

    Permalink
  21. def retainingDefaultNamespace: Declarations

    Permalink

    Returns an adapted copy of this Declarations, but retaining only the default namespace, if any

  22. def retainingUndeclarations: Declarations

    Permalink

    Returns an adapted copy of this Declarations, but retaining only the undeclarations, if any

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toStringInXml: String

    Permalink

    Creates a String representation of this Declarations, as it is shown in an XML element

  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. def withoutDefaultNamespace: Declarations

    Permalink

    Returns an adapted copy of this Declarations, but without the default namespace, if any

  29. def withoutUndeclarations: Declarations

    Permalink

    Returns an adapted copy of this Declarations, but without any undeclarations, if any

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Immutable

Inherited from AnyRef

Inherited from Any

Ungrouped