|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.uif.component.ConfigurableBase org.kuali.rice.krad.uif.component.BindingInfo
public class BindingInfo
Provides binding configuration for an DataBinding component (attribute or collection)
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
Constructor Summary | |
---|---|
BindingInfo()
|
Method Summary | |
---|---|
void |
addToBindByNamePrefix(String bindPrefix)
Helper method for adding a path to the binding prefix |
String |
getBindByNamePrefix()
Prefix that will be used to form the binding path from the component name. |
String |
getBindingName()
Gives the name of the property that the component binds to. |
String |
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. |
String |
getBindingPath()
Path to the property on the model the component binds to. |
String |
getBindingPrefixForNested()
Returns the binding prefix string that can be used to setup the binding on DataBinding components that are children of the component
that contains the BindingInfo . |
String |
getCollectionPath()
If field is part of a collection field, gives path to collection |
String |
getPropertyAdjustedBindingPath(String propertyPath)
Returns the binding path that is formed by taking the binding configuration of this BindingInfo instance with the given property path as the
binding name. |
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. |
boolean |
isBindToMap()
Indicates whether the parent object for the property that we are binding to is a Map. |
void |
setBindByNamePrefix(String bindByNamePrefix)
Setter for the prefix to use for forming the binding path by name |
void |
setBindingName(String bindingName)
Setter for the bind property name |
void |
setBindingObjectPath(String bindingObjectPath)
Setter for the object path on the form |
void |
setBindingPath(String bindingPath)
Setter for the binding path. |
void |
setBindToForm(boolean bindToForm)
Setter for the bind to form indicator |
void |
setBindToMap(boolean bindToMap)
Setter for the bind to map indicator |
void |
setCollectionPath(String collectionPath)
Setter for the field's collection path (if part of a collection) |
void |
setDefaults(View view,
String propertyName)
Sets up some default binding properties based on the view configuration and the component's property name |
Methods inherited from class org.kuali.rice.krad.uif.component.ConfigurableBase |
---|
getPropertyExpression, getPropertyExpressions, setPropertyExpressions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BindingInfo()
Method Detail |
---|
public void setDefaults(View view, String propertyName)
Sets 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
view
- - the view instance the component belongs topropertyName
- - name of the property (relative to the parent object) the
component binds topublic String getBindingPath()
e.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"
public String getBindingPrefixForNested()
DataBinding
components that are children of the component
that contains the BindingInfo
. The binding prefix is formed
like the binding path but without including the object path
public String getPropertyAdjustedBindingPath(String propertyPath)
BindingInfo
instance 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 info
Special 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#DATA_OBJECT_BIND_ADJUST_PREFIX, this indicates we should only append the binding object path
propertyPath
- - path for property to return full binding path for
public void addToBindByNamePrefix(String bindPrefix)
bindPrefix
- - path to addpublic void setBindingPath(String bindingPath)
bindingPath
- public boolean isBindToForm()
public void setBindToForm(boolean bindToForm)
bindToForm
- public String getBindingName()
If blank this will be set from the name field of the component
public void setBindingName(String bindingName)
bindingName
- public String getBindByNamePrefix()
public void setBindByNamePrefix(String bindByNamePrefix)
bindByNamePrefix
- public String getCollectionPath()
This is used for metadata purposes when getting finding the attribute definition from the dictionary and is not used in building the final binding path
public void setCollectionPath(String collectionPath)
collectionPath
- public String getBindingObjectPath()
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
DataBinding
component), the binding object path configured
on the View
will be used (unless bindToForm is set to true,
where is assumed the property is directly available from the form).
public void setBindingObjectPath(String bindingObjectPath)
bindingObjectPath
- public boolean isBindToMap()
public void setBindToMap(boolean bindToMap)
bindToMap
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |