Package com.fasterxml.aalto.out
Class WName
- java.lang.Object
-
- com.fasterxml.aalto.out.WName
-
public abstract class WName extends java.lang.Object
This class is similar toPName
, 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 Description protected java.lang.String
_localName
protected java.lang.String
_prefix
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract int
appendBytes(byte[] buffer, int offset)
abstract int
appendChars(char[] buffer, int offset)
boolean
equals(java.lang.Object o)
java.lang.String
getLocalName()
java.lang.String
getPrefix()
java.lang.String
getPrefixedName()
int
hashCode()
Whether we should use internal hash, or the hash of prefixed name string itself is an open question.boolean
hasName(java.lang.String localName)
boolean
hasName(java.lang.String prefix, java.lang.String localName)
boolean
hasPrefix()
abstract int
serializedLength()
java.lang.String
toString()
abstract void
writeBytes(java.io.OutputStream out)
abstract void
writeChars(java.io.Writer w)
-
-
-
Method Detail
-
serializedLength
public abstract int serializedLength()
- Returns:
- Length of full (qualified) name, in native serialization units (bytes or characters)
-
getPrefix
public final java.lang.String getPrefix()
-
getPrefixedName
public final java.lang.String getPrefixedName()
-
getLocalName
public final java.lang.String getLocalName()
-
hasPrefix
public final boolean hasPrefix()
-
appendBytes
public abstract int appendBytes(byte[] buffer, int offset)
-
writeBytes
public abstract void writeBytes(java.io.OutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
appendChars
public abstract int appendChars(char[] buffer, int offset)
-
writeChars
public abstract void writeChars(java.io.Writer w) throws java.io.IOException
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.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 classjava.lang.Object
-
hasName
public final boolean hasName(java.lang.String localName)
-
hasName
public final boolean hasName(java.lang.String prefix, java.lang.String localName)
-
-