Class BindingInfo
- All Implemented Interfaces:
Serializable,Cloneable,Copyable,DictionaryBean,UifDictionaryBean
From the binding configuration the binding path is determined (if not manually set) and used to set the path in the UI or to get the value from the model
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
Fields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToBindByNamePrefix(String bindPrefix) Helper method for adding a path to the binding prefixPrefix that will be used to form the binding path from the component name.Gives the name of the property that the component binds to.For attribute fields that do not belong to the default form object (given by the view), this field specifies the path to the object (on the form) the attribute does belong to.Path to the property on the model the component binds to.Returns the binding path prefix to affix before the binding path or property adjusted binding path.Returns the binding prefix string that can be used to setup the binding onDataBindingcomponents that are children of the component that contains theBindingInfo.If field is part of a collection field, gives path to collectiongetPropertyAdjustedBindingPath(String propertyPath) Returns the binding path that is formed by taking the binding configuration of thisBindingInfoinstance with the given property path as the binding name.booleanIndicates whether the component binds directly to the form (that is its bindingName gives a property available through the form), or whether is binds through a nested form object.booleanIndicates whether the parent object for the property that we are binding to is a Map.booleanIndicates whether we should ignore the defaultBindingObjectPath set for this view (true) or not (false).voidsetBindByNamePrefix(String bindByNamePrefix) Setter for the prefix to use for forming the binding path by namevoidsetBindingName(String bindingName) Setter for the bind property namevoidsetBindingObjectPath(String bindingObjectPath) Setter for the object path on the formvoidsetBindingPath(String bindingPath) Setter for the binding path.voidsetBindToForm(boolean bindToForm) Setter for the bind to form indicatorvoidsetBindToMap(boolean bindToMap) Setter for the bind to map indicatorvoidsetCollectionPath(String collectionPath) Setter for the field's collection path (if part of a collection)voidsetDefaults(View view, String propertyName) Sets up some default binding properties based on the view configuration and the component's property namevoidsetIgnoreDefaultBindingObjectPath(boolean ignoreDefaultBindingObjectPath) Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressionsMethods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
clone, copy, dataDictionaryPostProcessing, 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.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode
-
Constructor Details
-
BindingInfo
public BindingInfo()
-
-
Method Details
-
setDefaults
Sets up some default binding properties based on the view configuration and the component's property nameSets the bindingName (if not set) to the given property name, and if the binding object path has not been set uses the default binding object path setup for the view
- Parameters:
view- the view instance the component belongs topropertyName- name of the property (relative to the parent object) the component binds to
-
getBindingPath
Path to the property on the model the component binds to. Uses standard dot notation for nested properties. If the binding path was manually set it will be returned as it is, otherwise the path will be formed by using the binding object path and the bind prefixe.g. Property name 'foo' on a model would have binding path "foo", while property name 'name' of the nested model property 'account' would have binding path "account.name"
- Returns:
- binding path
-
getBindingPrefixForNested
Returns the binding prefix string that can be used to setup the binding onDataBindingcomponents that are children of the component that contains theBindingInfo. The binding prefix is formed like the binding path but without including the object path- Returns:
- binding prefix for nested components
-
getPropertyAdjustedBindingPath
Returns the binding path that is formed by taking the binding configuration of thisBindingInfoinstance with the given property path as the binding name. This can be used to get the binding path when just a property name is given that is assumed to be on the same parent object of the field with the configured binding infoSpecial check is done for org.kuali.rice.krad.uif.UifConstants#NO_BIND_ADJUST_PREFIX prefix on the property name which indicates the property path is the full path and should not be adjusted. Also, if the property is prefixed with org.kuali.rice.krad.uif.UifConstants#FIELD_PATH_BIND_ADJUST_PREFIX, this indicates we should only append the binding object path
- Parameters:
propertyPath- path for property to return full binding path for- Returns:
- full binding path
-
getBindingPathPrefix
Returns the binding path prefix to affix before the binding path or property adjusted binding path.- Returns:
- the binding path prefix to affix before a binding path.
-
addToBindByNamePrefix
Helper method for adding a path to the binding prefix- Parameters:
bindPrefix- path to add
-
setBindingPath
Setter for the binding path. Can be left blank in which the path will be determined from the binding configuration- Parameters:
bindingPath-
-
isBindToForm
public boolean isBindToForm()Indicates whether the component binds directly to the form (that is its bindingName gives a property available through the form), or whether is binds through a nested form object. If bindToForm is false, it is assumed the component binds to the object given by the form property whose path is configured by bindingObjectPath.- Returns:
- true if component binds directly to form, false if it binds to a nested object
-
setBindToForm
public void setBindToForm(boolean bindToForm) Setter for the bind to form indicator- Parameters:
bindToForm-
-
getBindingName
Gives the name of the property that the component binds to. The name can be nested but not the full path, just from the parent object or in the case of binding directly to the form from the form objectIf blank this will be set from the name field of the component
- Returns:
- name of the bind property
-
setBindingName
Setter for the bind property name- Parameters:
bindingName-
-
getBindByNamePrefix
Prefix that will be used to form the binding path from the component name. Typically used for nested collection properties- Returns:
- binding prefix
-
setBindByNamePrefix
Setter for the prefix to use for forming the binding path by name- Parameters:
bindByNamePrefix-
-
getCollectionPath
If field is part of a collection field, gives path to collectionThis is used for metadata purposes when getting finding the attribute definition from the dictionary and is not used in building the final binding path
- Returns:
- path to collection
-
setCollectionPath
Setter for the field's collection path (if part of a collection)- Parameters:
collectionPath-
-
getBindingObjectPath
For attribute fields that do not belong to the default form object (given by the view), this field specifies the path to the object (on the form) the attribute does belong to.e.g. Say we have an attribute field with property name 'number', that belongs to the object given by the 'account' property on the form. The form object path would therefore be set to 'account'. If the property belonged to the object given by the 'document.header' property of the form, the binding object path would be set to 'document.header'. Note if the binding object path is not set for an attribute field (or any
DataBindingcomponent), the binding object path configured on theViewwill be used (unless bindToForm is set to true, where is assumed the property is directly available from the form).- Returns:
- path to object from form
-
setBindingObjectPath
Setter for the object path on the form- Parameters:
bindingObjectPath-
-
isBindToMap
public boolean isBindToMap()Indicates whether the parent object for the property that we are binding to is a Map. If true the binding path will be adjusted to use the map key syntax- Returns:
- true if the property binds to a map, false if it does not
-
setBindToMap
public void setBindToMap(boolean bindToMap) Setter for the bind to map indicator- Parameters:
bindToMap-
-
isIgnoreDefaultBindingObjectPath
public boolean isIgnoreDefaultBindingObjectPath()Indicates whether we should ignore the defaultBindingObjectPath set for this view (true) or not (false). This is mainly so that some sections of a view can be bound to the default path while others are not.- Returns:
- true if this component should ignore the default binding path of its containing view, false if it should behave normally
-
setIgnoreDefaultBindingObjectPath
public void setIgnoreDefaultBindingObjectPath(boolean ignoreDefaultBindingObjectPath)
-