Class WName

java.lang.Object
com.fasterxml.aalto.out.WName
Direct Known Subclasses:
ByteWName, CharWName

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 Details

    • _prefix

      protected final String _prefix
    • _localName

      protected final String _localName
  • Constructor Details

  • Method Details

    • 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)