public final class MarshallableTypeHints
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
MarshallableTypeHints.MarshallingType |
Modifier and Type | Field and Description |
---|---|
private static Log |
log |
private static boolean |
trace |
private java.util.concurrent.ConcurrentMap<java.lang.Class<?>,MarshallableTypeHints.MarshallingType> |
typeHints
Cache of classes that are considered to be marshallable alongside their
buffer size predictor.
|
Constructor and Description |
---|
MarshallableTypeHints() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the cached marshallable type hints.
|
BufferSizePredictor |
getBufferSizePredictor(java.lang.Class<?> type)
Get the serialized form size predictor for a particular type.
|
boolean |
isKnownMarshallable(java.lang.Class<?> type)
Returns whether the hint on whether a particular type is marshallable or
not is available.
|
boolean |
isMarshallable(java.lang.Class<?> type)
Returns whether a type can be serialized.
|
void |
markMarshallable(java.lang.Class<?> type,
boolean isMarshallable)
Marks a particular type as being marshallable or not being not marshallable.
|
private boolean |
marshallableUpdateRequired(boolean isMarshallable,
MarshallableTypeHints.MarshallingType marshallType) |
private static final Log log
private static final boolean trace
private final java.util.concurrent.ConcurrentMap<java.lang.Class<?>,MarshallableTypeHints.MarshallingType> typeHints
public BufferSizePredictor getBufferSizePredictor(java.lang.Class<?> type)
type
- Marshallable type for which serialized form size will be predictedBufferSizePredictor
public boolean isKnownMarshallable(java.lang.Class<?> type)
type
- Marshallable type to check whether an attempt to mark it as
marshallable has been made.public boolean isMarshallable(java.lang.Class<?> type)
markMarshallable(Class, boolean)
method earlier,
passing true as parameter. If a type has not yet been marked as
marshallable, this method will return false.public void markMarshallable(java.lang.Class<?> type, boolean isMarshallable)
type
- Class to mark as serializable or non-serializableisMarshallable
- Whether the type can be marshalled or not.public void clear()
private boolean marshallableUpdateRequired(boolean isMarshallable, MarshallableTypeHints.MarshallingType marshallType)