Class AttributeDefinition

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DataDictionaryDefinition, DictionaryBean, CaseConstrainable, Constrainable, ExistenceConstrainable, Formatable, HierarchicallyConstrainable, MustOccurConstrainable, PrerequisiteConstrainable, SimpleConstrainable, ValidCharactersConstrainable, Constraint, ExistenceConstraint
Direct Known Subclasses:
ExternalizableAttributeDefinitionProxy

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:
  • Field Details

  • Constructor Details

    • AttributeDefinition

      public AttributeDefinition()
  • Method Details

    • 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:
    • setMaxLength

      public void setMaxLength(Integer maxLength)
      Setter for maximum length
      Parameters:
      maxLength -
    • getExclusiveMin

      public String getExclusiveMin()
      See Also:
    • setExclusiveMin

      public void setExclusiveMin(String exclusiveMin)
      Setter for minimum value
      Parameters:
      exclusiveMin - - minimum allowed value
    • getInclusiveMax

      public String getInclusiveMax()
      See Also:
    • 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()
      Description copied from interface: DictionaryBean
      Perform any needed post-processing of the bean properties. This will be called starting at the parent data object entry or document entry class and recursed down though all other DictionaryBean objects contained within.
      Specified by:
      dataDictionaryPostProcessing in interface DictionaryBean
      Overrides:
      dataDictionaryPostProcessing in class DictionaryBeanBase
    • 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:
    • 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:
    • 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:
    • setMinLength

      public void setMinLength(Integer minLength)
      Setter for minumum length
      Parameters:
      minLength -
    • getDataType

      public org.kuali.rice.core.api.data.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(org.kuali.rice.core.api.data.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 org.kuali.rice.krad.keyvalues.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(org.kuali.rice.krad.keyvalues.KeyValuesFinder optionsFinder)
      Setter for the field's KeyValuesFinder instance
      Parameters:
      optionsFinder -
    • setOptionsFinderClass

      public void setOptionsFinderClass(Class<? extends org.kuali.rice.krad.keyvalues.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