com.fasterxml.aalto.in

## Class PName

- java.lang.Object
- - com.fasterxml.aalto.in.PName

- Direct Known Subclasses:
    ByteBasedPName, PNameC

      public abstract class PName
      extends Object

  Prefixed Name is similar to `QName` (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 and Description
    --- | ---
    `protected String` | `_localName`
    `protected com.fasterxml.aalto.in.NsBinding` | `_namespaceBinding` Binding of this qualified/prefixed name.
    `protected String` | `_prefix`
    `protected String` | `_prefixedName`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PName(String pname, String prefix, String ln)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `boundEquals(PName other)` Method that compares two bound PNames for semantic equality.
    `boolean` | `boundEquals(String nsUri, String ln)`
    `int` | `boundHashCode()`
    `static int` | `boundHashCode(String nsURI, String localName)`
    `QName` | `constructQName()`
    `QName` | `constructQName(com.fasterxml.aalto.in.NsBinding defaultNs)` Method called to construct a QName representation of elemented represented by this PName.
    `abstract PName` | `createBoundName(com.fasterxml.aalto.in.NsBinding nsb)`
    `boolean` | `equals(Object o)`
    `abstract int` | `getFirstQuad()`
    `abstract int` | `getLastQuad()`
    `String` | `getLocalName()`
    `com.fasterxml.aalto.in.NsBinding` | `getNsBinding()`
    `String` | `getNsUri()`
    `String` | `getPrefix()`
    `String` | `getPrefixedName()`
    `abstract int` | `getQuad(int index)`
    `int` | `hashCode()`
    `boolean` | `hasPrefix()`
    `boolean` | `hasPrefixedName(String n)`
    `boolean` | `isBound()`
    `boolean` | `needsBinding()`
    `abstract int` | `sizeInQuads()`
    `String` | `toString()`
    `boolean` | `unboundEquals(PName other)`
    `int` | `unboundHashCode()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### _prefixedName

          protected final String _prefixedName

    - #### _prefix

          protected final String _prefix

    - #### _localName

          protected final 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)

  - ### Constructor Detail

    - #### PName

          protected PName(String pname,
               String prefix,
               String ln)

  - ### Method Detail

    - #### createBoundName

          public abstract PName createBoundName(com.fasterxml.aalto.in.NsBinding nsb)

    - #### getPrefixedName

          public final String getPrefixedName()

    - #### getPrefix

          public final String getPrefix()

      Returns:
        Prefix of this name, if it has one; null if not.

    - #### getLocalName

          public final String getLocalName()

    - #### hasPrefix

          public boolean hasPrefix()

    - #### hasPrefixedName

          public boolean hasPrefixedName(String n)

    - #### getNsBinding

          public final com.fasterxml.aalto.in.NsBinding getNsBinding()

    - #### getNsUri

          public final String getNsUri()

    - #### constructQName

          public final QName constructQName()

    - #### constructQName

          public final 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(String nsUri,
                            String ln)

    - #### unboundHashCode

          public final int unboundHashCode()

    - #### boundHashCode

          public final int boundHashCode()

    - #### boundHashCode

          public static int boundHashCode(String nsURI,
                          String localName)

    - #### toString

          public final String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public final boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### sizeInQuads

          public abstract int sizeInQuads()

    - #### getFirstQuad

          public abstract int getFirstQuad()

    - #### getQuad

          public abstract int getQuad(int index)

    - #### getLastQuad

          public abstract int getLastQuad()

Copyright © 2018 FasterXML. All rights reserved.