org.jaffa.components.codehelper.tx
Class CodeHelperTx

java.lang.Object
  extended byorg.jaffa.components.codehelper.tx.CodeHelperTx
All Implemented Interfaces:
ICodeHelper

public class CodeHelperTx
extends Object
implements ICodeHelper

This is the default implementation of the ICodeHelper interface. It will retrieve codes for each domainClassName passed in the input. It will use reflection to determine the fields to return. Additional criteria can also be passed in the input, to restrict the output. For complex queries, create custom implementations of the interface, rather than making this generic implementation complex !!!

Author:
GautamJ

Constructor Summary
CodeHelperTx()
           
 
Method Summary
 void destroy()
          This should be invoked, when done with the helper.
static Object formatDescription(CodeHelperInElementDto inputElement, Object code, Object description)
          This method is used to format the description field.
 CodeHelperOutDto getCodes(CodeHelperInDto input)
          Retrieves the Codes for the specified domainClassName passed in the input.
static void main(String[] args)
          Test stub
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeHelperTx

public CodeHelperTx()
Method Detail

destroy

public void destroy()
This should be invoked, when done with the helper. This will ensure that all the acquired resources are released.

Specified by:
destroy in interface ICodeHelper

getCodes

public CodeHelperOutDto getCodes(CodeHelperInDto input)
                          throws ApplicationExceptions,
                                 FrameworkException
Retrieves the Codes for the specified domainClassName passed in the input.

Specified by:
getCodes in interface ICodeHelper
Parameters:
input - The input dto, containing a list of domainClass to retrieve.
Returns:
The Codes for each domainClassName passed in the input.
Throws:
ApplicationExceptions - This will be thrown if any invalid data is passed.
FrameworkException - Indicates some system error.

formatDescription

public static Object formatDescription(CodeHelperInElementDto inputElement,
                                       Object code,
                                       Object description)
This method is used to format the description field. It returns the description as is, if the 'appendCodeAndDescription' flag is false. Otherwise, it appends the code and description, using the markers specified in the inputElement. If no markers are specified, then the format will be 'code (description)'.

Parameters:
inputElement - The input to the ICodeHelper.
code - The code value.
description - The description for the code.
Returns:
a formatted description.

main

public static void main(String[] args)
Test stub

Parameters:
args - arguments


Copyright © 2002-2004 JAFFA Project.