com.fasterxml.aalto.out

## Class WName

- java.lang.Object
- - com.fasterxml.aalto.out.WName

- Direct Known Subclasses:
    ByteWName

      public abstract class WName
      extends Object

  This class is similar to `PName`, in that it implements an efficient representation of prefixed names, but one used on output (Writer) side.

  Note: unlike with Reader-side prefixed names, here we can not assume that components are `intern()`ed.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `_localName`
    `protected String` | `_prefix`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract int` | `appendBytes(byte[] buffer, int offset)`
    `abstract int` | `appendChars(char[] buffer, int offset)`
    `boolean` | `equals(Object o)`
    `String` | `getLocalName()`
    `String` | `getPrefix()`
    `String` | `getPrefixedName()`
    `int` | `hashCode()` Whether we should use internal hash, or the hash of prefixed name string itself is an open question.
    `boolean` | `hasName(String localName)`
    `boolean` | `hasName(String prefix, String localName)`
    `boolean` | `hasPrefix()`
    `abstract int` | `serializedLength()`
    `String` | `toString()`
    `abstract void` | `writeBytes(OutputStream out)`
    `abstract void` | `writeChars(Writer w)`

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

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

- - ### Field Detail

    - #### _prefix

          protected final String _prefix

    - #### _localName

          protected final String _localName

  - ### Constructor Detail

    - #### WName

          protected WName(String ln)

    - #### WName

          protected WName(String prefix,
               String ln)

  - ### Method Detail

    - #### serializedLength

          public abstract int serializedLength()

      Returns:
        Length of full (qualified) name, in native serialization units (bytes or characters)

    - #### getPrefix

          public final String getPrefix()

    - #### getPrefixedName

          public final String getPrefixedName()

    - #### getLocalName

          public final String getLocalName()

    - #### hasPrefix

          public final boolean hasPrefix()

    - #### appendBytes

          public abstract int appendBytes(byte[] buffer,
                        int offset)

    - #### writeBytes

          public abstract void writeBytes(OutputStream out)
                                   throws IOException

      Throws:
        `IOException`

    - #### appendChars

          public abstract int appendChars(char[] buffer,
                        int offset)

    - #### writeChars

          public abstract void writeChars(Writer w)
                                   throws IOException

      Throws:
        `IOException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public final boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Whether we should use internal hash, or the hash of prefixed name string itself is an open question. For now, let's use former.
      Overrides:
        `hashCode` in class `Object`

    - #### hasName

          public final boolean hasName(String localName)

    - #### hasName

          public final boolean hasName(String prefix,
                        String localName)

Copyright © 2012-2015 FasterXML. All Rights Reserved.