public interface KeyDisplayer extends KeyCoder
An extension of KeyCoder
that adds the displayKeySegment(com.persistit.Key, java.lang.Appendable, java.lang.Class<?>, com.persistit.encoding.CoderContext)
method. This method populates a supplied Appendable
with a
displayable, human-readable representation of the Object value that was
formerly written to a Key
by this KeyDisplayer
.
The toString
method and
decodeDisplayable
methods of Value
preferentially use the
registered KeyDisplayer
, if present, to generate a String
representation of an object value encoded in a Key
.
Modifier and Type | Method and Description |
---|---|
void |
displayKeySegment(Key key,
Appendable target,
Class<?> clazz,
CoderContext context)
Populates the state of the supplied target
Object by
decoding the next key segment of the supplied Key . |
appendKeySegment, decodeKeySegment, isZeroByteFree
void displayKeySegment(Key key, Appendable target, Class<?> clazz, CoderContext context) throws ConversionException
Populates the state of the supplied target Object
by
decoding the next key segment of the supplied Key
. This
method will be called only if this KeyRenderer
has been
registered with the current CoderManager
to encode objects having
the supplied Class
value. In addition, Persistit will never
call this method to decode a value that was null
when
written because null values are handled by built-in encoding logic.
When this method is called the value Key.getIndex()
will be the
offset within the key of the first encoded byte. The key segment is
zero-byte terminated.
key
- The Key
from which interior fields of the object
are to be retrievedtarget
- An @{link Appendable} object into which the key segment is to
be writtenclazz
- The class of the object that was originally encoded into
Value.context
- An arbitrary object that can optionally be supplied by the
application to convey an application-specific context for the
operation. (See CoderContext
.) The default value is
null
.ConversionException
Copyright © 2025 Open Identity Platform Community. All rights reserved.