org.directwebremoting.extend
Class OutboundContext

java.lang.Object
  extended by org.directwebremoting.extend.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 recursion. This class helps track the conversion process.

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

Constructor Summary
OutboundContext(boolean jsonMode)
          Contexts need to know if they are producing JSON output
 
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
 boolean isJsonMode()
           
 void put(java.lang.Object object, OutboundVariable ss)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OutboundContext

public OutboundContext(boolean jsonMode)
Contexts need to know if they are producing JSON output

Parameters:
jsonMode - Are we producing JSON output?
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

isJsonMode

public boolean isJsonMode()
Returns:
Are we in JSON mode where everything is inline?

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Copyright ยจ 2008