com.thoughtworks.xstream.core
Interface ReferencingMarshallingContext

All Superinterfaces:
DataHolder, MarshallingContext

public interface ReferencingMarshallingContext
extends MarshallingContext

A MarshallingContext that manages references.

Since:
1.4
Author:
Jörg Schaible

Method Summary
 Path currentPath()
          Deprecated. As of 1.4.2
 Object lookupReference(Object item)
          Request the reference key for the given item
 void registerImplicit(Object item)
          Register an implicit element.
 void replace(Object original, Object replacement)
          Replace the currently marshalled item.
 
Methods inherited from interface com.thoughtworks.xstream.converters.MarshallingContext
convertAnother, convertAnother
 
Methods inherited from interface com.thoughtworks.xstream.converters.DataHolder
get, keys, put
 

Method Detail

currentPath

Path currentPath()
Deprecated. As of 1.4.2

Retrieve the current path.

Returns:
the current path
Since:
1.4

lookupReference

Object lookupReference(Object item)
Request the reference key for the given item

Parameters:
item - the item to lookup
Returns:
the reference key or null
Since:
1.4

replace

void replace(Object original,
             Object replacement)
Replace the currently marshalled item.

Use this method only, if you know exactly what you do! It is a special solution for Serializable types that make usage of the writeReplace method where the replacing object itself is referenced.

Parameters:
original - the original item to convert
replacement - the replacement item that is converted instead
Since:
1.4

registerImplicit

void registerImplicit(Object item)
Register an implicit element. This is typically some kind of collection. Note, that this object may not be referenced anywhere else in the object stream.

Parameters:
item - the object that is implicit
Since:
1.4


Copyright © 2004-2014 XStream. All Rights Reserved.