org.directwebremoting.extend
Class InboundVariable

java.lang.Object
  extended by org.directwebremoting.extend.InboundVariable

public final class InboundVariable
extends java.lang.Object

A simple struct to hold data about a single converted javascript variable. An inbound variable will have either a value or a fileValue but not both. If file is true fileValue will be populated, otherwise value will be populated.

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

Constructor Summary
InboundVariable(InboundContext context)
          Constructor for when we need something to represent null
InboundVariable(InboundContext context, InboundVariable[] members)
          Constructor for when we need to temporarily create an InboundVariable for sorting out varargs
InboundVariable(InboundContext context, java.lang.String key, java.lang.String type, FormField fileField)
          Parsing ctor
InboundVariable(InboundContext context, java.lang.String key, java.lang.String type, java.lang.String value)
          Parsing ctor
 
Method Summary
 void dereference()
          Attempt to de-reference an inbound variable.
 boolean equals(java.lang.Object obj)
           
 InboundContext getContext()
          Accessor of the context of the variable: the other related variables
 FormField getFormField()
           
 InboundVariable[] getMembers()
          Nasty hack to get around varargs
 java.lang.String getNamedObjectType()
          If we are using object parameters that have specified types then the ConverterManager will need to get to know what the required type is.
 java.lang.String getType()
           
 java.lang.String getValue()
           
 int hashCode()
           
 boolean isNull()
          Was this type null on the way in
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InboundVariable

public InboundVariable(InboundContext context,
                       java.lang.String key,
                       java.lang.String type,
                       java.lang.String value)
Parsing ctor

Parameters:
context - How we lookup references
key - The name of the variable that this was transfered as
type - The type information from javascript
value - The javascript variable converted to a string

InboundVariable

public InboundVariable(InboundContext context,
                       java.lang.String key,
                       java.lang.String type,
                       FormField fileField)
Parsing ctor

Parameters:
context - How we lookup references
key - The name of the variable that this was transfered as
type - The type information from javascript
fileField - The javascript variable converted to a FormField

InboundVariable

public InboundVariable(InboundContext context)
Constructor for when we need something to represent null

Parameters:
context - How we lookup references

InboundVariable

public InboundVariable(InboundContext context,
                       InboundVariable[] members)
Constructor for when we need to temporarily create an InboundVariable for sorting out varargs

Parameters:
context - How we lookup references
Method Detail

getContext

public InboundContext getContext()
Accessor of the context of the variable: the other related variables


dereference

public void dereference()
                 throws ConversionException
Attempt to de-reference an inbound variable. We try de-referencing as soon as possible (why? there is a good reason for it, it fixes some bug, but I can't remember what right now) However the referenced variable may not exist yet, so the de-referencing may fail, requiring us to have another go later.

Throws:
ConversionException - If cross-references don't add up

getNamedObjectType

public java.lang.String getNamedObjectType()
If we are using object parameters that have specified types then the ConverterManager will need to get to know what the required type is.

Returns:
The requested object type, or null if one was not specified

isNull

public boolean isNull()
Was this type null on the way in

Returns:
true if the javascript variable was null or undefined.

getValue

public java.lang.String getValue()
Returns:
Returns the value.

getFormField

public FormField getFormField()
Returns:
Returns the file value

getType

public java.lang.String getType()
Returns:
Returns the JavaScript type.

getMembers

public InboundVariable[] getMembers()
Nasty hack to get around varargs


toString

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Copyright 2008