Refined implementation of DeserializationContext and SerializationContext.