org.directwebremoting.dwrp
Class AbstractOutboundVariable

java.lang.Object
  extended by org.directwebremoting.dwrp.AbstractOutboundVariable
All Implemented Interfaces:
OutboundVariable
Direct Known Subclasses:
ArrayOutboundVariable, ErrorOutboundVariable, ObjectOutboundVariable, SimpleOutboundVariable

public abstract class AbstractOutboundVariable
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]

Nested Class Summary
protected  class AbstractOutboundVariable.NotInlineDefinition
          A helper struct to pass a build code and define code together
 
Constructor Summary
protected AbstractOutboundVariable(OutboundContext outboundContext)
           
 
Method Summary
protected  void forceInline(boolean inlineStatus)
          We might want to force us into predefined mode.
 java.lang.String getAssignCode()
           
 java.lang.String getBuildCode()
           
 java.lang.String getDeclareCode()
           
protected abstract  java.lang.String getInlineDefinition()
          Define the definition we should use if we are being used inline
protected abstract  AbstractOutboundVariable.NotInlineDefinition getNotInlineDefinition()
          Define the definition we should use if we are being used not inline
 OutboundVariable getReferenceVariable()
          Get a reference to this OutboundVariable.
protected  java.lang.String getVariableName()
           
protected  void setChildren(java.util.Collection children)
           
protected  java.lang.String toStringDefinitionHint()
          A helper to children get have definition info in Object.toString()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOutboundVariable

protected AbstractOutboundVariable(OutboundContext outboundContext)
Parameters:
outboundContext - the OutboundContext to set
Method Detail

forceInline

protected void forceInline(boolean inlineStatus)
We might want to force us into predefined mode.

Parameters:
inlineStatus - The inline status to force

setChildren

protected void setChildren(java.util.Collection children)
Parameters:
children - the dependent children of this variable

getDeclareCode

public java.lang.String getDeclareCode()
Specified by:
getDeclareCode in interface OutboundVariable
Returns:
Returns the declareCode

getBuildCode

public java.lang.String getBuildCode()
Specified by:
getBuildCode in interface OutboundVariable
Returns:
Returns the buildCode.

getAssignCode

public java.lang.String getAssignCode()
Specified by:
getAssignCode in interface OutboundVariable
Returns:
Returns the assignCode.

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.

getVariableName

protected java.lang.String getVariableName()
Returns:
the varName

getNotInlineDefinition

protected abstract AbstractOutboundVariable.NotInlineDefinition getNotInlineDefinition()
Define the definition we should use if we are being used not inline

Returns:
an out of line definition

getInlineDefinition

protected abstract java.lang.String getInlineDefinition()
Define the definition we should use if we are being used inline

Returns:
an inline definition

toStringDefinitionHint

protected java.lang.String toStringDefinitionHint()
A helper to children get have definition info in Object.toString()

Returns:
For children to use in Object.toString()