Open SiteSearch 4.1.1
Final

ORG.oclc.fmts
Class RulesBasedDisplayGenerator

java.lang.Object
  |
  +--ORG.oclc.fmts.RulesBasedDisplayGenerator

public class RulesBasedDisplayGenerator
extends Object
implements DisplayGenerator

The RulesBasedDisplayGenerator class holds the instructions for and defines the methods to generate a customized formatted database record. The inputs for the customized format are read from configuration IniFile objects for a database.

See Also:
DisplayRule, RuleSpec, FieldData, DisplayUserData

Field Summary
 RuleSpec[] ruleSpecs
          FieldData array object containing the fields and instructions for formatting the fields.
 String typeOfFormat
          String data type containing the textual label for the unit.
 
Constructor Summary
RulesBasedDisplayGenerator()
          Constructs a RulesBasedDisplayGenerator object.
 
Method Summary
 Object clone()
          Clones the data in this RulesBasedDisplayGenerator object.
 RuleSpec deleteInstruction(String instructionName)
          Locates a RuleSpec object matching the input instruction name and deletes it from the list of instructions in the object.
 String generate(Vector data, int startRecno, DisplayUserData userData)
          Generates the formatted data for the input data according to the instructions defined for the object.
 RuleSpec getInstruction(String instructionName)
          Locates a RuleSpec object matching the input instruction name.
 void init(IniFile ini, String typeOfFormat)
           
 String toString()
          Generates a String representation of the object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

typeOfFormat

public String typeOfFormat
String data type containing the textual label for the unit.

ruleSpecs

public RuleSpec[] ruleSpecs
FieldData array object containing the fields and instructions for formatting the fields.
Constructor Detail

RulesBasedDisplayGenerator

public RulesBasedDisplayGenerator()
Constructs a RulesBasedDisplayGenerator object.
Method Detail

init

public void init(IniFile ini,
                 String typeOfFormat)
Specified by:
init in interface DisplayGenerator

generate

public String generate(Vector data,
                       int startRecno,
                       DisplayUserData userData)
Generates the formatted data for the input data according to the instructions defined for the object.
Specified by:
generate in interface DisplayGenerator
Parameters:
data - the vector of DataDir objects
startRecno - the starting record number for the data
userData - the DisplayUserData object with the user's context for the instructions.
Returns:
String

getInstruction

public RuleSpec getInstruction(String instructionName)
Locates a RuleSpec object matching the input instruction name.
Parameters:
instructionName - the instruction.
Returns:
RuleSpec the object defining the instruction or null when not found.

deleteInstruction

public RuleSpec deleteInstruction(String instructionName)
Locates a RuleSpec object matching the input instruction name and deletes it from the list of instructions in the object.
Parameters:
instructionName - the instruction.
Returns:
RuleSpec the object defining the instruction to remove or null when not found.

clone

public Object clone()
Clones the data in this RulesBasedDisplayGenerator object. References to the instructions are copied, but the instructions themselves are not cloned.
Overrides:
clone in class Object

toString

public String toString()
Generates a String representation of the object.
Returns:
String
Overrides:
toString in class Object

Open SiteSearch 4.1.1
Final