L
- the type of the RbfLowLevelSerializerpublic abstract class RbfSerializerImpl<L extends RbfLowLevelSerializer> extends Object implements RbfSerializer
Serializer
for RBF formats.Modifier | Constructor and Description |
---|---|
protected |
RbfSerializerImpl(RbfConfiguration<?> config,
Map<Class<?>,RbfEntryPoint> entryPoints,
L lowLevelSerializer)
Constructs a new
RbfSerializerImpl . |
Modifier and Type | Method and Description |
---|---|
void |
close(boolean closeWriter)
Closes the serialization stream.
|
void |
flush()
Flushes the stream.
|
L |
getLowLevelSerializer()
Returns a low level serializer.
|
void |
open(Writer writer)
Opens a new serialization stream based on the given writer.
|
void |
write(Object object)
Writes the given object.
|
protected abstract void |
writePrefix(String prefix)
Writes the prefix.
|
protected abstract void |
writeSimpleValue(Object value,
SimpleTypeMapping<?> mapping)
Writes the given value as a simple value using the simple type mapping.
|
protected RbfSerializerImpl(RbfConfiguration<?> config, Map<Class<?>,RbfEntryPoint> entryPoints, L lowLevelSerializer)
RbfSerializerImpl
.config
- the configurationentryPoints
- a map which maps object types to entry points.lowLevelSerializer
- the low level serializerpublic final void open(Writer writer)
open
in interface Serializer
writer
- the writer to base the stream onpublic final void write(Object object)
write
in interface Serializer
object
- the object to writepublic void flush()
flush
in interface Serializer
public final void close(boolean closeWriter)
closeWriter
is
true, too.close
in interface Serializer
closeWriter
- if true, the underlying writer will be closed, too.public L getLowLevelSerializer()
getLowLevelSerializer
in interface RbfSerializer
getLowLevelSerializer
in interface Serializer
protected abstract void writeSimpleValue(Object value, SimpleTypeMapping<?> mapping)
value
- the value to writemapping
- the simple type mappingprotected abstract void writePrefix(String prefix)
prefix
- the prefixCopyright © 2014. All rights reserved.