com.iplanet.jato.view
Class CommandSourceTargetPair

java.lang.Object
  |
  +--com.iplanet.jato.view.CommandSourceTargetPair

public class CommandSourceTargetPair
extends java.lang.Object

Defines a pairing of a value source and a value target. This class does not implement any behavior related to the passing of values from source to target. Instead, that behavior is left to the classes which use CommandSourceTargetPair. This class merely formalizes the relationship between a source and a target and contains sufficient information for the run time resolution of source and target objects which correspond to the specifications in this object.

With this late binding technique, the source and target objects do not need to exist at the time the CommandSourceTargetPair is defined. However, the assumption is that objects which correspond to those described in this pair will exist by the time the pairing of source value with value target commences.

Version:
JATO/1.2.2 $Id: CommandSourceTargetPair.java,v 1.9 2002/03/16 03:26:40 todd Exp $
See Also:
CommandFieldDescriptor, Button, HREF

Field Summary
static int DISPLAY_FIELD_TYPE
           
static int HTTP_SESSION_TYPE
           
protected static java.lang.String INVALID_TYPE_MSG
           
static int MODEL_FIELD_TYPE
           
static int PAGE_SESSION_TYPE
           
static java.lang.String SOURCE_VALUE_NVP_NAME_PREFIX
           
static int SQL_OBJECT_TYPE
          Deprecated. This name is insufficiently clear. Use SQL_WHERE_TYPE instead.
static int SQL_WHERE_TYPE
           
static int USER_SESSION_OBJECT_TYPE
          Deprecated. Use HTTP_SESSION_TYPE instead
 
Constructor Summary
CommandSourceTargetPair(int sourceType, java.lang.Class sourceClass, java.lang.String qualifiedSourceName, int targetType, java.lang.Class targetClass, java.lang.String qualifiedTargetName)
           
 
Method Summary
protected  boolean checkType(int type)
          Checks to make sure the supplied type matched one of the supported types.
 java.lang.String getQualifiedSourceName()
          Returns the source object's qualified name
 java.lang.String getQualifiedTargetName()
          Returns the target object's qualified name
 java.lang.Class getSourceClass()
          Returns the class of the object that ultimately contains the source object (i.e.
 java.lang.String[] getSourcePath()
          Returns the source object's qualified name as a String array
 int getSourceType()
          Returns the source object's "type"
 java.lang.Class getTargetClass()
          Returns the class of the object that ultimately contains the target object (i.e.
 java.lang.String[] getTargetPath()
          Returns the target object's qualified name as a String array
 int getTargetType()
          Returns the target object's "type"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SQL_OBJECT_TYPE

public static final int SQL_OBJECT_TYPE
Deprecated. This name is insufficiently clear. Use SQL_WHERE_TYPE instead.


SQL_WHERE_TYPE

public static final int SQL_WHERE_TYPE

MODEL_FIELD_TYPE

public static final int MODEL_FIELD_TYPE

DISPLAY_FIELD_TYPE

public static final int DISPLAY_FIELD_TYPE

PAGE_SESSION_TYPE

public static final int PAGE_SESSION_TYPE

HTTP_SESSION_TYPE

public static final int HTTP_SESSION_TYPE

USER_SESSION_OBJECT_TYPE

public static final int USER_SESSION_OBJECT_TYPE
Deprecated. Use HTTP_SESSION_TYPE instead


INVALID_TYPE_MSG

protected static final java.lang.String INVALID_TYPE_MSG

SOURCE_VALUE_NVP_NAME_PREFIX

public static final java.lang.String SOURCE_VALUE_NVP_NAME_PREFIX
Constructor Detail

CommandSourceTargetPair

public CommandSourceTargetPair(int sourceType,
                               java.lang.Class sourceClass,
                               java.lang.String qualifiedSourceName,
                               int targetType,
                               java.lang.Class targetClass,
                               java.lang.String qualifiedTargetName)
                        throws java.lang.IllegalArgumentException
Parameters:
sourceType - The source object's type as one of the pre-defined types specified by this class. (valid values are SQL_WHERE_TYPE, MODEL_FIELD_TYPE, DISPLAY_FIELD_TYPE, PAGE_SESSION_TYPE, HTTP_SESSION_TYPE)
sourceClass - The class which contains the source object If the source object is a display field, then the class should be the ViewBean that is the ultimate container of the source object.
qualifiedSourceName - The logical name of the source object as a period delimited sequence of names which fully describe the containment hierarchy of the source object (e.g. "Page1.Repeated2.Foo" )
targetType - The target object's type as one of the pre-defined types specified by this class. (valid values are SQL_WHERE_TYPE, MODEL_FIELD_TYPE, DISPLAY_FIELD_TYPE, PAGE_SESSION_TYPE, HTTP_SESSION_TYPE)
targetClass - The class which contains the target object If the source object is a display field, then the class should be the ViewBean that is the ultimate container of the target object.
qualifiedTargetName - The logical name of the target object as a period delimited sequence of names which fully describe the containment hierarchy of the target object (e.g. "Page2.Repeated1.Bar" )
Method Detail

checkType

protected boolean checkType(int type)
Checks to make sure the supplied type matched one of the supported types.
Parameters:
type - Typically, an int constant corresponding to one of the pre-defined types specified by this class. (valid values are SQL_WHERE_TYPE, MODEL_FIELD_TYPE, DISPLAY_FIELD_TYPE, PAGE_SESSION_TYPE, HTTP_SESSION_TYPE)
Returns:
true if the paramater matches one of the supported types.

getSourceType

public int getSourceType()
Returns the source object's "type"
Returns:
the source object's type an int constant corresponding to one of the pre-defined types specified by this class. (valid values are SQL_WHERE_TYPE, MODEL_FIELD_TYPE, DISPLAY_FIELD_TYPE, PAGE_SESSION_TYPE, HTTP_SESSION_TYPE)

getTargetType

public int getTargetType()
Returns the target object's "type"
Returns:
the target object's type an int constant corresponding to one of the pre-defined types specified by this class. (valid values are SQL_WHERE_TYPE, MODEL_FIELD_TYPE, DISPLAY_FIELD_TYPE, PAGE_SESSION_TYPE, HTTP_SESSION_TYPE)

getQualifiedSourceName

public java.lang.String getQualifiedSourceName()
Returns the source object's qualified name
Returns:
The logical name of the source object as a period delimited sequence of names which fully describe the containment hierarchy of the source object (e.g. "Page1.Repeated2.Foo" )

getQualifiedTargetName

public java.lang.String getQualifiedTargetName()
Returns the target object's qualified name
Returns:
The logical name of the target object as a period delimited sequence of names which fully describe the containment hierarchy of the target object (e.g. "Page2.Repeated1.Bar" )

getSourcePath

public java.lang.String[] getSourcePath()
Returns the source object's qualified name as a String array
Returns:
The logical name of the source object as a String array

getTargetPath

public java.lang.String[] getTargetPath()
Returns the target object's qualified name as a String array
Returns:
The logical name of the target object as a String array

getSourceClass

public java.lang.Class getSourceClass()
Returns the class of the object that ultimately contains the source object (i.e. if the source object is a display field, then this will return the class object that corresponds to the ViewBean parent of the display field)
Returns:
the source's container's class.

getTargetClass

public java.lang.Class getTargetClass()
Returns the class of the object that ultimately contains the target object (i.e. if the target object is a display field, then this will return the class object that corresponds to the ViewBean parent of the display field)
Returns:
the target's container's class.