org.kuali.rice.krad.datadictionary
Class AttributeDefinition

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase
      extended by org.kuali.rice.krad.datadictionary.AttributeDefinitionBase
          extended by org.kuali.rice.krad.datadictionary.AttributeDefinition
All Implemented Interfaces:
Serializable, DataDictionaryDefinition, CaseConstrainable, Constrainable, ExistenceConstrainable, Formatable, HierarchicallyConstrainable, LengthConstrainable, MustOccurConstrainable, PrerequisiteConstrainable, RangeConstrainable, ValidCharactersConstrainable, Constraint, DataTypeConstraint, ExistenceConstraint, LengthConstraint, RangeConstraint, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
ExternalizableAttributeDefinitionProxy, KimAttributeDefinition

public class AttributeDefinition
extends AttributeDefinitionBase
implements CaseConstrainable, PrerequisiteConstrainable, Formatable, HierarchicallyConstrainable, MustOccurConstrainable, LengthConstrainable, RangeConstrainable, ValidCharactersConstrainable

A single attribute definition in the DataDictionary, which contains information relating to the display, validation, and general maintenance of a specific attribute of an entry.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
protected  String additionalDisplayAttributeName
           
protected  String alternateDisplayAttributeName
           
protected  AttributeSecurity attributeSecurity
           
protected  CaseConstraint caseConstraint
           
protected  String childEntryName
           
protected  ControlDefinition control
           
protected  Control controlField
           
protected  String customValidatorClass
           
protected  DataType dataType
           
protected  List<PrerequisiteConstraint> dependencyConstraints
           
protected  Boolean dynamic
           
protected  String exclusiveMin
           
protected  Boolean forceUppercase
           
protected  String formatterClass
           
protected  String inclusiveMax
           
protected  String lookupContextPath
           
protected  LookupConstraint lookupDefinition
           
protected  Integer maxLength
           
protected  Integer minLength
           
protected  List<MustOccurConstraint> mustOccurConstraints
           
protected  PropertyEditor propertyEditor
           
protected  Boolean unique
           
protected  ValidationPattern validationPattern
          Deprecated. 
protected  ValidCharactersConstraint validCharactersConstraint
           
 
Fields inherited from class org.kuali.rice.krad.datadictionary.AttributeDefinitionBase
constraintText, description, displayLabelAttribute, label, messageKey, name, required, shortLabel, summary
 
Fields inherited from class org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase
id
 
