org.kuali.rice.krad.datadictionary
Class AttributeDefinition

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DictionaryBeanBase
      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, Cloneable, Copyable, DataDictionaryDefinition, DictionaryBean, CaseConstrainable, Constrainable, ExistenceConstrainable, Formatable, HierarchicallyConstrainable, MustOccurConstrainable, PrerequisiteConstrainable, SimpleConstrainable, ValidCharactersConstrainable, Constraint, ExistenceConstraint
Direct Known Subclasses:
ExternalizableAttributeDefinitionProxy, KimAttributeDefinition

public class AttributeDefinition
extends AttributeDefinitionBase
implements CaseConstrainable, PrerequisiteConstrainable, Formatable, HierarchicallyConstrainable, MustOccurConstrainable, 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  Control cachedDerivedControl
           
protected  CaseConstraint caseConstraint
           
protected  String childEntryName
           
protected  ControlDefinition control
          Deprecated. 
protected  Control controlField
           
protected  String customValidatorClass
           
protected  List<PrerequisiteConstraint> dependencyConstraints
           
protected  Boolean dynamic
           
protected  Boolean forceUppercase
           
protected  String formatterClass
          Deprecated. 
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, dataObjectAttribute, description, displayLabelAttribute, label, name, shortLabel, simpleConstraint, summary
 
Fields inherited from class org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase
embeddedDataObjectMetadata, generatedFromMetadata, id
 
Fields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCode
 
Constructor Summary
AttributeDefinition()
           
 
Method Summary
 void completeValidation(Class<?> rootObjectClass, Class<?> otherObjectClass)
          Deprecated. 
 void completeValidation(Class rootObjectClass, Class otherObjectClass, ValidationTrace tracer)
          Directly validate simple fields, call completeValidation on Definition fields.
 void dataDictionaryPostProcessing()
          This overridden method ...
 String getAdditionalDisplayAttributeName()
           
 String getAlternateDisplayAttributeName()
           
 AttributeSecurity getAttributeSecurity()
           
 CaseConstraint getCaseConstraint()
           
 String getChildEntryName()
           
 ControlDefinition getControl()
          Deprecated. 
 Control getControlField()
          Default Control to use when the attribute is to be rendered for the UI.
 String getCustomValidatorClass()
           
 DataType getDataType()
          Returns the Kuali datatype for this field.
 List<PrerequisiteConstraint> getDependencyConstraints()
          Gets dependency constraints for this AttributeDefinition.
 String getExclusiveMin()
           
 Boolean getForceUppercase()
          Indicates whether user entry should be converted to upper case
 String getFormatterClass()
          Deprecated. 
 String getInclusiveMax()
           
 Integer getMaxLength()
          Returns the maximum length for this field, if set.
 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()
           
 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()
          Deprecated. 
 ValidCharactersConstraint getValidCharactersConstraint()
           
 boolean hasAttributeSecurity()
           
 boolean hasFormatterClass()
          Deprecated. 
 boolean hasValidationPattern()
          Deprecated. 
 void setAdditionalDisplayAttributeName(String additionalDisplayAttributeName)
           
 void setAlternateDisplayAttributeName(String alternateDisplayAttributeName)
           
 void setAttributeSecurity(AttributeSecurity attributeSecurity)
           
 void setCaseConstraint(CaseConstraint caseConstraint)
           
 void setChildEntryName(String childEntryName)
           
 void setControl(ControlDefinition control)
          Deprecated. 
 void setControlField(Control controlField)
          Setter for the default control
 void setCustomValidatorClass(String customValidatorClass)
           
 void setDataType(DataType dataType)
           
 void setDataType(String dataType)
           
 void setDependencyConstraints(List<PrerequisiteConstraint> dependencyConstraints)
          Sets dependency constraints for this AttributeDefinition.
 void setExclusiveMin(String exclusiveMin)
          Setter for minimum value
 void setForceUppercase(Boolean forceUppercase)
          Setter for force upper case
 void setFormatterClass(String formatterClass)
          Deprecated. 
 void setInclusiveMax(String inclusiveMax)
          Setter for maximum value
 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)
          Deprecated. 
 void setValidCharactersConstraint(ValidCharactersConstraint validCharactersConstraint)
           
 
Methods inherited from class org.kuali.rice.krad.datadictionary.AttributeDefinitionBase
deriveConstraintText, getConstraintText, getDataObjectAttribute, getDescription, getDirectShortLabel, getDisplayLabelAttribute, getLabel, getName, getShortLabel, getSimpleConstraint, getSummary, isRequired, setConstraintText, setDataObjectAttribute, setDescription, setDisplayLabelAttribute, setLabel, setName, setRequired, setShortLabel, setSimpleConstraint, setSummary
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase
getId, hasEmbeddedDataObjectMetadata, setEmbeddedDataObjectMetadata, setGeneratedFromMetadata, setId, wasGeneratedFromMetadata
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
clone, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.validation.capability.Constrainable
getName
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
getComponentCode, getNamespaceCode
 

