Package org.odftoolkit.odfdom.pkg
Class OdfName
java.lang.Object
org.odftoolkit.odfdom.pkg.OdfName
- All Implemented Interfaces:
Comparable<OdfName>
The class provides a simplified interface for XML names. The class defines a name for an XML
node. It embraces XML NamespaceURI, XML prefix and XML localname.
-
Method Summary
Modifier and TypeMethodDescriptionint
Compares the by parameter given OdfName with this OdfNameboolean
boolean
static OdfName
getOdfName
(OdfNamespace odfNamespace, String localName) Used for receiving an OdfName, in case of a default nameaspace, when there is no prefix.getQName()
getUri()
int
hashCode()
static OdfName
Returns the OdfName for the given namespace and name.static OdfName
static OdfName
newName
(NamespaceName namespaceNamed, String name) Returns the OdfName for the given namespace and name.static OdfName
newName
(OdfNamespace odfNamespace, String name) Returns the OdfName for the given namespace and name.toString()
-
Method Details
-
newName
Returns the OdfName for the given namespace and name. Creates a new one, if the OdfName was not asked before.- Parameters:
name
- of the XML node- Returns:
- the OdfName for the given OdfNamesapce and name.
-
newName
Returns the OdfName for the given namespace and name. Creates a new one, if the OdfName was not asked before.- Parameters:
odfNamespace
- the namespace of the name to be createdname
- of the XML node. Can be both local or qualified name.- Returns:
- the OdfName for the given OdfNamesapce and name.
-
newName
Returns the OdfName for the given namespace and name. Creates a new one, if the OdfName was not asked before.- Parameters:
namespaceNamed
- represents a W3C Namespace Name. The interfaceNamespaceName
is often implemented by an enum.name
- of the XML node. Can be both local or qualified name.- Returns:
- the OdfName for the given OdfNamesapce and name.
-
newName
-
getOdfName
Used for receiving an OdfName, in case of a default nameaspace, when there is no prefix. -
getUri
- Returns:
- the XML Namespace URI, for <text:p> it would be urn:oasis:names:tc:opendocument:xmlns:text:1.0
-
getLocalName
- Returns:
- the XML localname, for <text:p> it would be p.
-
getPrefix
- Returns:
- the XML prefix, for <text:p> it would be text.
-
getQName
- Returns:
- the XML QName, the qualified name e.g. for <text:p> it is text:p.
-
toString
-
equals
-
equals
- Parameters:
namespaceUri
- of the XML node to be compared.name
- of the XML node to be compared. Can be qualifed name or localname.- Returns:
- true if the given OdfName has the same namespaceURI and localname.
-
hashCode
public int hashCode() -
compareTo
Compares the by parameter given OdfName with this OdfName- Specified by:
compareTo
in interfaceComparable<OdfName>
-