public class UifServletRequestDataBinder extends org.springframework.web.bind.ServletRequestDataBinder
Modifier and Type | Field and Description |
---|---|
protected static org.apache.log4j.Logger |
LOG |
Constructor and Description |
---|
UifServletRequestDataBinder(Object target) |
UifServletRequestDataBinder(Object target,
String name) |
Modifier and Type | Method and Description |
---|---|
protected Set<String> |
assembleAutoLinkingPaths(String path,
Link autoLink)
A helper method which simply assembles a set of property paths for the given
Link annotation which
should
be auto linked. |
void |
bind(javax.servlet.ServletRequest request)
Calls
UifFormBase.preBind(HttpServletRequest) , Performs data binding
from servlet request parameters to the form, initializes view object, then calls
UifFormBase.postBind(javax.servlet.http.HttpServletRequest) |
protected Set<String> |
determineRootAutoLinkingPaths(Class<?> rootObjectType,
String path,
Set<Class<?>> scanned)
Determines the root property paths relative to the given root object type against which to perform automatic
linking.
|
protected void |
executeAutomaticLinking(javax.servlet.ServletRequest request,
UifFormBase form)
Performs automatic reference linking of the given form based on the properties on the form for which linking
is enabled.
|
protected List<org.kuali.rice.krad.web.bind.UifServletRequestDataBinder.AutoLinkTarget> |
extractAutoLinkListTargets(String autoLinkingPath,
List<?> targetList)
For the list object indicated for linking, iterates through the modified paths and finds paths that match
entries in the list, and if found adds an auto link target.
|
protected List<org.kuali.rice.krad.web.bind.UifServletRequestDataBinder.AutoLinkTarget> |
extractAutoLinkMapTargets(String autoLinkingPath,
Map<?,?> targetMap)
For the map object indicated for linking, iterates through the modified paths and finds paths that match
entries in the map, and if found adds an auto link target.
|
protected List<org.kuali.rice.krad.web.bind.UifServletRequestDataBinder.AutoLinkTarget> |
extractAutoLinkTargets(Set<String> autoLinkingPaths)
Uses the binding result on this data binder to determine the targets on the form that automatic linking should
be performed against.
|
DataObjectService |
getDataObjectService() |
protected org.springframework.validation.AbstractPropertyBindingResult |
getInternalBindingResult()
Allows for the setting attributes to use to find the data dictionary data from Kuali
|
protected View |
getViewByType(javax.servlet.ServletRequest request,
UifFormBase form)
Attempts to get a view instance by looking for a view type name in the request or the form and querying
that view type with the request parameters
|
protected View |
getViewFromPreviousModel(UifFormBase form)
Attempts to get a view instance based on the view id stored on the form (which might not be populated
from the request but remaining from session)
|
ViewService |
getViewService() |
void |
initBeanPropertyAccess()
Allows for a custom binding result class.
|
void |
initDirectFieldAccess()
Disallows direct field access for Kuali
|
boolean |
isAutoLinking() |
boolean |
isChangeTracking() |
void |
setAutoLinking(boolean autoLinking) |
void |
setDataObjectService(DataObjectService dataObjectService) |
addBindValues, closeNoCatch
bindMultipart, bindMultipartFiles, checkFieldDefaults, checkFieldMarkers, doBind, getEmptyValue, getFieldDefaultPrefix, getFieldMarkerPrefix, isBindEmptyMultipartFiles, setBindEmptyMultipartFiles, setFieldDefaultPrefix, setFieldMarkerPrefix
addValidators, applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, convertIfNecessary, findCustomEditor, getAllowedFields, getAutoGrowCollectionLimit, getBindingErrorProcessor, getBindingResult, getConversionService, getDisallowedFields, getErrors, getObjectName, getPropertyAccessor, getPropertyEditorRegistry, getRequiredFields, getSimpleTypeConverter, getTarget, getTypeConverter, getValidator, getValidators, isAllowed, isAutoGrowNestedPaths, isIgnoreInvalidFields, isIgnoreUnknownFields, registerCustomEditor, registerCustomEditor, replaceValidators, setAllowedFields, setAutoGrowCollectionLimit, setAutoGrowNestedPaths, setBindingErrorProcessor, setConversionService, setDisallowedFields, setExtractOldValueForEditor, setIgnoreInvalidFields, setIgnoreUnknownFields, setMessageCodesResolver, setRequiredFields, setValidator, validate, validate
protected static final org.apache.log4j.Logger LOG
public UifServletRequestDataBinder(Object target)
public UifServletRequestDataBinder(Object target, String name)
public void initBeanPropertyAccess()
initBeanPropertyAccess
in class org.springframework.validation.DataBinder
DataBinder.initBeanPropertyAccess()
protected org.springframework.validation.AbstractPropertyBindingResult getInternalBindingResult()
getInternalBindingResult
in class org.springframework.validation.DataBinder
DataBinder.getInternalBindingResult()
public void initDirectFieldAccess()
initDirectFieldAccess
in class org.springframework.validation.DataBinder
DataBinder.initDirectFieldAccess()
public void bind(javax.servlet.ServletRequest request)
UifFormBase.preBind(HttpServletRequest)
, Performs data binding
from servlet request parameters to the form, initializes view object, then calls
UifFormBase.postBind(javax.servlet.http.HttpServletRequest)
The view is initialized by first looking for the viewId
parameter in the request. If found, the view is
retrieved based on this id. If the id is not present, then an attempt is made to find a view by type. In order
to retrieve a view based on type, the view request parameter viewTypeName
must be present. If all else
fails and the viewId is populated on the form (could be populated from a previous request), this is used to
retrieve the view.
bind
in class org.springframework.web.bind.ServletRequestDataBinder
request
- - HTTP Servlet Request instanceprotected void executeAutomaticLinking(javax.servlet.ServletRequest request, UifFormBase form)
Linking will only be performed if change tracking and auto linking are enabled on this data binder.
request
- request instanceform
- form instance against which to perform automatic linkingprotected Set<String> determineRootAutoLinkingPaths(Class<?> rootObjectType, String path, Set<Class<?>> scanned)
This will be determined based on the presence of Link
annotations on the given root object type.
This method is invoked recursively as it walks the class structure looking for Link annotations. It uses the
path
and scanned arguments to keep track of how deep into the structure the scanning is and to prevent infinite
recursion.
rootObjectType
- the root object type from which to perform the scan for auto-linking pathspath
- the current property path relative to the original root object type at which the scan began, if null
then we are scanning from the root-most object type. Each recursive call of this method will append
a new property to this pathscanned
- used to track classes that have already been scanned and prevent infinite recursionprotected Set<String> assembleAutoLinkingPaths(String path, Link autoLink)
Link
annotation which
should
be auto linked.path
- the property path from the top-most root class to where the Link annotation was found during the
scanautoLink
- the Link annotation which is being processedLink
annotationprotected List<org.kuali.rice.krad.web.bind.UifServletRequestDataBinder.AutoLinkTarget> extractAutoLinkTargets(Set<String> autoLinkingPaths)
Only those property paths for which auto linking is enabled and which were actually modified during the execution of this data binding will be returned from this method.
autoLinkingPaths
- a set of paths relative to the form class for which auto-linking has been enabledAutoLinkTarget
objects which contain an object to be linked and which properties on
that object were modified during this data binding executionprotected List<org.kuali.rice.krad.web.bind.UifServletRequestDataBinder.AutoLinkTarget> extractAutoLinkMapTargets(String autoLinkingPath, Map<?,?> targetMap)
autoLinkingPath
- path configured for auto linkingtargetMap
- map object for the linking pathprotected List<org.kuali.rice.krad.web.bind.UifServletRequestDataBinder.AutoLinkTarget> extractAutoLinkListTargets(String autoLinkingPath, List<?> targetList)
autoLinkingPath
- path configured for auto linkingtargetList
- list object for the linking pathprotected View getViewByType(javax.servlet.ServletRequest request, UifFormBase form)
request
- request instance to pull parameters fromform
- form instance to pull values fromprotected View getViewFromPreviousModel(UifFormBase form)
form
- form instance to pull view id frompublic boolean isChangeTracking()
public boolean isAutoLinking()
public void setAutoLinking(boolean autoLinking)
public ViewService getViewService()
public DataObjectService getDataObjectService()
public void setDataObjectService(DataObjectService dataObjectService)
Copyright © 2005–2015 The Kuali Foundation. All rights reserved.