org.directwebremoting.dwrp
Class JsonNestedOutboundVariable

java.lang.Object
  extended by org.directwebremoting.dwrp.JsonNestedOutboundVariable
All Implemented Interfaces:
OutboundVariable
Direct Known Subclasses:
ArrayJsonOutboundVariable, ObjectJsonOutboundVariable

public abstract class JsonNestedOutboundVariable
extends java.lang.Object
implements OutboundVariable

A helper class for people that want to implement OutboundVariable.

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

Constructor Summary
JsonNestedOutboundVariable()
           
 
Method Summary
 java.lang.String getBuildCode()
          A script that completes the definition of this variable, and may contain reference to other declared variables.
 java.lang.String getDeclareCode()
          A script to declare the variable so it can be referred to.
 OutboundVariable getReferenceVariable()
          Get a reference to this OutboundVariable.
 void prepareAssignCode()
          Things work out if they are doubly referenced during the conversion process, and can't be sure how to create output until that phase is done.
 void prepareBuildDeclareCodes()
          Create build and declare codes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.directwebremoting.extend.OutboundVariable
getAssignCode
 

Constructor Detail

JsonNestedOutboundVariable

public JsonNestedOutboundVariable()
Method Detail

prepareAssignCode

public void prepareAssignCode()
Description copied from interface: OutboundVariable
Things work out if they are doubly referenced during the conversion process, and can't be sure how to create output until that phase is done. This method creates the assign code such that other variables can refer to us when creating build and declare codes

Specified by:
prepareAssignCode in interface OutboundVariable

prepareBuildDeclareCodes

public void prepareBuildDeclareCodes()
Description copied from interface: OutboundVariable
Create build and declare codes.

Specified by:
prepareBuildDeclareCodes in interface OutboundVariable
See Also:
OutboundVariable.prepareAssignCode()

getDeclareCode

public java.lang.String getDeclareCode()
Description copied from interface: OutboundVariable
A script to declare the variable so it can be referred to. This script is guaranteed not to refer to anything that can recurse

Specified by:
getDeclareCode in interface OutboundVariable
Returns:
Returns the declareCode

getBuildCode

public java.lang.String getBuildCode()
Description copied from interface: OutboundVariable
A script that completes the definition of this variable, and may contain reference to other declared variables.

Specified by:
getBuildCode in interface OutboundVariable
Returns:
Returns the buildCode.

getReferenceVariable

public OutboundVariable getReferenceVariable()
Description copied from interface: OutboundVariable
Get a reference to this OutboundVariable. If this already is a reference then this method returns this, or if not it creates one that does.

Specified by:
getReferenceVariable in interface OutboundVariable
Returns:
An OutboundVariable that refers to this one.

Copyright ¬ 2005