|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.turbine.util.pool.RecyclableSupport org.apache.turbine.util.parser.BaseValueParser org.apache.turbine.util.parser.DefaultParameterParser org.apache.jetspeed.util.parser.DefaultJetspeedParameterParser org.apache.jetspeed.util.parser.ValidationParameterParser
A Turbine parameter parser with Validation built in. Validates any bean with methods that begin with validate[AttributeName]. Works with Torque-generated beans. To use this class, override the TurbineResources.properties: services.RunDataService.default.parameter.parser=org.apache.turbine.util.parser.DefaultParameterParser
Field Summary |
Fields inherited from class org.apache.turbine.util.parser.BaseValueParser |
parameters |
Fields inherited from interface org.apache.turbine.util.ValueParser |
URL_CASE_FOLDING, URL_CASE_FOLDING_LOWER, URL_CASE_FOLDING_NONE, URL_CASE_FOLDING_UPPER |
Constructor Summary | |
ValidationParameterParser()
|
|
ValidationParameterParser(java.lang.String characterEncoding)
|
Method Summary | |
protected java.lang.String |
generalValidation(java.lang.Object bean)
Validate a bean's property based on definition in the business object |
protected java.lang.Object[] |
getArguments(java.beans.PropertyDescriptor prop)
|
protected void |
setMyProperty(java.lang.Object bean,
java.beans.PropertyDescriptor prop)
Set the property 'prop' in the bean to the value of the corresponding parameters. |
void |
setProperties(java.lang.Object bean)
Uses bean introspection to set writable properties of bean from the parameters, where a (case-insensitive) name match between the bean property and the parameter is looked for. |
protected boolean |
validateObject(java.beans.PropertyDescriptor prop)
|
protected boolean |
validateProperty(java.lang.Object bean,
java.beans.PropertyDescriptor prop)
Validate a bean's property based on definition in the business object |
Methods inherited from class org.apache.jetspeed.util.parser.DefaultJetspeedParameterParser |
getString, setRequest |
Methods inherited from class org.apache.turbine.util.parser.DefaultParameterParser |
append, dispose, getFileItem, getFileItems, getRequest, getUploadData, setUploadData |
Methods inherited from class org.apache.turbine.util.parser.BaseValueParser |
add, add, add, add, add, append, clear, containsDateSelectorKeys, containsKey, containsTimeSelectorKeys, convert, convertAndTrim, get, getBigDecimal, getBigDecimal, getBigDecimals, getBool, getBool, getBoolean, getBoolean, getByte, getByte, getBytes, getCharacterEncoding, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getInteger, getInteger, getInteger, getIntegers, getInts, getKeys, getLong, getLong, getLongObjects, getLongs, getNumberKey, getObject, getObjects, getString, getStringKey, getStrings, getStrings, keys, recycle, recycle, remove, setCharacterEncoding, setProperty, setString, setStrings, toString |
Methods inherited from class org.apache.turbine.util.pool.RecyclableSupport |
doDispose, isDisposed, Recyclable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.turbine.util.ParameterParser |
append, getFileItem, getFileItems, getRequest, getUploadData, setRequest, setUploadData |
Methods inherited from interface org.apache.turbine.util.ValueParser |
add, add, add, add, add, append, clear, containsDateSelectorKeys, containsKey, convert, get, getBigDecimal, getBigDecimal, getBigDecimals, getBool, getBool, getBoolean, getBoolean, getByte, getByte, getBytes, getCharacterEncoding, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getInteger, getInteger, getInteger, getIntegers, getInts, getKeys, getLong, getLong, getLongObjects, getLongs, getNumberKey, getObject, getObjects, getString, getString, getStringKey, getStrings, getStrings, keys, remove, setCharacterEncoding, setString, setStrings, toString |
Methods inherited from interface org.apache.turbine.util.pool.Recyclable |
dispose, isDisposed, recycle |
Constructor Detail |
public ValidationParameterParser()
public ValidationParameterParser(java.lang.String characterEncoding)
Method Detail |
public void setProperties(java.lang.Object bean) throws java.lang.Exception
setProperties
in interface org.apache.turbine.util.ValueParser
bean
- An Object.
Exception,
- a generic exception.
java.lang.Exception
protected void setMyProperty(java.lang.Object bean, java.beans.PropertyDescriptor prop) throws java.lang.Exception
bean
- An Object.prop
- A PropertyDescriptor.
Exception,
- a generic exception.
java.lang.Exception
protected java.lang.Object[] getArguments(java.beans.PropertyDescriptor prop) throws java.lang.Exception
java.lang.Exception
protected boolean validateProperty(java.lang.Object bean, java.beans.PropertyDescriptor prop) throws java.lang.Exception
bean
- The bean to be validated.prop
- The bean's property descriptor
java.lang.Exception
protected boolean validateObject(java.beans.PropertyDescriptor prop) throws java.lang.Exception
java.lang.Exception
protected java.lang.String generalValidation(java.lang.Object bean) throws java.lang.Exception
bean
- The bean to be validated.
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |