public final class EName extends Object implements Serializable, Comparable<EName>
Expanded names in XML consists of a namespace name (URI) and a local part. In opposite to Qualified Names, cf. W3C definition - which are made from an optional prefix and the local part - expanded names are not subject to namespace interpretation.
Please see http://www.w3.org/TR/xml-names/ for a complete definition and reference.
| Constructor and Description |
|---|
EName(String namespaceURI,
String localName)
Create a new expanded name.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(EName o) |
boolean |
equals(Object that) |
static EName |
fromString(String strEName)
Parse a W3C compliant string representation
{namespaceURI}localname. |
static EName |
fromString(String strEName,
String defaultNameSpace)
Parse a W3C compliant string representation
{namespaceURI}localname. |
String |
getLocalName()
Return the local part of the name.
|
String |
getNamespaceURI()
Return the namespace name.
|
int |
hashCode() |
boolean |
hasNamespace()
Check, if this name belongs to a namespace, i.e.
|
static EName |
mk(String localName)
Create a new expanded name which does not belong to a namespace.
|
static EName |
mk(String namespaceURI,
String localName) |
String |
toString()
Return a W3C compliant string representation
{namespaceURI}localname. |
public EName(String namespaceURI, String localName)
namespaceURI - the name of the namespace this EName belongs to. If set to XMLConstants.NULL_NS_URI,
this name does not belong to any namespace. Use this option with care.localName - the local part of the name. Must not be empty.public static EName mk(String localName)
XMLConstants.NULL_NS_URI.public String getNamespaceURI()
XMLConstants.NULL_NS_URI if the name does not belong to a namespacepublic String getLocalName()
public boolean hasNamespace()
XMLConstants.NULL_NS_URI.public String toString()
{namespaceURI}localname.public int compareTo(EName o)
compareTo in interface Comparable<EName>public static EName fromString(String strEName, String defaultNameSpace) throws IllegalArgumentException
{namespaceURI}localname.
A String representing an EName may start with a namespace among curly braces ("{" and "}") and then it must contain
a local name *without* any blank characters or curly braces.
This is a superset of the character restrictions defined by the XML standard, where neither namespaces nor local
names may contain curly braces or spaces.
Examples:
strEName - A String representing an ENamedefaultNameSpace - A NameSpace to apply if the provided String does not have any. Please note that a explicit empty
NameSpace **is** a NameSpace. If this argument is blank or null, it has no effect.IllegalArgumentExceptionpublic static EName fromString(String strEName) throws IllegalArgumentException
{namespaceURI}localname.
A String representing an EName may start with a namespace among curly braces ("{" and "}") and then it must contain
a local name *without* any curly braces.
This is a superset of the character restrictions defined by the XML standard, where neither namespaces nor local
names may contain curly braces.
Examples:
strEName - A String representing an ENameIllegalArgumentExceptionCopyright © 2009–2020 Opencast Project. All rights reserved.