Package com.fasterxml.aalto.in
Class PName
- java.lang.Object
-
- com.fasterxml.aalto.in.PName
-
- Direct Known Subclasses:
ByteBasedPName,PNameC
public abstract class PName extends java.lang.ObjectPrefixed Name is similar toQName(qualified name), but only contains information about local name optionally prefixed by a prefix and colon, without namespace binding information.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String_localNameprotected com.fasterxml.aalto.in.NsBinding_namespaceBindingBinding of this qualified/prefixed name.protected java.lang.String_prefixprotected java.lang.String_prefixedName
-
Constructor Summary
Constructors Modifier Constructor Description protectedPName(java.lang.String pname, java.lang.String prefix, java.lang.String ln)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanboundEquals(PName other)Method that compares two bound PNames for semantic equality.booleanboundEquals(java.lang.String nsUri, java.lang.String ln)Stax-style match used for attribute lookup by namespace + local name:nsUri == nullskips the namespace check (perXMLStreamReader.getAttributeValue(String, String)),""means "no namespace", and any other value must match the bound URI exactly.intboundHashCode()static intboundHashCode(java.lang.String nsURI, java.lang.String localName)javax.xml.namespace.QNameconstructQName()javax.xml.namespace.QNameconstructQName(com.fasterxml.aalto.in.NsBinding defaultNs)Method called to construct a QName representation of elemented represented by this PName.abstract PNamecreateBoundName(com.fasterxml.aalto.in.NsBinding nsb)booleanequals(java.lang.Object o)abstract intgetFirstQuad()abstract intgetLastQuad()java.lang.StringgetLocalName()com.fasterxml.aalto.in.NsBindinggetNsBinding()java.lang.StringgetNsUri()java.lang.StringgetPrefix()java.lang.StringgetPrefixedName()abstract intgetQuad(int index)inthashCode()booleanhasPrefix()booleanhasPrefixedName(java.lang.String n)booleanisBound()booleanneedsBinding()abstract intsizeInQuads()java.lang.StringtoString()booleanunboundEquals(PName other)intunboundHashCode()
-
-
-
Field Detail
-
_prefixedName
protected final java.lang.String _prefixedName
-
_prefix
protected final java.lang.String _prefix
-
_localName
protected final java.lang.String _localName
-
_namespaceBinding
protected com.fasterxml.aalto.in.NsBinding _namespaceBinding
Binding of this qualified/prefixed name. Null if there is no prefix; in which case name is either bound to the default namespace (when element name), or no namespace (when other name, like attribute)
-
-
Method Detail
-
createBoundName
public abstract PName createBoundName(com.fasterxml.aalto.in.NsBinding nsb)
-
getPrefixedName
public final java.lang.String getPrefixedName()
-
getPrefix
public final java.lang.String getPrefix()
- Returns:
- Prefix of this name, if it has one; null if not.
-
getLocalName
public final java.lang.String getLocalName()
-
hasPrefix
public boolean hasPrefix()
-
hasPrefixedName
public boolean hasPrefixedName(java.lang.String n)
-
getNsBinding
public final com.fasterxml.aalto.in.NsBinding getNsBinding()
-
getNsUri
public final java.lang.String getNsUri()
-
constructQName
public final javax.xml.namespace.QName constructQName()
-
constructQName
public final javax.xml.namespace.QName constructQName(com.fasterxml.aalto.in.NsBinding defaultNs)
Method called to construct a QName representation of elemented represented by this PName. Because of namespace defaulting, current default namespace binding also needs to be passed (since only explicit ones get bound to PName instances).
-
needsBinding
public final boolean needsBinding()
- Returns:
- True if the name has no binding object, but will need one (has prefix)
-
isBound
public final boolean isBound()
- Returns:
- True if the name as described either has no prefix (either belongs to the default ns [elems], or to 'no namespace' [attrs]), or has a prefix that is bound currently. False if name has a prefix that is unbound.
-
boundEquals
public final boolean boundEquals(PName other)
Method that compares two bound PNames for semantic equality. This means that the local name, as well as bound URI are compared.
-
unboundEquals
public final boolean unboundEquals(PName other)
-
boundEquals
public final boolean boundEquals(java.lang.String nsUri, java.lang.String ln)Stax-style match used for attribute lookup by namespace + local name:nsUri == nullskips the namespace check (perXMLStreamReader.getAttributeValue(String, String)),""means "no namespace", and any other value must match the bound URI exactly.
-
unboundHashCode
public final int unboundHashCode()
-
boundHashCode
public final int boundHashCode()
-
boundHashCode
public static int boundHashCode(java.lang.String nsURI, java.lang.String localName)
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
sizeInQuads
public abstract int sizeInQuads()
-
getFirstQuad
public abstract int getFirstQuad()
-
getQuad
public abstract int getQuad(int index)
-
getLastQuad
public abstract int getLastQuad()
-
-