org.apache.commons.validator.Field.getProperty()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(10.8k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中org.apache.commons.validator.Field.getProperty()方法的一些代码示例,展示了Field.getProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.getProperty()方法的具体详情如下:
包路径:org.apache.commons.validator.Field
类名称:Field
方法名:getProperty

Field.getProperty介绍

[英]Gets the property name of the field.
[中]获取字段的属性名称。

代码示例

代码示例来源:origin: commons-validator/commons-validator

/**
 * Called when a validator name is used in a depends clause but there is
 * no know ValidatorAction configured for that name.
 * @param name The name of the validator in the depends list.
 * @throws ValidatorException
 */
private void handleMissingAction(String name) throws ValidatorException {
  throw new ValidatorException("No ValidatorAction named " + name
      + " found for field " + this.getProperty());
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if field is positive assuming it is an integer
* 
* @param    bean       The value validation is being performed on.
* @param    field       Description of the field to be evaluated
* @return   boolean     If the integer field is greater than zero, returns
*                        true, otherwise returns false.
*/
public static boolean validatePositive(Object bean , Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatInt(value).intValue() > 0;                                                      
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field is required.
*
* @return boolean If the field isn't <code>null</code> and
* has a length greater than zero, <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static boolean validateRequired(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return !GenericValidator.isBlankOrNull(value);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field is an e-mail address.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return    boolean        If the field is an e-mail address
*                           <code>true</code> is returned.  
*                           Otherwise <code>false</code>.
*/
public static boolean validateEmail(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericValidator.isEmail(value);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>byte</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>byte</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Byte validateByte(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatByte(value);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>short</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>short</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Short validateShort(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatShort(value);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>float</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>float</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Float validateFloat(Object bean, Field field, Locale locale) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatFloat(value, locale);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>double</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>double</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Double validateDouble(Object bean, Field field, Locale locale) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatDouble(value, locale);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>long</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return    boolean        If the field can be successfully converted 
*                           to a <code>long</code> <code>true</code> is returned.  
*                           Otherwise <code>false</code>.
*/
public static boolean validateLong(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericValidator.isLong(value);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>double</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return    boolean        If the field can be successfully converted 
*                           to a <code>double</code> <code>true</code> is returned.  
*                           Otherwise <code>false</code>.
*/
public static boolean validateDouble(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericValidator.isDouble(value);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>short</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>short</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Short validateShort(Object bean, Field field, Locale locale) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatShort(value, locale);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>float</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>float</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Float validateFloat(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatFloat(value);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>int</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return    boolean        If the field can be successfully converted 
*                           to a <code>int</code> <code>true</code> is returned.  
*                           Otherwise <code>false</code>.
*/
public static boolean validateInt(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericValidator.isInt(value);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>float</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return    boolean        If the field can be successfully converted 
*                           to a <code>float</code> <code>true</code> is returned.  
*                           Otherwise <code>false</code>.
*/
public static boolean validateFloat(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericValidator.isFloat(value);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>int</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>int</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Integer validateInt(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatInt(value);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>int</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>int</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Integer validateInt(Object bean, Field field, Locale locale) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatInt(value, locale);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>long</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>long</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Long validateLong(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatLong(value);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>long</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>long</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Long validateLong(Object bean, Field field, Locale locale) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatLong(value, locale);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>date</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>date</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Date validateDate(Object bean, Field field, Locale locale) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatDate(value, locale);
}

代码示例来源:origin: commons-validator/commons-validator

/**
* Checks if the field can be successfully converted to a <code>double</code>.
*
* @param bean The value validation is being performed on.
* @param field the field to use
* @return boolean If the field can be successfully converted 
* to a <code>double</code> <code>true</code> is returned.  
* Otherwise <code>false</code>.
*/
public static Double validateDouble(Object bean, Field field) {
 String value = ValidatorUtils.getValueAsString(bean, field.getProperty());
 return GenericTypeValidator.formatDouble(value);
}

相关文章