Constructor Summary
AttributeDefinition()
           
 
Method Summary
 void afterPropertiesSet()
          This overridden method ...
 void completeValidation(Class<?> rootObjectClass, Class<?> otherObjectClass)
          Directly validate simple fields, call completeValidation on Definition fields.
 String getAdditionalDisplayAttributeName()
           
 String getAlternateDisplayAttributeName()
           
 AttributeSecurity getAttributeSecurity()
           
 CaseConstraint getCaseConstraint()
           
 String getChildEntryName()
           
 ControlDefinition getControl()
           
 Control getControlField()
          Default Control to use when the attribute is to be rendered for the UI.
 String getCustomValidatorClass()
           
 DataType getDataType()
          gets the type of an attribute definition
 String getExclusiveMin()
          Determines the minimum value of the field
 Boolean getForceUppercase()
          Indicates whether user entry should be converted to upper case
 String getFormatterClass()
           
 String getInclusiveMax()
          Determines the maximum value of the field
 String getLookupContextPath()
           
 LookupConstraint getLookupDefinition()
           
 Integer getMaxLength()
          Determines the maximum size of the field
 Integer getMinLength()
          Determines the minimum size of the field
 List<MustOccurConstraint> getMustOccurConstraints()
           
 KeyValuesFinder getOptionsFinder()
          Instance of KeyValluesFinder that should be invoked to provide a List of values the field can have.
 List<PrerequisiteConstraint> getPrerequisiteConstraints()
           
 PropertyEditor getPropertyEditor()
          Performs formatting of the field value for display and then converting the value back to its expected type from a string
 Boolean getUnique()
           
 ValidationPattern getValidationPattern()
          Defines the allowable character-level or field-level values for an attribute
 ValidCharactersConstraint getValidCharactersConstraint()
           
 boolean hasAttributeSecurity()
           
 boolean hasFormatterClass()
           
 boolean hasValidationPattern()
          Indicates whether a validation pattern has been set
 void setAdditionalDisplayAttributeName(String additionalDisplayAttributeName)
           
 void setAlternateDisplayAttributeName(String alternateDisplayAttributeName)
           
 void setAttributeSecurity(AttributeSecurity attributeSecurity)
           
 void setCaseConstraint(CaseConstraint caseConstraint)
           
 void setChildEntryName(String childEntryName)
           
 void setControl(ControlDefinition control)
          The control element defines the manner in which an attribute is displayed and the manner in which the attribute value is entered.
 void setControlField(Control controlField)
          Setter for the default control
 void setCustomValidatorClass(String customValidatorClass)
           
 void setDataType(DataType dataType)
           
 void setDataType(String dataType)
           
 void setExclusiveMin(String exclusiveMin)
          Setter for minimum value
 void setForceUppercase(Boolean forceUppercase)
          Setter for force upper case
 void setFormatterClass(String formatterClass)
          The formatterClass element is used when custom formatting is required for display of the field value.
 void setInclusiveMax(String inclusiveMax)
          Setter for maximum value
 void setLookupContextPath(String lookupContextPath)
           
 void setLookupDefinition(LookupConstraint lookupDefinition)
           
 void setMaxLength(Integer maxLength)
          Setter for maximum length
 void setMinLength(Integer minLength)
          Setter for minumum length
 void setMustOccurConstraints(List<MustOccurConstraint> mustOccurConstraints)
           
 void setOptionsFinder(KeyValuesFinder optionsFinder)
          Setter for the field's KeyValuesFinder instance
 void setOptionsFinderClass(Class<? extends KeyValuesFinder> optionsFinderClass)
          Setter that takes in the class name for the options finder and creates a new instance to use as the finder for the attribute field
 void setPrerequisiteConstraints(List<PrerequisiteConstraint> dependencyConstraints)
           
 void setPropertyEditor(PropertyEditor propertyEditor)
          Setter for the custom property editor to use for the field
 void setPropertyEditorClass(Class<? extends PropertyEditor> propertyEditorClass)
          Convenience setter for configuring a property editor by class
 void setUnique(Boolean unique)
           
 void setValidationPattern(ValidationPattern validationPattern)
           
 void setValidCharactersConstraint(ValidCharactersConstraint validCharactersConstraint)
           
 String toString()
           
 
Methods inherited from class org.kuali.rice.krad.datadictionary.AttributeDefinitionBase
getConstraintText, getDescription, getDirectShortLabel, getDisplayLabelAttribute, getLabel, getName, getShortLabel, getSummary, isRequired, setConstraintText, setDescription, setDisplayLabelAttribute, setLabel, setName, setRequired, setShortLabel, setSummary
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase
getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.validation.capability.Constrainable
getName
 

Field Detail

forceUppercase

protected Boolean forceUppercase

dataType

protected DataType dataType

minLength

protected Integer minLength

maxLength

protected Integer maxLength

unique

protected Boolean unique

exclusiveMin

protected String exclusiveMin

inclusiveMax

protected String inclusiveMax

validationPattern

@Deprecated
protected ValidationPattern validationPattern
Deprecated. 

control

protected ControlDefinition control

controlField

protected Control controlField

formatterClass

protected String formatterClass

propertyEditor

protected PropertyEditor propertyEditor

attributeSecurity

protected AttributeSecurity attributeSecurity

dynamic

protected Boolean dynamic

customValidatorClass

protected String customValidatorClass

validCharactersConstraint

protected ValidCharactersConstraint validCharactersConstraint

caseConstraint

protected CaseConstraint caseConstraint

dependencyConstraints