Field Detail

forceUppercase

protected Boolean forceUppercase

unique

protected Boolean unique

validationPattern

@Deprecated
protected ValidationPattern validationPattern
Deprecated. 

control

@Deprecated
protected ControlDefinition control
Deprecated. 

controlField

protected Control controlField

cachedDerivedControl

protected Control cachedDerivedControl

formatterClass

@Deprecated
protected String formatterClass
Deprecated. 

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

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.

If not set and embedded metadata is present, the ForceUppercase value will be read from the linked metadata.

Returns:
boolean true if force upper case is set

getMaxLength

public Integer getMaxLength()
Returns the maximum length for this field, if set. If not set, it attempts to pull from the embedded metadata, if any. z

See Also:
LengthConstraint.getMaxLength()

setMaxLength

public void setMaxLength(Integer maxLength)
Setter for maximum length

Parameters:
maxLength -

getExclusiveMin

public String getExclusiveMin()
See Also:
RangeConstraint.getExclusiveMin()

setExclusiveMin

public void setExclusiveMin(String exclusiveMin)
Setter for minimum value

Parameters:
exclusiveMin - - minimum allowed value

getInclusiveMax

public String getInclusiveMax()
See Also:
RangeConstraint.getInclusiveMax()

setInclusiveMax

public void setInclusiveMax(String inclusiveMax)
Setter for maximum value

Parameters:
inclusiveMax - - max allowed value

setValidationPattern

@Deprecated
public void setValidationPattern(ValidationPattern validationPattern)
Deprecated. 

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.


hasValidationPattern

@Deprecated
public boolean hasValidationPattern()
Deprecated. 

Indicates whether a validation pattern has been set

Returns:
boolean

getValidationPattern

@Deprecated
public ValidationPattern getValidationPattern()
Deprecated. 

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

getControl

@Deprecated
public ControlDefinition getControl()
Deprecated. 

Returns:
control

setControl

@Deprecated
public void setControl(ControlDefinition control)
Deprecated. 

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

@Deprecated
public boolean hasFormatterClass()
Deprecated. 


getFormatterClass

@Deprecated
public String getFormatterClass()
Deprecated. 

Specified by:
getFormatterClass in interface Formatable

setFormatterClass

@Deprecated
public void setFormatterClass(String formatterClass)
Deprecated. 

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. If not set in the AttributeDefinition, it attempts to pull from the embedded metadata, if any.

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 -

dataDictionaryPostProcessing

public void dataDictionaryPostProcessing()
This overridden method ...

Specified by:
dataDictionaryPostProcessing in interface DictionaryBean
Overrides:
dataDictionaryPostProcessing in class DictionaryBeanBase
See Also:
DictionaryBeanBase.dataDictionaryPostProcessing()

completeValidation

@Deprecated
public void completeValidation(Class<?> rootObjectClass,
                                          Class<?> otherObjectClass)
Deprecated. 

Directly validate simple fields, call completeValidation on Definition fields.

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

completeValidation

public void completeValidation(Class rootObjectClass,
                               Class otherObjectClass,
                               ValidationTrace tracer)
Directly validate simple fields, call completeValidation on Definition fields.

Specified by:
completeValidation in interface DataDictionaryDefinition
Overrides:
completeValidation in class DataDictionaryDefinitionBase
Parameters:
rootObjectClass - Class of the BusinessObjectEntry which ultimately contains this definition
otherObjectClass - other stuff required to complete validation
tracer - ValidationTrace class used to track what was being validated at the time of any problems discovered
See Also:
DataDictionaryEntry.completeValidation(org.kuali.rice.krad.datadictionary.validator.ValidationTrace)

getAttributeSecurity

public AttributeSecurity getAttributeSecurity()

setAttributeSecurity

public void setAttributeSecurity(AttributeSecurity attributeSecurity)

hasAttributeSecurity

public boolean hasAttributeSecurity()

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 If not set in the AttributeDefinition, a default will be generated from the metadata for this field.

Returns:
Control instance

setControlField

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

Parameters:
controlField -

getMinLength

public Integer getMinLength()
See Also:
LengthConstraint.getMinLength()

setMinLength

public void setMinLength(Integer minLength)
Setter for minumum length

Parameters:
minLength -

getDataType

public DataType getDataType()
Returns the Kuali datatype for this field. See DataType for the defined types. If not defined in the AttributeDefinition, it will be retrieved from the embedded metadata, if defined. If not defined by either, will return DataType.STRING.


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

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()

getDependencyConstraints

public List<PrerequisiteConstraint> getDependencyConstraints()
Gets dependency constraints for this AttributeDefinition. Same as getPrerequisiteConstraints.

Returns:
dependency constraints

setDependencyConstraints

public void setDependencyConstraints(List<PrerequisiteConstraint> dependencyConstraints)
Sets dependency constraints for this AttributeDefinition. Same as setPrerequisiteConstraints.

Parameters:
dependencyConstraints - dependency constraints


Copyright © 2005–2015 The Kuali Foundation. All rights reserved.