sealed trait QName extends Serializable
Qualified name. See http://www.w3.org/TR/xml-names11/.
It is the combination of an optional prefix and a mandatory local part. It is not like a QName
in Java, which
is more like what yaidom calls an expanded name.
There are 2 types of QName
s:
- eu.cdevreeze.yaidom.core.UnprefixedName, which only contains a local part
- eu.cdevreeze.yaidom.core.PrefixedName, which combines a non-empty prefix with a local part
QNames are meaningless outside their scope, which resolves the QName
as an eu.cdevreeze.yaidom.core.EName.
Typical usage may lead to an explosion of different QName objects that are equal. Therefore, application code is encouraged to define and use constants for frequently used QNames. For example, for the XML Schema namespace:
val XsPrefix = "xs" val XsElementQName = QName(XsPrefix, "element") val XsAttributeQName = QName(XsPrefix, "attribute") val XsComplexTypeQName = QName(XsPrefix, "complexType") val XsSimpleTypeQName = QName(XsPrefix, "simpleType") // ...
In this example, the QName constant names are in upper camel case, starting with the prefix, followed by the local part, and ending with suffix "QName".
Implementation note: It was tried as alternative implementation to define the QName subclasses as (Scala 2.10) value classes. The QName would then wrap the qualified name as string representation (with or without prefix). One cost would be that parsing the (optional) prefix and the local name would occur far more frequently. Another cost would be that the alternative implementation would not directly express that a QName is a combination of an optional prefix and a local part. Therefore that alternative implementation has been abandoned.
- Alphabetic
- By Inheritance
- QName
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def localPart: String
- abstract def prefixOption: Option[String]
- abstract def validated: QName
Partially validates the QName, throwing an exception if found not valid.
Partially validates the QName, 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 QName itself is returned.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()