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

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  Boolean unique
           
protected  ValidationPattern validationPattern
          Deprecated. 
protected  ValidCharactersConstraint validCharactersConstraint
           
 
Fields inherited from class org.kuali.rice.krad.datadictionary.AttributeDefinitionBase
constraint, 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()
           
 String getConstraint()
           
 ControlDefinition getControl()
           
 Control getControlField()
          Default Control to use when the attribute is to be rendered for the UI.
 String getCustomValidatorClass()
           
 DataType getDataType()
           
 String getExclusiveMin()
           
 Boolean getForceUppercase()
           
 String getFormatterClass()
           
 String getInclusiveMax()
          The inclusiveMax element determines the maximum allowable value for data entry editing purposes.
 String getLookupContextPath()
           
 LookupConstraint getLookupDefinition()
           
 Integer getMaxLength()
           
 Integer getMinLength()
           
 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()
           
 Boolean getUnique()
           
 ValidationPattern getValidationPattern()
           
 ValidCharactersConstraint getValidCharactersConstraint()
           
 boolean hasAttributeSecurity()
           
 boolean hasFormatterClass()
           
 boolean hasValidationPattern()
           
 void setAdditionalDisplayAttributeName(String additionalDisplayAttributeName)
           
 void setAlternateDisplayAttributeName(String alternateDisplayAttributeName)
           
 void setAttributeSecurity(AttributeSecurity attributeSecurity)
           
 void setCaseConstraint(CaseConstraint caseConstraint)
           
 void setChildEntryName(String childEntryName)
           
 void setConstraint(String constraint)
           
 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)
          The exclusiveMin element determines the minimum allowable value for data entry editing purposes.
 void setForceUppercase(Boolean forceUppercase)
          forceUppercase = convert user entry to uppercase and always display database value as uppercase.
 void setFormatterClass(String formatterClass)
          The formatterClass element is used when custom formatting is required for display of the field value.
 void setInclusiveMax(String inclusiveMax)
          The inclusiveMax element determines the maximum allowable value for data entry editing purposes.
 void setLookupContextPath(String lookupContextPath)
           
 void setLookupDefinition(LookupConstraint lookupDefinition)
           
 void setMaxLength(Integer maxLength)
          The maxLength element determines the maximum size of the field for data entry edit purposes and for display purposes.
 void setMinLength(Integer minLength)
           
 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 setUnique(Boolean unique)
           
 void setValidationPattern(ValidationPattern validationPattern)
          The validationPattern element defines the allowable character-level or field-level values for an attribute.
 void setValidCharactersConstraint(ValidCharactersConstraint validCharactersConstraint)
           
 String toString()
           
 
Methods inherited from class org.kuali.rice.krad.datadictionary.AttributeDefinitionBase
getDescription, getDirectShortLabel, getDisplayLabelAttribute, getLabel, getName, getShortLabel, getSummary, isRequired, 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

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)
forceUppercase = convert user entry to uppercase and always display database value as uppercase.


getForceUppercase

public Boolean getForceUppercase()

getMaxLength

public Integer getMaxLength()
Specified by:
getMaxLength in interface LengthConstraint

setMaxLength

public void setMaxLength(Integer maxLength)
The maxLength element determines the maximum size of the field for data entry edit purposes and for display purposes.


getExclusiveMin

public String getExclusiveMin()
Specified by:
getExclusiveMin in interface RangeConstraint

setExclusiveMin

public void setExclusiveMin(String exclusiveMin)
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.


getInclusiveMax

public String getInclusiveMax()
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. JSTL: This field is mapped into the field named "exclusiveMax".

Specified by:
getInclusiveMax in interface RangeConstraint

setInclusiveMax

public void setInclusiveMax(String inclusiveMax)
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. JSTL: This field is mapped into the field named "exclusiveMax".


hasValidationPattern

public boolean hasValidationPattern()
Returns:
true if a validationPattern has been set

getValidationPattern

public ValidationPattern getValidationPattern()

setValidationPattern

public void setValidationPattern(ValidationPattern validationPattern)
The validationPattern element defines the allowable character-level or field-level values for an attribute. JSTL: 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.


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.


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 AttributeField

Returns:
Control instance

setControlField

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

Parameters:
controlField -

getMinLength

public Integer getMinLength()
Specified by:
getMinLength in interface LengthConstraint
Returns:
the minLength

setMinLength

public void setMinLength(Integer minLength)
Parameters:
minLength - the minLength to set

getDataType

public DataType getDataType()
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

getConstraint

public String getConstraint()
Returns:
the constraintMessage

setConstraint

public void setConstraint(String constraint)
Parameters:
constraintMessage - the constraintMessage 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 © 2004-2011 The Kuali Foundation. All Rights Reserved.