public class DataObjectAttributeImpl extends MetadataCommonBase implements DataObjectAttributeInternal
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.
Modifier and Type | Field and Description |
---|---|
protected Boolean |
caseInsensitive |
protected DataType |
dataType |
protected String |
displayAttributeName |
protected Set<UifDisplayHint> |
displayHints |
protected DataObjectAttribute |
embeddedAttribute |
protected Boolean |
forceUppercase |
protected String |
inheritedFromAttributeName |
protected String |
inheritedFromParentAttributeName |
protected Class<?> |
inheritedFromType |
protected Long |
maxLength |
protected Long |
minLength |
protected Class<?> |
owningType |
protected Boolean |
persisted |
protected PropertyEditor |
propertyEditor |
protected Boolean |
required |
protected Boolean |
sensitive |
protected Class<?> |
type |
protected String |
validCharactersConstraintBeanName |
protected KeyValuesFinder |
validValues |
backingObjectName, description, embeddedCommonMetadata, label, mergeAction, name, readOnly, shortLabel
Constructor and Description |
---|
DataObjectAttributeImpl() |
Modifier and Type | Method and Description |
---|---|
DataType |
getDataType()
Gets the derived krad data type.
|
String |
getDisplayAttributeName()
Gets the display attribute name.
|
Set<UifDisplayHint> |
getDisplayHints()
BETA: Gets the display hints.
|
DataObjectAttribute |
getEmbeddedAttribute()
If this data object attribute is wrapping another (generated by a lower metadata provider), return that.
|
String |
getInheritedFromAttributeName()
Gets inherited attribute name.
|
String |
getInheritedFromParentAttributeName()
Gets inherited parent attribute name.
|
Class<?> |
getInheritedFromType()
Gets class type object is inherited from.
|
Long |
getMaxLength()
Gets the maximum length.
|
Long |
getMinLength()
Gets the minimum length.
|
DataObjectAttribute |
getOriginalDataObjectAttribute()
Gets original data object.
|
Class<?> |
getOwningType()
Gets the data object type
|
PropertyEditor |
getPropertyEditor()
Gets the property editor.
|
Class<?> |
getType()
Determines type of class.
|
String |
getValidCharactersConstraintBeanName()
BETA: Gets the bean name.
|
KeyValuesFinder |
getValidValues()
Gets the values if a drop-down.
|
boolean |
isCaseInsensitive()
Determines if attribute is case insensitive.
|
boolean |
isForceUppercase()
Determines if attribute should be forced to upper case.
|
boolean |
isInherited()
Determines whether attribute is inherited.
|
boolean |
isPersisted()
Determines whether data object is persistent.
|
boolean |
isRequired()
Determines if attribute is required.
|
boolean |
isSensitive()
Determines attribute case insensitivity.
|
void |
setCaseInsensitive(boolean caseInsensitive)
Sets value that determines whether attribute is case insensitive.
|
void |
setDataType(DataType dataType)
Sets KRAD data type.
|
void |
setDisplayAttributeName(String displayAttributeName)
Sets the attribute display name.
|
void |
setDisplayHints(Set<UifDisplayHint> displayHints)
BETA: Sets UIF display hints.
|
void |
setEmbeddedAttribute(DataObjectAttribute embeddedAttribute)
Sets embedded attribute.
|
void |
setForceUppercase(boolean forceUppercase)
Determines if attribute should be forced to upper case.
|
void |
setInheritedFromAttributeName(String inheritedFromAttributeName)
Sets data object name to determine if inherited.
|
void |
setInheritedFromParentAttributeName(String inheritedFromParentAttributeName)
Sets parent data object name to determine if inherited.
|
void |
setInheritedFromType(Class<?> inheritedFromType)
Sets unknown class to determine if inherited.
|
void |
setMaxLength(Long maxLength)
Sets max length of attribute.
|
void |
setMinLength(Long minLength)
Sets minimum length of attribute.
|
void |
setOwningType(Class<?> owningType)
Sets the data object type to which this attribute belongs.
|
void |
setPersisted(boolean persisted)
Sets flag whether object is persisted.
|
void |
setPropertyEditor(PropertyEditor propertyEditor)
Sets the property editor used when loading data.
|
void |
setRequired(boolean required)
Set whether attribute is required.
|
void |
setSensitive(boolean sensitive)
Sets whether sensitive.
|
void |
setType(Class<?> javaType)
Sets unknown class in order to determine type.
|
void |
setValidCharactersConstraintBeanName(String validCharactersConstraintBeanName)
BETA: Sets valid character constraint bean name.
|
void |
setValidValues(KeyValuesFinder validValues)
Sets keyValueFinder used for dropdown.
|
String |
toString() |
getBackingObjectName, getDescription, getEmbeddedCommonMetadata, getLabel, getLabelFromPropertyName, getMergeAction, getName, getShortLabel, getUniqueKeyForMerging, isReadOnly, mergeLists, setBackingObjectName, setDescription, setEmbeddedCommonMetadata, setLabel, setMergeAction, setName, setReadOnly, setShortLabel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEmbeddedCommonMetadata, getUniqueKeyForMerging, setEmbeddedCommonMetadata
getBackingObjectName, getDescription, getLabel, getMergeAction, getName, getShortLabel, isReadOnly
protected DataObjectAttribute embeddedAttribute
protected Class<?> owningType
protected Class<?> inheritedFromType
protected String inheritedFromAttributeName
protected String inheritedFromParentAttributeName
protected String displayAttributeName
protected Boolean caseInsensitive
protected Boolean forceUppercase
protected String validCharactersConstraintBeanName
protected PropertyEditor propertyEditor
protected KeyValuesFinder validValues
protected Set<UifDisplayHint> displayHints
public DataObjectAttributeImpl()
public String getDisplayAttributeName()
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.
getDisplayAttributeName
in interface DataObjectAttribute
public void setDisplayAttributeName(String displayAttributeName)
displayAttributeName
- the attribute name.public boolean isCaseInsensitive()
Whether this attribute should be treated as case insensitive when performing lookups and searches.
isCaseInsensitive
in interface DataObjectAttribute
public void setCaseInsensitive(boolean caseInsensitive)
caseInsensitive
- whether attribute is case insensitive.public boolean isForceUppercase()
Whether this attribute should be forced to upper case before being sent to the PersistenceProvider
.
isForceUppercase
in interface DataObjectAttribute
public void setForceUppercase(boolean forceUppercase)
forceUppercase
- whether attribute should be forced to upper.public PropertyEditor getPropertyEditor()
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.).
getPropertyEditor
in interface DataObjectAttribute
public void setPropertyEditor(PropertyEditor propertyEditor)
propertyEditor
- determines formats when loading data.public KeyValuesFinder getValidValues()
If this field should be rendered using a drop-down list, specify the instance on this property.
getValidValues
in interface DataObjectAttribute
public void setValidValues(KeyValuesFinder validValues)
validValues
- dropdown keyValueFinder.public DataType getDataType()
The derived krad-data data type used by the UIF to help generate the appropriate control and perform default validation.
getDataType
in interface DataObjectAttribute
public void setDataType(DataType dataType)
dataType
- KRAD derived data type.public String toString()
toString
in class MetadataCommonBase
public Long getMaxLength()
The maximum length value which will be accepted into this field.
getMaxLength
in interface DataObjectAttribute
public void setMaxLength(Long maxLength)
maxLength
- attribute max length.public DataObjectAttribute getEmbeddedAttribute()
getEmbeddedAttribute
in interface DataObjectAttributeInternal
public void setEmbeddedAttribute(DataObjectAttribute embeddedAttribute)
setEmbeddedAttribute
in interface DataObjectAttributeInternal
embeddedAttribute
- embedded attribute.public boolean isRequired()
Whether (at the data level) this attribute must have a non-null value.
isRequired
in interface DataObjectAttribute
public void setRequired(boolean required)
required
- attribute required flag.@Beta public String getValidCharactersConstraintBeanName()
The bean name (in the UIF data dictionary), which checks the entered value's characters for correctness.
getValidCharactersConstraintBeanName
in interface DataObjectAttribute
@Beta public void setValidCharactersConstraintBeanName(String validCharactersConstraintBeanName)
validCharactersConstraintBeanName
- character constraint bean name.public Class<?> getOwningType()
Gets the data object type to which this attribute belongs.
getOwningType
in interface DataObjectAttribute
public void setOwningType(Class<?> owningType)
owningType
- data object type to which this attribute belongs.public boolean isPersisted()
Whether or not this attribute of the data object is saved to persistent storage when saved via the
DataObjectService
.
isPersisted
in interface DataObjectAttribute
public void setPersisted(boolean persisted)
persisted
- flag whether object is persisted.public void setType(Class<?> javaType)
javaType
- unknown class.public Class<?> getInheritedFromType()
If this attribute is inherited from a different data object, that object's type. Otherwise null.
getInheritedFromType
in interface DataObjectAttribute
public void setInheritedFromType(Class<?> inheritedFromType)
inheritedFromType
- unknown class.public String getInheritedFromAttributeName()
If this attribute is inherited from a different data object, the source attribute name. Otherwise null.
getInheritedFromAttributeName
in interface DataObjectAttribute
public void setInheritedFromAttributeName(String inheritedFromAttributeName)
inheritedFromAttributeName
- name of attribute.public String getInheritedFromParentAttributeName()
If this attribute is inherited from a different data object, the attribute name on the parent object. Otherwise null.
getInheritedFromParentAttributeName
in interface DataObjectAttribute
public void setInheritedFromParentAttributeName(String inheritedFromParentAttributeName)
inheritedFromParentAttributeName
- name of attribute.public boolean isInherited()
Whether this attribute is inherited from a different data object.
isInherited
in interface DataObjectAttribute
public DataObjectAttribute getOriginalDataObjectAttribute()
Obtains the "original" data object attribute in a chain of embedded attribute definitions.
getOriginalDataObjectAttribute
in interface DataObjectAttribute
public Long getMinLength()
The minimum length value which will be accepted into this field.
getMinLength
in interface DataObjectAttribute
public void setMinLength(Long minLength)
minLength
- minimum length value.public boolean isSensitive()
Whether this attribute is protected at the persistence level and should be protected by default when included on user interfaces.
isSensitive
in interface DataObjectAttribute
public void setSensitive(boolean sensitive)
sensitive
- whether attribute is sensitive.@Beta public Set<UifDisplayHint> getDisplayHints()
Returns a set of display hints which can be used by the UIF layer when displaying these fields.
getDisplayHints
in interface DataObjectAttribute
@Beta public void setDisplayHints(Set<UifDisplayHint> displayHints)
displayHints
- UIF display hints.Copyright © 2005–2015 The Kuali Foundation. All rights reserved.