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
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected AttributeSecurityprotected Controlprotected CaseConstraintprotected Stringprotected ControlDefinitionDeprecated.protected Controlprotected Stringprotected List<PrerequisiteConstraint> protected Booleanprotected Booleanprotected StringDeprecated.protected List<MustOccurConstraint> protected PropertyEditorprotected Booleanprotected ValidationPatternDeprecated.protected ValidCharactersConstraintFields inherited from class org.kuali.rice.krad.datadictionary.AttributeDefinitionBase
constraintText, dataObjectAttribute, description, displayLabelAttribute, label, name, shortLabel, simpleConstraint, summaryFields inherited from class org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase
embeddedDataObjectMetadata, generatedFromMetadata, idFields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompleteValidation(Class<?> rootObjectClass, Class<?> otherObjectClass) Deprecated.voidcompleteValidation(Class rootObjectClass, Class otherObjectClass, ValidationTrace tracer) Directly validate simple fields, call completeValidation on Definition fields.voidPerform any needed post-processing of the bean properties.Deprecated.DefaultControlto use when the attribute is to be rendered for the UI.Returns the Kuali datatype for this field.Gets dependency constraints for this AttributeDefinition.Indicates whether user entry should be converted to upper caseDeprecated.Returns the maximum length for this field, if set.Instance ofKeyValluesFinderthat should be invoked to provide a List of values the field can have.Performs formatting of the field value for display and then converting the value back to its expected type from a string.Deprecated.booleanbooleanDeprecated.booleanDeprecated.voidsetAdditionalDisplayAttributeName(String additionalDisplayAttributeName) voidsetAlternateDisplayAttributeName(String alternateDisplayAttributeName) voidsetAttributeSecurity(AttributeSecurity attributeSecurity) voidsetCaseConstraint(CaseConstraint caseConstraint) voidsetChildEntryName(String childEntryName) voidsetControl(ControlDefinition control) Deprecated.voidsetControlField(Control controlField) Setter for the default controlvoidsetCustomValidatorClass(String customValidatorClass) voidsetDataType(String dataType) voidsetDataType(DataType dataType) voidsetDependencyConstraints(List<PrerequisiteConstraint> dependencyConstraints) Sets dependency constraints for this AttributeDefinition.voidsetExclusiveMin(String exclusiveMin) Setter for minimum valuevoidsetForceUppercase(Boolean forceUppercase) Setter for force upper casevoidsetFormatterClass(String formatterClass) Deprecated.voidsetInclusiveMax(String inclusiveMax) Setter for maximum valuevoidsetMaxLength(Integer maxLength) Setter for maximum lengthvoidsetMinLength(Integer minLength) Setter for minumum lengthvoidsetMustOccurConstraints(List<MustOccurConstraint> mustOccurConstraints) voidsetOptionsFinder(KeyValuesFinder optionsFinder) Setter for the field's KeyValuesFinder instancevoidsetOptionsFinderClass(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 fieldvoidsetPrerequisiteConstraints(List<PrerequisiteConstraint> dependencyConstraints) voidsetPropertyEditor(PropertyEditor propertyEditor) Setter for the custom property editor to use for the fieldvoidsetPropertyEditorClass(Class<? extends PropertyEditor> propertyEditorClass) Convenience setter for configuring a property editor by classvoidvoidsetValidationPattern(ValidationPattern validationPattern) Deprecated.voidsetValidCharactersConstraint(ValidCharactersConstraint validCharactersConstraint) Methods inherited from class org.kuali.rice.krad.datadictionary.AttributeDefinitionBase
getConstraintText, getDataObjectAttribute, getDescription, getDirectShortLabel, getDisplayLabelAttribute, getLabel, getName, getShortLabel, getSimpleConstraint, getSummary, isRequired, setConstraintText, setDataObjectAttribute, setDescription, setDisplayLabelAttribute, setLabel, setName, setRequired, setShortLabel, setSimpleConstraint, setSummaryMethods inherited from class org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase
getId, hasEmbeddedDataObjectMetadata, setEmbeddedDataObjectMetadata, setGeneratedFromMetadata, setId, wasGeneratedFromMetadataMethods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
clone, copy, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCodeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kuali.rice.krad.datadictionary.validation.capability.Constrainable
getNameMethods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
getComponentCode, getNamespaceCode
-
Field Details
-
forceUppercase
-
unique
-
validationPattern
Deprecated. -
control
Deprecated. -
controlField
-
cachedDerivedControl
-
formatterClass
Deprecated. -
propertyEditor
-
attributeSecurity
-
dynamic
-
customValidatorClass
-
validCharactersConstraint
-
caseConstraint
-
dependencyConstraints
-
mustOccurConstraints
-
childEntryName
-
alternateDisplayAttributeName
-
additionalDisplayAttributeName
-
-
Constructor Details
-
AttributeDefinition
public AttributeDefinition()
-
-
Method Details
-
setForceUppercase
Setter for force upper case- Parameters:
forceUppercase-
-
getForceUppercase
Indicates whether user entry should be converted to upper caseIf 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
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
Setter for maximum length- Parameters:
maxLength-
-
getExclusiveMin
- See Also:
-
setExclusiveMin
Setter for minimum value- Parameters:
exclusiveMin- - minimum allowed value
-
getInclusiveMax
- See Also:
-
setInclusiveMax
Setter for maximum value- Parameters:
inclusiveMax- - max allowed value
-
setValidationPattern
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.Indicates whether a validation pattern has been set- Returns:
- boolean
-
getValidationPattern
Deprecated.Defines the allowable character-level or field-level values for an attributeValidationPattern 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.- Returns:
- control
-
setControl
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. -
getFormatterClass
Deprecated.- Specified by:
getFormatterClassin interfaceFormatable
-
setFormatterClass
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
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
Setter for the custom property editor to use for the field- Parameters:
propertyEditor-
-
setPropertyEditorClass
Convenience setter for configuring a property editor by class- Parameters:
propertyEditorClass-
-
dataDictionaryPostProcessing
public void dataDictionaryPostProcessing()Description copied from interface:DictionaryBeanPerform 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:
dataDictionaryPostProcessingin interfaceDictionaryBean- Overrides:
dataDictionaryPostProcessingin classDictionaryBeanBase
-
completeValidation
Deprecated.Directly validate simple fields, call completeValidation on Definition fields.- Specified by:
completeValidationin interfaceDataDictionaryDefinition- Overrides:
completeValidationin classDataDictionaryDefinitionBase- Parameters:
rootObjectClass- Class of the BusinessObjectEntry which ultimately contains this definitionotherObjectClass- 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:
completeValidationin interfaceDataDictionaryDefinition- Overrides:
completeValidationin classDataDictionaryDefinitionBase- Parameters:
rootObjectClass- Class of the BusinessObjectEntry which ultimately contains this definitionotherObjectClass- other stuff required to complete validationtracer-ValidationTraceclass used to track what was being validated at the time of any problems discovered- See Also:
-
getAttributeSecurity
-
setAttributeSecurity
-
hasAttributeSecurity
public boolean hasAttributeSecurity() -
getUnique
- Returns:
- the unique
-
setUnique
- Parameters:
unique- the unique to set
-
getControlField
DefaultControlto use when the attribute is to be rendered for the UI. Used by the UIF when a control is not defined for anInputFieldIf not set in the AttributeDefinition, a default will be generated from the metadata for this field.- Returns:
- Control instance
-
setControlField
Setter for the default control- Parameters:
controlField-
-
getMinLength
- See Also:
-
setMinLength
Setter for minumum length- Parameters:
minLength-
-
getDataType
Returns the Kuali datatype for this field. SeeDataTypefor 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 returnDataType.STRING. -
setDataType
- Parameters:
dataType- the dataType to set
-
setDataType
-
getCustomValidatorClass
- Returns:
- the customValidatorClass
-
setCustomValidatorClass
- Parameters:
customValidatorClass- the customValidatorClass to set
-
getValidCharactersConstraint
- Specified by:
getValidCharactersConstraintin interfaceValidCharactersConstrainable- Returns:
- the validChars
-
setValidCharactersConstraint
- Parameters:
validCharactersConstraint- the validChars to set
-
getCaseConstraint
- Specified by:
getCaseConstraintin interfaceCaseConstrainable- Returns:
- the caseConstraint
-
setCaseConstraint
- Parameters:
caseConstraint- the caseConstraint to set
-
getPrerequisiteConstraints
- Specified by:
getPrerequisiteConstraintsin interfacePrerequisiteConstrainable- Returns:
- the requireConstraint
-
setPrerequisiteConstraints
- Parameters:
dependencyConstraints- the requireConstraint to set
-
getMustOccurConstraints
- Specified by:
getMustOccurConstraintsin interfaceMustOccurConstrainable- Returns:
- the occursConstraint
-
setMustOccurConstraints
- Parameters:
mustOccurConstraints- the occursConstraint to set
-
getChildEntryName
- Specified by:
getChildEntryNamein interfaceHierarchicallyConstrainable- Returns:
- the childEntryName
-
setChildEntryName
- Parameters:
childEntryName- the childEntryName to set
-
getOptionsFinder
Instance ofKeyValluesFinderthat 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
Setter for the field's KeyValuesFinder instance- Parameters:
optionsFinder-
-
setOptionsFinderClass
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
-
getAdditionalDisplayAttributeName
-
setAlternateDisplayAttributeName
-
getAlternateDisplayAttributeName
-
getDependencyConstraints
Gets dependency constraints for this AttributeDefinition. Same as getPrerequisiteConstraints.- Returns:
- dependency constraints
-
setDependencyConstraints
Sets dependency constraints for this AttributeDefinition. Same as setPrerequisiteConstraints.- Parameters:
dependencyConstraints- dependency constraints
-