|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fudgemsg.mapping.FudgeDeserializationContext
public class FudgeDeserializationContext
The central point for Fudge message to Java Object deserialization on a given stream. Note that the deserializer cannot process cyclic object graphs at the moment because of the way the builder interfaces are structured (i.e. we don't have access to an outer object until it's builder returned).
The object builder framework methods all take a deserialization context so that a deserializer can refer any sub-messages to this for construction if it does not have sufficient information to process them directly.
Constructor Summary | |
---|---|
FudgeDeserializationContext(FudgeContext fudgeContext)
Creates a new FudgeDeserializationContext for the given FudgeContext . |
Method Summary | ||
---|---|---|
|
fieldValueToObject(Class<T> clazz,
FudgeField field)
Converts a field value to a Java object with a specific type. |
|
Object |
fieldValueToObject(FudgeField field)
Converts a field value to a Java object. |
|
|
fudgeMsgToObject(Class<T> clazz,
FudgeFieldContainer message)
Converts a Fudge message to a specific Java type. |
|
Object |
fudgeMsgToObject(FudgeFieldContainer message)
Converts a Fudge message to a best guess Java object. |
|
FudgeContext |
getFudgeContext()
Returns the associated FudgeContext . |
|
void |
reset()
Resets the buffers used for object graph logics. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FudgeDeserializationContext(FudgeContext fudgeContext)
FudgeDeserializationContext
for the given FudgeContext
.
fudgeContext
- the FudgeContext
to useMethod Detail |
---|
public void reset()
reset()
on this context
should match a call to FudgeSerializationContext.reset()
on the context used by the serialiser
to keep the states of both sender and receiver consistent.
public FudgeContext getFudgeContext()
FudgeContext
.
FudgeContext
.public Object fieldValueToObject(FudgeField field)
FudgeTypeDictionary
or if it is a sub-message will be expanded through fudgeMsgToObject(FudgeFieldContainer)
.
field
- field to convert
public <T> T fieldValueToObject(Class<T> clazz, FudgeField field)
FudgeTypeDictionary
or if it is a sub-message will be expanded through fudgeMsgToObject(Class,FudgeFieldContainer)
.
T
- target Java type to decode toclazz
- class of the target Java type to decode tofield
- value to decode
public Object fudgeMsgToObject(FudgeFieldContainer message)
List
and Map
encodings are recognized and inflated. Any other encodings
require field ordinal 0 to include possible class names to use.
message
- message to deserialize
public <T> T fudgeMsgToObject(Class<T> clazz, FudgeFieldContainer message)
FudgeObjectDictionary
is used to identify a builder to delegate to. If
the message includes class names in ordinal 0, these will be tested for a valid builder and used if they will provide a subclass of
the requested class.
T
- target Java type to decode toclazz
- class of the target Java type to decode tomessage
- message to deserialise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |