net.wgen.op.db.xform
Class HandlingOption

java.lang.Object
  extended bynet.wgen.op.db.xform.HandlingOption
Direct Known Subclasses:
SaveSetHandlingOption

public class HandlingOption
extends java.lang.Object

Options set in Ops and DatabaseCalls and used by OpExecutors and CallExecutors to invoke special behavior.

Version:
$Id: HandlingOption.html,v 1.2 2007/01/28 04:09:37 paulfeuer Exp $
Author:
Paul Feuer, Wireless Generation, Inc.

Field Summary
private  java.lang.String _name
           
static HandlingOption PROP_CONNECTION_TYPE_MAP
          Property of a DatabaseCall that stores a connectionTypeMap needed for functions using SQLData objects.
static HandlingOption PROP_LOB_HANDLER
           
static HandlingOption PROP_ROW_TRANSFORMER
           
static HandlingOption PROP_RS_KEY_TRANSFORM_CALLBACK
           
static HandlingOption PROP_RS_VALUE_TRANSFORM_CALLBACK
           
static HandlingOption PROP_TRUNCATE_AT_LENGTH_IN_CALL_TO_STRING
          Property used by the DatabaseCall.toValuePopulatedString() to truncate possibly long Strings in logging statements.
static HandlingOption PROP_VALUE_TRANSFORM_CALLBACK
          Property of a DatabaseCall or Parameter that stores a Transformer that is called when processing a value returned from the database.
 
Constructor Summary
HandlingOption(java.lang.String name)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getName()
           
static OutputTransformCallback getOutputTransformCallback(DatabaseCall call, Parameter parameter, int paramIdx, HandlingOption handlingOption)
          An OutputTransformCallback registered at handlingOption in the Parameter or Call's options.
 int hashCode()
           
 void postCall(java.lang.String contextTag, DatabaseCall call)
           
 void preCall(java.lang.String contextTag, DatabaseCall call)
           
static java.lang.Object processCallback(java.lang.Object obj, java.lang.String context, DatabaseCall call, Parameter parameter, int paramIdx, HandlingOption option)
          Process a transformation callback.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_RS_KEY_TRANSFORM_CALLBACK

public static final HandlingOption PROP_RS_KEY_TRANSFORM_CALLBACK

PROP_RS_VALUE_TRANSFORM_CALLBACK

public static final HandlingOption PROP_RS_VALUE_TRANSFORM_CALLBACK

PROP_VALUE_TRANSFORM_CALLBACK

public static final HandlingOption PROP_VALUE_TRANSFORM_CALLBACK
Property of a DatabaseCall or Parameter that stores a Transformer that is called when processing a value returned from the database.

See Also:
processCallback(Object, String, net.wgen.op.db.DatabaseCall, net.wgen.op.db.Parameter, int, HandlingOption), CallOutputHandler.transformOutput(int, net.wgen.op.db.Parameter, Object), CallOutputHandler.translateSqlArrayToJava(int, net.wgen.op.db.Parameter, java.sql.Array), CallOutputHandlerDBUnit.transformFromITable(int, net.wgen.op.db.Parameter, org.dbunit.dataset.ITable), ResultSetRowToMapTransformer.transformRow(java.sql.ResultSet)

PROP_CONNECTION_TYPE_MAP

public static final HandlingOption PROP_CONNECTION_TYPE_MAP
Property of a DatabaseCall that stores a connectionTypeMap needed for functions using SQLData objects.

See Also:
SqlStatementBuilder.processConnectionOptions()

PROP_TRUNCATE_AT_LENGTH_IN_CALL_TO_STRING

public static final HandlingOption PROP_TRUNCATE_AT_LENGTH_IN_CALL_TO_STRING
Property used by the DatabaseCall.toValuePopulatedString() to truncate possibly long Strings in logging statements.

See Also:
DatabaseCall.toValuePopulatedString(), DatabaseCall.DEFAULT_TRUNCATE_AT_LENGTH_IN_CALL_TO_STRING

PROP_ROW_TRANSFORMER

public static final HandlingOption PROP_ROW_TRANSFORMER

PROP_LOB_HANDLER

public static final HandlingOption PROP_LOB_HANDLER

_name

private final java.lang.String _name
Constructor Detail

HandlingOption

public HandlingOption(java.lang.String name)
Method Detail

processCallback

public static java.lang.Object processCallback(java.lang.Object obj,
                                               java.lang.String context,
                                               DatabaseCall call,
                                               Parameter parameter,
                                               int paramIdx,
                                               HandlingOption option)
Process a transformation callback.

Parameters:
obj - the object to pass into the transformer if the transformer is found
context - the context (in the case of a resultset value transform, the column name)
call - the call being processed
parameter - the parameter being processed
paramIdx - the index of the parameter
option - the option
Returns:
if a transformer is found, the transformed object, otherwise the object as it was sent in

getOutputTransformCallback

public static OutputTransformCallback getOutputTransformCallback(DatabaseCall call,
                                                                 Parameter parameter,
                                                                 int paramIdx,
                                                                 HandlingOption handlingOption)
An OutputTransformCallback registered at handlingOption in the Parameter or Call's options.

Parameters:
call -
parameter -
paramIdx -
handlingOption -
Returns:
the callback registered at the handlingOption if present

getName

public java.lang.String getName()

toString

public java.lang.String toString()

preCall

public void preCall(java.lang.String contextTag,
                    DatabaseCall call)

postCall

public void postCall(java.lang.String contextTag,
                     DatabaseCall call)

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()