public class XmlDataTag
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
XmlDataTag(java.lang.String name)
Constructs a generic XmlDataTag.
|
Modifier and Type | Method and Description |
---|---|
XmlDataTag |
clone() |
static XmlDataTag |
createFromFullName(java.lang.String name)
Creates an XMlDataTag object from the String representation of a tag.
|
static XmlDataTag |
createInstanceFromFullName(java.lang.String name,
boolean elementDefault) |
static XmlDataTag |
createInstanceFromFullName(java.lang.String name,
boolean elementDefault,
XmlNamespaceMap nsDecls)
Creates the appropriate XmlDataTag object from a literal tag String.
|
boolean |
equals(java.lang.Object other)
Tests the equality of two XmlDataTags.
|
java.lang.String |
getFullName()
Creates the String representation of an XMlDataTag from its three components in the {particleId}ncName#namespace.
|
java.lang.String |
getNcName()
Returns the NCName portion of an XmlDataTag.
|
java.lang.String |
getPartialName()
Returns the full name without the particle-id portion.
|
java.lang.String |
getPathName()
Returns the tag in path-name format.
|
java.lang.String |
getPathName(java.lang.String nsPairs)
Returns the tag in path-name form using namespace prefixes.
|
java.lang.String |
getPathName(XmlNamespaceMap nsDecls)
Returns the tag in path-name form using namespace prefixes.
|
java.lang.String |
getXmlNs()
Returns the XML namespace of an XmlDataTag.
|
boolean |
nameEquals(XmlDataTag other)
Compares two XmlDataTags, ignoring the particle-id.
|
boolean |
pathEquals(XmlDataTag other)
Returns true only if all components of the tag are identical: ncName, namespace, particle-id, index (if specified), indirect-qualifier (if specified)
|
java.lang.String |
toString()
toString() generally returns the same value as getPathName, but might contain additional debugging information.
|
public XmlDataTag(java.lang.String name)
name
- the ncName portion of the tagpublic XmlDataTag clone()
clone
in class java.lang.Object
public static XmlDataTag createFromFullName(java.lang.String name)
name
- the String representation of an XMlDataTagpublic static XmlDataTag createInstanceFromFullName(java.lang.String name, boolean elementDefault, XmlNamespaceMap nsDecls)
name
- the full name of the tag. For example, "*group" or "{2}substitution-name#target", etc. When no particle id
is specified for a tag that requires one, for example, *any, it defaults to {1}.elementDefault
- specifies how to treat tags that do not start with the { character and also are not one of the special tags
such as *group or *instance. When false, it is treated as
an attribute tag; when true it is treated as an element tag.nsDecls
- the namespace declarationspublic static XmlDataTag createInstanceFromFullName(java.lang.String name, boolean elementDefault)
public java.lang.String getNcName()
public java.lang.String getXmlNs()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public boolean nameEquals(XmlDataTag other)
other
- the XmlDataTag to comparepublic boolean pathEquals(XmlDataTag other)
other
- the other tagpublic java.lang.String getFullName()
public java.lang.String getPartialName()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getPathName()
XmlDataMap
or XmlDataCopy
. The additional properties are index and indirect-qualifier. ualified names are returned in the form ncName#namespace.
Index (if defined) is represented as [index] and indirect-qualifiers is represented as {content-tag}. If the
namespace uses the path characters '[', ']', or '/', those characters are %-encoded using %2F for /, %5B for [, %5D for ], and %25 for %.public java.lang.String getPathName(XmlNamespaceMap nsDecls)
XmlDataMap
or XmlDataCopy
.
Qualified names are returned in the form prefix:ncName. The
prefix is defined by the nsDecls argument.nsDecls
- the namespace declarations used to present names in prefixed formpublic java.lang.String getPathName(java.lang.String nsPairs)
XmlDataMap
or XmlDataCopy
.
The prefix definitions are expressed as a String of space-delimited prefix/URI pairs rather than an XmlNamespaceMap.nsPairs
- prefix/URI pairs