org.hydrateframework
Class Assembler.TestCol

java.lang.Object
  extended by org.hydrateframework.Assembler.TestCol
All Implemented Interfaces:
Assembler.Discriminator
Enclosing class:
Assembler

public static class Assembler.TestCol
extends java.lang.Object
implements Assembler.Discriminator

A Discriminator implementation that decides whether or not to build an object based on whether a particular column has a particular value.


Constructor Summary
Assembler.TestCol(java.lang.String fldName, java.lang.Object value)
          Construct a TestCol object that will only allow an object to be built if the column named has the value .
Assembler.TestCol(java.lang.String context, java.lang.String objectName)
          Construct a TestCol object that will only allow an object to be built if the column named has the value .
 
Method Summary
 boolean prepareToProcessResults(java.sql.ResultSet rs, java.util.Map columns)
          This call gives the object an opportunity to find the column indexes of any fields of interest to the calculation
 boolean shouldBuild(Assembler bld)
          Determine if the object should be built based on information from the current row of the query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Assembler.TestCol

public Assembler.TestCol(java.lang.String context,
                         java.lang.String objectName)
Construct a TestCol object that will only allow an object to be built if the column named has the value .

Parameters:
context - a string that was supplied on the map line of the object map. This is expected to be of the form 'column=Value' e.g. type='M', index=1, test=true, etc.
objectName - the name of the object that we wish to build. This is ignored

Assembler.TestCol

public Assembler.TestCol(java.lang.String fldName,
                         java.lang.Object value)
Construct a TestCol object that will only allow an object to be built if the column named has the value .

Parameters:
fldName - the name of the column to test
value - the value to test for.
Method Detail

prepareToProcessResults

public boolean prepareToProcessResults(java.sql.ResultSet rs,
                                       java.util.Map columns)
Description copied from interface: Assembler.Discriminator
This call gives the object an opportunity to find the column indexes of any fields of interest to the calculation

Specified by:
prepareToProcessResults in interface Assembler.Discriminator
Parameters:
rs - The ResultSet object holding the data from which objects are about to be built
columns - a mapping between the names of columns found in the query and the names of attributes that this assembler's object is expecting.
Returns:
true if there were no problems

shouldBuild

public boolean shouldBuild(Assembler bld)
Description copied from interface: Assembler.Discriminator
Determine if the object should be built based on information from the current row of the query.

Specified by:
shouldBuild in interface Assembler.Discriminator
Parameters:
bld - the assembler that is about to try to build an object
Returns:
true if the object should be built, false otherwise.


Copyright © 2000 The Hydrate Project. All Rights Reserved.