org.kuali.kfs.sys.document.web
Class CodeDescriptionFormatterBase

java.lang.Object
  extended by org.kuali.kfs.sys.document.web.CodeDescriptionFormatterBase
All Implemented Interfaces:
CodeDescriptionFormatter
Direct Known Subclasses:
DocumentationLocationCodeDescriptionFormatter, ObjectCodeDescriptionFormatter, ObjectLevelCodeDescriptionFormatter, ObjectTypeCodeDescriptionFormatter, SubFundGroupCodeDescriptionFormatter

public abstract class CodeDescriptionFormatterBase
extends Object
implements CodeDescriptionFormatter

This class...


Field Summary
static String DEFAULT_DESCRIPTION
           
static int INIT_BUFFER_SIZE
          The output string will probably be larger than the default StringBuffer size of 10, so lets avoid 1 memory allocation and copy
 
Constructor Summary
CodeDescriptionFormatterBase()
           
 
Method Summary
protected  String getDefaultDescription()
           
protected abstract  String getDescriptionOfBO(org.kuali.rice.kns.bo.PersistableBusinessObject bo)
          Returns the description of a BO
 String getFormattedStringWithDescriptions(Set values, String startConjunction, String endConjunction)
          Given a set of codes, this class will form a format a string that includes their description Example: Codes A, B, C may be formatted to "A, descA; B, descB; and C; descC"
protected abstract  Map<String,org.kuali.rice.kns.bo.PersistableBusinessObject> getValuesToBusinessObjectsMap(Set values)
          Returns a Map such that the values in the values set will map to the appropriate BO There may be mappings for values that are not in the parameter set Use this method sparingly, as it will likely cause an access to the DB It may be desirable to use the values to limit the breadth of the search, and it is up to the implementation to decide whether to use it to do so.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DESCRIPTION

public static final String DEFAULT_DESCRIPTION
See Also:
Constant Field Values

INIT_BUFFER_SIZE

public static final int INIT_BUFFER_SIZE
The output string will probably be larger than the default StringBuffer size of 10, so lets avoid 1 memory allocation and copy

See Also:
Constant Field Values
Constructor Detail

CodeDescriptionFormatterBase

public CodeDescriptionFormatterBase()
Method Detail

getFormattedStringWithDescriptions

public String getFormattedStringWithDescriptions(Set values,
                                                 String startConjunction,
                                                 String endConjunction)
Description copied from interface: CodeDescriptionFormatter
Given a set of codes, this class will form a format a string that includes their description Example: Codes A, B, C may be formatted to "A, descA; B, descB; and C; descC"

Specified by:
getFormattedStringWithDescriptions in interface CodeDescriptionFormatter
startConjunction - a conjunction or phrase to be used for the beginning of the series (e.g. "either", "neither", "any 3 of" etc.)
endConjunction - a conjunction to be used for the beginning of the series (e.g. "and", "or", "and/or")
Returns:
See Also:
org.kuali.kfs.sys.document.webCodeDescriptionFormatter#getFormattedStringWithDescriptions(java.util.Set, java.lang.String, java.lang.String)

getValuesToBusinessObjectsMap

protected abstract Map<String,org.kuali.rice.kns.bo.PersistableBusinessObject> getValuesToBusinessObjectsMap(Set values)
Returns a Map such that the values in the values set will map to the appropriate BO There may be mappings for values that are not in the parameter set Use this method sparingly, as it will likely cause an access to the DB It may be desirable to use the values to limit the breadth of the search, and it is up to the implementation to decide whether to use it to do so.

Parameters:
values - a set of values to limit the retrieval from (optional feature), may be null
Returns:
a map from value string to BO

getDescriptionOfBO

protected abstract String getDescriptionOfBO(org.kuali.rice.kns.bo.PersistableBusinessObject bo)
Returns the description of a BO

Parameters:
bo -
Returns:

getDefaultDescription

protected String getDefaultDescription()


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.