final case class EName(namespaceUriOption: Option[String], localPart: String) extends 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.
- Alphabetic
- By Inheritance
- EName
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new EName(namespaceUriOption: Option[String], localPart: String)
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( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val localPart: String
- val namespaceUriOption: Option[String]
-
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
toQName(prefixOption: Option[String]): QName
Given an optional prefix, creates a
QName
from thisEName
-
def
toString(): String
The
String
representation, in the format of thejavax.xml.namespace.QName.toString
methodThe
String
representation, in the format of thejavax.xml.namespace.QName.toString
method- Definition Classes
- EName → AnyRef → Any
-
def
toUriQualifiedNameString: String
Returns the string representation of this EName as URI qualified name, as a braced URI literal followed by an NC-name.
Returns the string representation of this EName as URI qualified name, as a braced URI literal followed by an NC-name. See for example https://www.w3.org/TR/xpath-31/#prod-xpath31-URIQualifiedName.
-
def
validated: EName
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.
-
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
- @throws( ... ) @native()