eu.cdevreeze.yaidom.core

Declarations

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
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

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

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

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

    Returns Declarations(this.prefixNamespaceMap -- prefixes)

  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

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

    Definition Classes
    AnyRef
  11. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  13. 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.

  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

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

  19. def retainingDefaultNamespace: Declarations

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

  20. def retainingUndeclarations: Declarations

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

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

    Definition Classes
    AnyRef
  22. def toStringInXml: String

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

  23. final def wait(): Unit

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

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

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

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

  27. def withoutUndeclarations: Declarations

    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