|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.action.ActionForm org.kuali.rice.kns.web.struts.pojo.PojoFormBase
public class PojoFormBase
This class is the base form which implements the PojoForm interface. Kuali Foundation modification: javadoc comments changed
Field Summary | |
---|---|
protected Set<String> |
requiredNonEditableProperties
|
Fields inherited from class org.apache.struts.action.ActionForm |
---|
multipartRequestHandler, servlet |
Constructor Summary | |
---|---|
PojoFormBase()
|
Method Summary | |
---|---|
protected void |
addMaxUploadSize(String sizeString)
Adds the given string as a maximum size to the form. |
void |
addRequiredNonEditableProperties()
This method adds the required property names, that are not directly editable by user on the html page, to a list, regardless of the context in which they appear. |
protected void |
cacheUnconvertedValue(String key,
Object value)
|
void |
clearEditablePropertyInformation()
Reinitializes the form to allow it to register the editable properties of the currently processing request. |
void |
copyPopulateEditablePropertiesToActionEditableProperties()
Copies all editable properties in the populate editable properties to the action editable properties |
protected void |
customInitMaxUploadSizes()
Subclasses can override this to add their own max upload size to the list. |
protected Class |
formatterClassForKeypath(String keypath)
Retrieves any formatters associated specially with the keypath. |
Object |
formatValue(Object value,
String keypath,
Class type)
Tries to format the provided value by passing it to a suitable Formatter . |
String |
getActionEditablePropertiesGuid()
|
Set<String> |
getEditableProperties()
|
protected Formatter |
getFormatter(String keypath,
Class propertyType)
Retrieves a formatter for the keypath and property type. |
Map |
getFormatterTypes()
Gets the formatterTypes attribute. |
boolean |
getIsNewForm()
|
List<String> |
getMaxUploadSizes()
|
Set<String> |
getMethodToCallsToBypassSessionRetrievalForGETRequests()
Base implementation that returns just "start". |
protected String |
getParameter(javax.servlet.http.HttpServletRequest request,
String parameterName)
|
protected String[] |
getParameterValues(javax.servlet.http.HttpServletRequest request,
String parameterName)
|
Set<String> |
getPopulateEditableProperties()
|
String |
getPopulateEditablePropertiesGuid()
|
protected Class |
getPropertyType(String keypath)
Delegates to PropertyUtils.getPropertyType(Object, String) to look up the property type for the provided keypath. |
Set<String> |
getRequiredNonEditableProperties()
|
String |
getStrutsActionMappingScope()
|
Map |
getUnconvertedValues()
|
protected List |
getUnknownKeys()
|
protected void |
initMaxUploadSizes()
Initializes the list of max upload sizes if necessary. |
boolean |
isPropertyEditable(String propertyName)
|
boolean |
isPropertyNonEditableButRequired(String propertyName)
|
void |
populate(javax.servlet.http.HttpServletRequest request)
Populates the form with values from the current request. |
protected void |
populateForProperty(String paramPath,
Object paramValue,
Map params)
Populates a given parameter value into the given property path |
void |
postprocessRequestParameters(Map requestParameters)
Method is called after parameters from a multipart request have been made accessible to request.getParameter calls, but before request parameter values are used to instantiate and populate business objects. |
void |
processValidationFail()
|
void |
registerEditableProperty(String editablePropertyName)
|
void |
registerIsNewForm(boolean isNewForm)
|
void |
registerRequiredNonEditableProperty(String requiredNonEditableProperty)
|
void |
registerStrutsActionMappingScope(String strutsActionMappingScope)
Sets the value of the "scope" attribute for the Struts action mapping corresponding to this form instance. |
void |
setActionEditablePropertiesGuid(String guid)
Sets the guid of the editable properties which were registered by the action |
void |
setFormatterType(String keypath,
Class type)
Sets the Formatter class to use for a given keypath. |
void |
setFormatterTypes(Map formatterTypes)
Sets the formatterTypes attribute value. |
void |
setPopulateEditablePropertiesGuid(String guid)
Sets the guid to editable properties consulted during population |
void |
setUnconvertedValues(Map unconvertedValues)
|
boolean |
shouldPropertyBePopulatedInForm(String requestParameterName,
javax.servlet.http.HttpServletRequest request)
Returns whether a request parameter should be populated as a property of the form, assuming that the request parameter name corresponds to a property on the form. |
Methods inherited from class org.apache.struts.action.ActionForm |
---|
getMultipartRequestHandler, getServlet, getServletWrapper, reset, reset, setMultipartRequestHandler, setServlet, validate, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Set<String> requiredNonEditableProperties
Constructor Detail |
---|
public PojoFormBase()
Method Detail |
---|
public void postprocessRequestParameters(Map requestParameters)
postprocessRequestParameters
in interface PojoForm
requestParameters
- public void populate(javax.servlet.http.HttpServletRequest request)
populate
in interface PojoForm
protected void populateForProperty(String paramPath, Object paramValue, Map params)
paramPath
- the path to a property within the formparamValue
- the value of that propertyparams
- the Map of parameters from the requestprotected Class getPropertyType(String keypath) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
PropertyUtils.getPropertyType(Object, String)
to look up the property type for the provided keypath.
Caches the resulting class so that subsequent lookups for the same keypath can be satisfied by looking in the cache.
NoSuchMethodException
InvocationTargetException
IllegalAccessException
protected Formatter getFormatter(String keypath, Class propertyType)
keypath
- propertyType
-
protected Class formatterClassForKeypath(String keypath)
keypath
-
public Object formatValue(Object value, String keypath, Class type)
Formatter
. Adds an ActionMessage to the ActionErrors
in the request if a FormatException is thrown.
Caution should be used when invoking this method. It should never be called prior to populate(HttpServletRequest)
because the cached request reference could be stale.
formatValue
in interface PojoForm
public void setFormatterType(String keypath, Class type)
Formatter.getFormatter(Class)
, which is the default mechanism.
public Map getUnconvertedValues()
getUnconvertedValues
in interface PojoForm
public void setUnconvertedValues(Map unconvertedValues)
protected List getUnknownKeys()
protected void cacheUnconvertedValue(String key, Object value)
public void processValidationFail()
processValidationFail
in interface PojoForm
public Map getFormatterTypes()
public void setFormatterTypes(Map formatterTypes)
formatterTypes
- The formatterTypes to set.protected final void addMaxUploadSize(String sizeString)
sizeString
- protected final void initMaxUploadSizes()
protected void customInitMaxUploadSizes()
public final List<String> getMaxUploadSizes()
public void registerEditableProperty(String editablePropertyName)
registerEditableProperty
in interface PojoForm
public void registerRequiredNonEditableProperty(String requiredNonEditableProperty)
public void clearEditablePropertyInformation()
PojoForm
clearEditablePropertyInformation
in interface PojoForm
public Set<String> getEditableProperties()
getEditableProperties
in interface PojoForm
public boolean isPropertyEditable(String propertyName)
public void addRequiredNonEditableProperties()
PojoForm
addRequiredNonEditableProperties
in interface PojoForm
PojoForm.addRequiredNonEditableProperties()
public boolean isPropertyNonEditableButRequired(String propertyName)
protected String getParameter(javax.servlet.http.HttpServletRequest request, String parameterName)
protected String[] getParameterValues(javax.servlet.http.HttpServletRequest request, String parameterName)
public Set<String> getRequiredNonEditableProperties()
getRequiredNonEditableProperties
in interface PojoForm
public void registerStrutsActionMappingScope(String strutsActionMappingScope)
PojoForm
registerStrutsActionMappingScope
in interface PojoForm
PojoForm.registerStrutsActionMappingScope(String)
public String getStrutsActionMappingScope()
public void registerIsNewForm(boolean isNewForm)
registerIsNewForm
in interface PojoForm
PojoForm.registerStrutsActionMappingScope(String)
public boolean getIsNewForm()
getIsNewForm
in interface PojoForm
public boolean shouldPropertyBePopulatedInForm(String requestParameterName, javax.servlet.http.HttpServletRequest request)
PojoForm
shouldPropertyBePopulatedInForm
in interface PojoForm
requestParameterName
- the name of the request parameterrequest
- the HTTP request
PojoForm.shouldPropertyBePopulatedInForm(java.lang.String, javax.servlet.http.HttpServletRequest)
public Set<String> getMethodToCallsToBypassSessionRetrievalForGETRequests()
getMethodToCallsToBypassSessionRetrievalForGETRequests
in interface PojoForm
PojoForm.getMethodToCallsToBypassSessionRetrievalForGETRequests()
public void setPopulateEditablePropertiesGuid(String guid)
setPopulateEditablePropertiesGuid
in interface PojoForm
guid
- the key to the editable properties for this formorg.kuali.rice.kns.web.struts.pojo.PojoForm#setEditablePropertiesGuid(java.lang.String)
public String getPopulateEditablePropertiesGuid()
public void setActionEditablePropertiesGuid(String guid)
setActionEditablePropertiesGuid
in interface PojoForm
guid
- the guid of the action editable propertiesPojoForm.setActionEditablePropertiesGuid(java.lang.String)
public String getActionEditablePropertiesGuid()
public Set<String> getPopulateEditableProperties()
public void copyPopulateEditablePropertiesToActionEditableProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |