Class/Object

eu.cdevreeze.yaidom.core

EName

Related Docs: object EName | package core

Permalink

final case class EName(namespaceUriOption: Option[String], localPart: String) extends Immutable with Product with Serializable

Expanded name. See http://www.w3.org/TR/xml-names11/. It has a localPart and an optional namespace URI. Semantically like a QName in Java, but not keeping the prefix.

To get an eu.cdevreeze.yaidom.core.EName from a eu.cdevreeze.yaidom.core.QName, the latter needs to be resolved against a eu.cdevreeze.yaidom.core.Scope.

The short class name illustrates that expanded names are at least as important as qualified names, and should be equally easy to construct (using the companion object).

Typical usage may lead to an explosion of different EName objects that are equal. Therefore, application code is encouraged to define and use constants for frequently used ENames. For example, for the XML Schema namespace (and analogous to the XLink constants in yaidom):

val XsNamespace = "http://www.w3.org/2001/XMLSchema"

val XsElementEName = EName(XsNamespace, "element")
val XsAttributeEName = EName(XsNamespace, "attribute")
val XsComplexTypeEName = EName(XsNamespace, "complexType")
val XsSimpleTypeEName = EName(XsNamespace, "simpleType")
// ...

In this example, the EName constant names are in upper camel case, starting with the ("preferred") prefix, followed by the local part, and ending with suffix "EName".

Implementation note: It was tried as alternative implementation to define EName as (Scala 2.10) value class. The EName would then wrap the expanded name as string representation (in James Clark notation). One cost would be that parsing the (optional) namespace URI and the local name would occur far more frequently. Another cost would be that the alternative implementation would not directly express that an EName is a combination of an optional namespace URI and a local part. Therefore that alternative implementation has been abandoned.

Linear Supertypes
Serializable, Serializable, Product, Equals, Immutable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. EName
  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 EName(namespaceUriOption: Option[String], localPart: 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. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  9. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  10. val localPart: String

    Permalink
  11. val namespaceUriOption: Option[String]

    Permalink
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toJavaQName(prefixOption: Option[String]): javax.xml.namespace.QName

    Permalink

    Given an optional prefix, creates a javax.xml.namespace.QName from this EName

  17. def toQName(prefixOption: Option[String]): QName

    Permalink

    Given an optional prefix, creates a QName from this EName

  18. def toString(): String

    Permalink

    The String representation, in the format of the javax.xml.namespace.QName.toString method

    The String representation, in the format of the javax.xml.namespace.QName.toString method

    Definition Classes
    EName → AnyRef → Any
  19. def validated: EName

    Permalink

    Partially validates the EName, throwing an exception if found not valid.

    Partially validates the EName, throwing an exception if found not valid. If not found invalid, returns this.

    It is the responsibility of the user of this class to call this method, if needed. Fortunately, this method facilitates method chaining, because the EName itself is returned.

  20. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Immutable

Inherited from AnyRef

Inherited from Any

Ungrouped