Class DataObjectAttributeImpl
- All Implemented Interfaces:
Serializable,DataObjectAttribute,DataObjectAttributeInternal,MetadataCommonInternal,MetadataCommon
This implementation supports "chaining" for most attributes. That is, if the value for a property is defined locally,
it will me used. If unset (null) it will, if there is an embeddedAttribute, request it from that
DataObjectAttribute. (This could be a recursive operation if multiple metadata providers are chained.)
If the value is unset and there is no embedded attribute, most methods will return a non-null default value.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Booleanprotected DataTypeprotected Stringprotected DataObjectAttributeprotected Booleanprotected Stringprotected Stringprotected Class<?> protected Longprotected Longprotected Class<?> protected Booleanprotected PropertyEditorprotected Booleanprotected Booleanprotected Class<?> protected Stringprotected KeyValuesFinderFields inherited from class org.kuali.rice.krad.data.metadata.impl.MetadataCommonBase
backingObjectName, description, embeddedCommonMetadata, label, mergeAction, name, readOnly, shortLabel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the derived krad data type.Gets the display attribute name.If this data object attribute is wrapping another (generated by a lower metadata provider), return that.Gets inherited attribute name.Gets inherited parent attribute name.Class<?> Gets class type object is inherited from.Gets the maximum length.Gets the minimum length.Gets original data object.Class<?> Gets the data object typeGets the property editor.Class<?> getType()Determines type of class.BETA: Gets the bean name.Gets the values if a drop-down.booleanDetermines if attribute is case insensitive.booleanDetermines if attribute should be forced to upper case.booleanDetermines whether attribute is inherited.booleanDetermines whether data object is persistent.booleanDetermines if attribute is required.booleanDetermines attribute case insensitivity.voidsetCaseInsensitive(boolean caseInsensitive) Sets value that determines whether attribute is case insensitive.voidsetDataType(DataType dataType) Sets KRAD data type.voidsetDisplayAttributeName(String displayAttributeName) Sets the attribute display name.voidsetEmbeddedAttribute(DataObjectAttribute embeddedAttribute) Sets embedded attribute.voidsetForceUppercase(boolean forceUppercase) Determines if attribute should be forced to upper case.voidsetInheritedFromAttributeName(String inheritedFromAttributeName) Sets data object name to determine if inherited.voidsetInheritedFromParentAttributeName(String inheritedFromParentAttributeName) Sets parent data object name to determine if inherited.voidsetInheritedFromType(Class<?> inheritedFromType) Sets unknown class to determine if inherited.voidsetMaxLength(Long maxLength) Sets max length of attribute.voidsetMinLength(Long minLength) Sets minimum length of attribute.voidsetOwningType(Class<?> owningType) Sets the data object type to which this attribute belongs.voidsetPersisted(boolean persisted) Sets flag whether object is persisted.voidsetPropertyEditor(PropertyEditor propertyEditor) Sets the property editor used when loading data.voidsetRequired(boolean required) Set whether attribute is required.voidsetSensitive(boolean sensitive) Sets whether sensitive.voidSets unknown class in order to determine type.voidsetValidCharactersConstraintBeanName(String validCharactersConstraintBeanName) BETA: Sets valid character constraint bean name.voidsetValidValues(KeyValuesFinder validValues) Sets keyValueFinder used for dropdown.toString()Methods inherited from class org.kuali.rice.krad.data.metadata.impl.MetadataCommonBase
getBackingObjectName, getDescription, getEmbeddedCommonMetadata, getLabel, getLabelFromPropertyName, getMergeAction, getName, getShortLabel, getUniqueKeyForMerging, isReadOnly, mergeLists, setBackingObjectName, setDescription, setEmbeddedCommonMetadata, setLabel, setMergeAction, setName, setReadOnly, setShortLabelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.kuali.rice.krad.data.metadata.MetadataCommon
getBackingObjectName, getDescription, getLabel, getMergeAction, getName, getShortLabel, isReadOnlyMethods inherited from interface org.kuali.rice.krad.data.metadata.impl.MetadataCommonInternal
getEmbeddedCommonMetadata, getUniqueKeyForMerging, setEmbeddedCommonMetadata
-
Field Details
-
embeddedAttribute
-
owningType
-
inheritedFromType
-
inheritedFromAttributeName
-
inheritedFromParentAttributeName
-
displayAttributeName
-
caseInsensitive
-
forceUppercase
-
required
-
persisted
-
sensitive
-
maxLength
-
minLength
-
validCharactersConstraintBeanName
-
propertyEditor
-
validValues
-
dataType
-
type
-
-
Constructor Details
-
DataObjectAttributeImpl
public DataObjectAttributeImpl()
-
-
Method Details
-
getDisplayAttributeName
Gets the display attribute name.To be used on attributes which have an associated business key that is shown to users rather than the "internal" key which is likely a meaningless (to the users) sequence number.
- Specified by:
getDisplayAttributeNamein interfaceDataObjectAttribute- Returns:
- user friendly business key
-
setDisplayAttributeName
Sets the attribute display name.- Parameters:
displayAttributeName- the attribute name.
-
isCaseInsensitive
public boolean isCaseInsensitive()Determines if attribute is case insensitive.Whether this attribute should be treated as case insensitive when performing lookups and searches.
- Specified by:
isCaseInsensitivein interfaceDataObjectAttribute- Returns:
- attribute case insensitive
-
setCaseInsensitive
public void setCaseInsensitive(boolean caseInsensitive) Sets value that determines whether attribute is case insensitive.- Parameters:
caseInsensitive- whether attribute is case insensitive.
-
isForceUppercase
public boolean isForceUppercase()Determines if attribute should be forced to upper case.Whether this attribute should be forced to upper case before being sent to the
PersistenceProvider.- Specified by:
isForceUppercasein interfaceDataObjectAttribute- Returns:
- attribute forced upper case
-
setForceUppercase
public void setForceUppercase(boolean forceUppercase) Determines if attribute should be forced to upper case.- Parameters:
forceUppercase- whether attribute should be forced to upper.
-
getPropertyEditor
Gets the property editor.To be used by the persistence layer when loading and persisting the data. (E.g., strip extra characters from phone numbers to leave only the digits for storage in the database.).
- Specified by:
getPropertyEditorin interfaceDataObjectAttribute- Returns:
- property editor
-
setPropertyEditor
Sets the property editor used when loading data.- Parameters:
propertyEditor- determines formats when loading data.
-
getValidValues
Gets the values if a drop-down.If this field should be rendered using a drop-down list, specify the instance on this property.
- Specified by:
getValidValuesin interfaceDataObjectAttribute- Returns:
- drop-down values
-
setValidValues
Sets keyValueFinder used for dropdown.- Parameters:
validValues- dropdown keyValueFinder.
-
getDataType
Gets the derived krad data type.The derived krad-data data type used by the UIF to help generate the appropriate control and perform default validation.
- Specified by:
getDataTypein interfaceDataObjectAttribute- Returns:
- derived keard data type
-
setDataType
Sets KRAD data type.- Parameters:
dataType- KRAD derived data type.
-
toString
- Overrides:
toStringin classMetadataCommonBase
-
getMaxLength
Gets the maximum length.The maximum length value which will be accepted into this field.
- Specified by:
getMaxLengthin interfaceDataObjectAttribute- Returns:
- maximum length
-
setMaxLength
Sets max length of attribute.- Parameters:
maxLength- attribute max length.
-
getEmbeddedAttribute
If this data object attribute is wrapping another (generated by a lower metadata provider), return that.- Specified by:
getEmbeddedAttributein interfaceDataObjectAttributeInternal- Returns:
- null if this attribute is not wrapping another.
-
setEmbeddedAttribute
Sets embedded attribute.- Specified by:
setEmbeddedAttributein interfaceDataObjectAttributeInternal- Parameters:
embeddedAttribute- embedded attribute.
-
isRequired
public boolean isRequired()Determines if attribute is required.Whether (at the data level) this attribute must have a non-null value.
- Specified by:
isRequiredin interfaceDataObjectAttribute- Returns:
- attribute is required
-
setRequired
public void setRequired(boolean required) Set whether attribute is required.- Parameters:
required- attribute required flag.
-
getValidCharactersConstraintBeanName
BETA: Gets the bean name.The bean name (in the UIF data dictionary), which checks the entered value's characters for correctness.
- Specified by:
getValidCharactersConstraintBeanNamein interfaceDataObjectAttribute- Returns:
- bean name
-
setValidCharactersConstraintBeanName
BETA: Sets valid character constraint bean name.- Parameters:
validCharactersConstraintBeanName- character constraint bean name.
-
getOwningType
Gets the data object typeGets the data object type to which this attribute belongs.
- Specified by:
getOwningTypein interfaceDataObjectAttribute- Returns:
- class type
-
setOwningType
Sets the data object type to which this attribute belongs.- Parameters:
owningType- data object type to which this attribute belongs.
-
isPersisted
public boolean isPersisted()Determines whether data object is persistent.Whether or not this attribute of the data object is saved to persistent storage when saved via the
DataObjectService.- Specified by:
isPersistedin interfaceDataObjectAttribute- Returns:
- whether data object is persistent
-
setPersisted
public void setPersisted(boolean persisted) Sets flag whether object is persisted.- Parameters:
persisted- flag whether object is persisted.
-
getType
Determines type of class. -
setType
Sets unknown class in order to determine type.- Parameters:
javaType- unknown class.
-
getInheritedFromType
Gets class type object is inherited from.If this attribute is inherited from a different data object, that object's type. Otherwise null.
- Specified by:
getInheritedFromTypein interfaceDataObjectAttribute- Returns:
- class type inherited from
-
setInheritedFromType
Sets unknown class to determine if inherited.- Parameters:
inheritedFromType- unknown class.
-
getInheritedFromAttributeName
Gets inherited attribute name.If this attribute is inherited from a different data object, the source attribute name. Otherwise null.
- Specified by:
getInheritedFromAttributeNamein interfaceDataObjectAttribute- Returns:
- inherited attribute name
-
setInheritedFromAttributeName
Sets data object name to determine if inherited.- Parameters:
inheritedFromAttributeName- name of attribute.
-
getInheritedFromParentAttributeName
Gets inherited parent attribute name.If this attribute is inherited from a different data object, the attribute name on the parent object. Otherwise null.
- Specified by:
getInheritedFromParentAttributeNamein interfaceDataObjectAttribute- Returns:
- inherited parent attribute name
-
setInheritedFromParentAttributeName
Sets parent data object name to determine if inherited.- Parameters:
inheritedFromParentAttributeName- name of attribute.
-
isInherited
public boolean isInherited()Determines whether attribute is inherited.Whether this attribute is inherited from a different data object.
- Specified by:
isInheritedin interfaceDataObjectAttribute- Returns:
- whether attribute is inherited
-
getOriginalDataObjectAttribute
Gets original data object.Obtains the "original" data object attribute in a chain of embedded attribute definitions.
- Specified by:
getOriginalDataObjectAttributein interfaceDataObjectAttribute- Returns:
- original data object
-
getMinLength
Gets the minimum length.The minimum length value which will be accepted into this field.
- Specified by:
getMinLengthin interfaceDataObjectAttribute- Returns:
- minimum length
-
setMinLength
Sets minimum length of attribute.- Parameters:
minLength- minimum length value.
-
isSensitive
public boolean isSensitive()Determines attribute case insensitivity.Whether this attribute is protected at the persistence level and should be protected by default when included on user interfaces.
- Specified by:
isSensitivein interfaceDataObjectAttribute- Returns:
- attribute case insensitivity
-
setSensitive
public void setSensitive(boolean sensitive) Sets whether sensitive.- Parameters:
sensitive- whether attribute is sensitive.
-