protected List<PrerequisiteConstraint> dependencyConstraints

mustOccurConstraints

protected List<MustOccurConstraint> mustOccurConstraints

lookupDefinition

protected LookupConstraint lookupDefinition

lookupContextPath

protected String lookupContextPath

childEntryName

protected String childEntryName

alternateDisplayAttributeName

protected String alternateDisplayAttributeName

additionalDisplayAttributeName

protected String additionalDisplayAttributeName
Constructor Detail

AttributeDefinition

public AttributeDefinition()
Method Detail

setForceUppercase

public void setForceUppercase(Boolean forceUppercase)
Setter for force upper case

Parameters:
forceUppercase -

getForceUppercase

public Boolean getForceUppercase()
Indicates whether user entry should be converted to upper case

If set all user input will be changed to uppercase. Values from the database will also be forced to display as upper case and thus be persisted as upper case.

Returns:
boolean true if force upper case is set

getMaxLength

public Integer getMaxLength()
Description copied from interface: LengthConstraint
Determines the maximum size of the field

The maximum size is used for data entry, data edit and display purposes.

Specified by:
getMaxLength in interface LengthConstraint
Returns:
Integer specifying maximum length of field
See Also:
LengthConstraint.getMaxLength()

setMaxLength

public void setMaxLength(Integer maxLength)
Setter for maximum length

Parameters:
maxLength -

getExclusiveMin

public String getExclusiveMin()
Description copied from interface: RangeConstraint
Determines the minimum value of the field

The exclusiveMin element determines the minimum allowable value for data entry editing purposes. Value can be an integer or decimal value such as -.001 or 99.

Specified by:
getExclusiveMin in interface RangeConstraint
Returns:
String specifying the minimum value
See Also:
RangeConstraint.getExclusiveMin()

setExclusiveMin

public void setExclusiveMin(String exclusiveMin)
Setter for minimum value

Parameters:
exclusiveMin - - minimum allowed value

getInclusiveMax

public String getInclusiveMax()
Description copied from interface: RangeConstraint
Determines the maximum value of the field

The inclusiveMax element determines the maximum allowable value for data entry editing purposes. Value can be an integer or decimal value such as -.001 or 99.

Specified by:
getInclusiveMax in interface RangeConstraint
Returns:
String specifying the maximum value
See Also:
RangeConstraint.getInclusiveMax()

setInclusiveMax

public void setInclusiveMax(String inclusiveMax)
Setter for maximum value

Parameters:
inclusiveMax - - max allowed value

hasValidationPattern

public boolean hasValidationPattern()
Indicates whether a validation pattern has been set

Returns:
boolean

getValidationPattern

public ValidationPattern getValidationPattern()
Defines the allowable character-level or field-level values for an attribute

ValidationPattern is a Map which is accessed using a key of "validationPattern". Each entry may contain some of the keys listed below. The keys that may be present for a given attribute are dependent upon the type of validationPattern. maxLength (String) exactLength type allowWhitespace allowUnderscore allowPeriod validChars precision scale allowNegative The allowable keys (in addition to type) for each type are: Type**** ***Keys*** alphanumeric exactLength maxLength allowWhitespace allowUnderscore allowPeriod alpha exactLength maxLength allowWhitespace anyCharacter exactLength maxLength allowWhitespace charset validChars numeric exactLength maxLength fixedPoint allowNegative precision scale floatingPoint allowNegative date n/a emailAddress n/a javaClass n/a month n/a phoneNumber n/a timestamp n/a year n/a zipcode n/a Note: maxLength and exactLength are mutually exclusive. If one is entered, the other may not be entered. Note: See ApplicationResources.properties for exact regex patterns. e.g. validationPatternRegex.date for regex used in date validation.

Returns:
ValidationPattern

setValidationPattern

public void setValidationPattern(ValidationPattern validationPattern)
Parameters:
validationPattern -

getControl

public ControlDefinition getControl()
Returns:
control

setControl

