uk.ltd.getahead.dwr
Class OutboundContext

java.lang.Object
  extended byuk.ltd.getahead.dwr.OutboundContext

public final class OutboundContext
extends java.lang.Object

We need to keep track of stuff while we are converting on the way out to prevent recurrsion. This class helps track the conversion process.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Field Summary
static java.lang.String OUTBOUND_VARIABLE_PREFIX
          The prefix for outbound variable names the we generate
 
Constructor Summary
OutboundContext()
          Since map needs to have referencial equality rather than object equality this constructor tries to use java.util.IdentityHashMap (>=1.4), and failing that falls back on wrapper objects in a HashMap.
 
Method Summary
 OutboundVariable get(java.lang.Object object)
          Have we already converted an object?
 java.lang.String getNextVariableName()
          Create a new variable name to keep everything we declare separate
 void put(java.lang.Object object, OutboundVariable ss)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OUTBOUND_VARIABLE_PREFIX

public static final java.lang.String OUTBOUND_VARIABLE_PREFIX
The prefix for outbound variable names the we generate

See Also:
Constant Field Values
Constructor Detail

OutboundContext

public OutboundContext()
Since map needs to have referencial equality rather than object equality this constructor tries to use java.util.IdentityHashMap (>=1.4), and failing that falls back on wrapper objects in a HashMap.

Method Detail

get

public OutboundVariable get(java.lang.Object object)
Have we already converted an object?

Parameters:
object - The object to check
Returns:
How it was converted last time or null if we've not seen it before

put

public void put(java.lang.Object object,
                OutboundVariable ss)
Parameters:
object - We have converted a new object, remember it
ss - How the object was converted

getNextVariableName

public java.lang.String getNextVariableName()
Create a new variable name to keep everything we declare separate

Returns:
A new unique variable name

Copyright ? 2005