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.
_prefix
protected final String _prefix
_localName
protected final String _localName
WName
protected WName(String ln)
WName
protected WName(String prefix,
String ln)
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 Fasterxml.com. All Rights Reserved.