public void setControl(ControlDefinition control)
The control element defines the manner in which an attribute is displayed and the manner in which the attribute value is entered. JSTL: control is a Map representing an HTML control. It is accessed using a key of "control". The table below shows the types of entries associated with each type of control. * Control Type** **Key** **Value** checkbox checkbox boolean String hidden hidden boolean String radio radio boolean String valuesFinder valuesFinder class name dataObjectClass String keyAttribute String labelAttribute String includeKeyInLabel boolean String select select boolean String valuesFinder valuesFinder class name dataObjectClass String keyAttribute String labelAttribute String includeBlankRow boolean String includeKeyInLabel boolean String apcSelect apcSelect boolean String paramNamespace String parameterDetailType String parameterName String text text boolean String size String textarea textarea boolean String rows cols currency currency boolean String size String formattedMaxLength String kualiUser kualiUser boolean String universalIdAttributeName String userIdAttributeName String personNameAttributeName String lookupHidden lookupHidden boolean String lookupReadonly lookupReadonly boolean String

Parameters:
control -
Throws:
IllegalArgumentException - if the given control is null

hasFormatterClass

public boolean hasFormatterClass()

getFormatterClass

public String getFormatterClass()
Specified by:
getFormatterClass in interface Formatable

setFormatterClass

public void setFormatterClass(String formatterClass)
The formatterClass element is used when custom formatting is required for display of the field value. This field specifies the name of the java class to be used for the formatting. About 15 different classes are available including BooleanFormatter, CurrencyFormatter, DateFormatter, etc.


getPropertyEditor

public PropertyEditor getPropertyEditor()
Performs formatting of the field value for display and then converting the value back to its expected type from a string

Note property editors exist and are already registered for the basic Java types and the common Kuali types such as [@link KualiDecimal}. Registration with this property is only needed for custom property editors

Returns:
PropertyEditor property editor instance to use for this field

setPropertyEditor

public void setPropertyEditor(PropertyEditor propertyEditor)
Setter for the custom property editor to use for the field

Parameters:
propertyEditor -

setPropertyEditorClass

public void setPropertyEditorClass(Class<? extends PropertyEditor> propertyEditorClass)
Convenience setter for configuring a property editor by class

Parameters:
propertyEditorClass -

completeValidation

public void completeValidation(Class<?> rootObjectClass,
                               Class<?> otherObjectClass)
Directly validate simple fields, call completeValidation on Definition fields.

Specified by:
completeValidation in interface DataDictionaryDefinition
Parameters:
rootObjectClass - Class of the BusinessObjectEntry which ultimately contains this definition
otherObjectClass - other stuff required to complete validation
See Also:
DataDictionaryEntry.completeValidation()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getAttributeSecurity

public AttributeSecurity getAttributeSecurity()
Returns:
the attributeSecurity

setAttributeSecurity

public void setAttributeSecurity(AttributeSecurity attributeSecurity)
Parameters:
attributeSecurity - the attributeSecurity to set

hasAttributeSecurity

public boolean hasAttributeSecurity()

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
This overridden method ...

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Overrides:
afterPropertiesSet in class DataDictionaryDefinitionBase
Throws:
Exception
See Also:
InitializingBean.afterPropertiesSet()

getUnique

public Boolean getUnique()
Returns:
the unique

setUnique

public void setUnique(Boolean unique)
Parameters:
unique - the unique to set

getControlField

public Control getControlField()
Default Control to use when the attribute is to be rendered for the UI. Used by the UIF when a control is not defined for an InputField

Returns:
Control instance

setControlField

public void setControlField(Control controlField)
Setter for the default control

Parameters:
controlField -

getMinLength

public Integer getMinLength()
Description copied from interface: LengthConstraint
Determines the minimum size of the field

The minimum size is used for data entry, data edit and display purposes.

Specified by:
getMinLength in interface LengthConstraint
Returns:
Integer specifying minimum length of field
See Also:
LengthConstraint.getMinLength()

setMinLength

public void setMinLength(Integer minLength)
Setter for minumum length

Parameters:
minLength -

getDataType

public DataType getDataType()
Description copied from interface: DataTypeConstraint
gets the type of an attribute definition

Specified by:
getDataType in interface DataTypeConstraint
Returns:
the dataType

setDataType

public void setDataType(DataType dataType)
Parameters:
dataType - the dataType to set

setDataType

public void setDataType(String dataType)

getCustomValidatorClass

public String getCustomValidatorClass()
Returns:
the customValidatorClass

setCustomValidatorClass

public void setCustomValidatorClass(String customValidatorClass)
Parameters:
customValidatorClass - the customValidatorClass to set

getValidCharactersConstraint

public ValidCharactersConstraint getValidCharactersConstraint()
Specified by:
getValidCharactersConstraint in interface ValidCharactersConstrainable
Returns:
the validChars

setValidCharactersConstraint

public void setValidCharactersConstraint(ValidCharactersConstraint validCharactersConstraint)
Parameters:
validCharactersConstraint - the validChars to set

getCaseConstraint

public CaseConstraint getCaseConstraint()
Specified by:
getCaseConstraint in interface CaseConstrainable
Returns:
the caseConstraint

setCaseConstraint

public void setCaseConstraint(CaseConstraint caseConstraint)
Parameters:
caseConstraint - the caseConstraint to set

getPrerequisiteConstraints

public List<PrerequisiteConstraint> getPrerequisiteConstraints()
Specified by:
getPrerequisiteConstraints in interface PrerequisiteConstrainable
Returns:
the requireConstraint

setPrerequisiteConstraints

public void setPrerequisiteConstraints(List<PrerequisiteConstraint> dependencyConstraints)
Parameters:
dependencyConstraints - the requireConstraint to set

getMustOccurConstraints

public List<MustOccurConstraint> getMustOccurConstraints()
Specified by:
getMustOccurConstraints in interface MustOccurConstrainable
Returns:
the occursConstraint

setMustOccurConstraints

public void setMustOccurConstraints(List<MustOccurConstraint> mustOccurConstraints)
Parameters:
mustOccurConstraints - the occursConstraint to set

getLookupDefinition

public LookupConstraint getLookupDefinition()
Returns:
the lookupDefinition

setLookupDefinition

public void setLookupDefinition(LookupConstraint lookupDefinition)
Parameters:
lookupDefinition - the lookupDefinition to set

getLookupContextPath

public String getLookupContextPath()
Returns:
the lookupContextPath

setLookupContextPath

public void setLookupContextPath(String lookupContextPath)
Parameters:
lookupContextPath - the lookupContextPath to set

getChildEntryName

public String getChildEntryName()
Specified by:
getChildEntryName in interface HierarchicallyConstrainable
Returns:
the childEntryName

setChildEntryName

public void setChildEntryName(String childEntryName)
Parameters:
childEntryName - the childEntryName to set

getOptionsFinder

public KeyValuesFinder getOptionsFinder()
Instance of KeyValluesFinder that should be invoked to provide a List of values the field can have. Generally used to provide the options for a multi-value control or to validate the submitted field value

Returns:
KeyValuesFinder instance

setOptionsFinder

public void setOptionsFinder(KeyValuesFinder optionsFinder)
Setter for the field's KeyValuesFinder instance

Parameters:
optionsFinder -

setOptionsFinderClass

public void setOptionsFinderClass(Class<? extends KeyValuesFinder> optionsFinderClass)
Setter that takes in the class name for the options finder and creates a new instance to use as the finder for the attribute field

Parameters:
optionsFinderClass -

setAdditionalDisplayAttributeName

public void setAdditionalDisplayAttributeName(String additionalDisplayAttributeName)

getAdditionalDisplayAttributeName

public String getAdditionalDisplayAttributeName()

setAlternateDisplayAttributeName

public void setAlternateDisplayAttributeName(String alternateDisplayAttributeName)

getAlternateDisplayAttributeName

public String getAlternateDisplayAttributeName()


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