@Component public class TableValidator extends Object implements org.springframework.validation.Validator
| Constructor and Description |
|---|
TableValidator() |
| Modifier and Type | Method and Description |
|---|---|
String |
checkForNaughtyChars(String itemToCheck)
Validates the user input against known bad characters.
|
String |
checkForNaughtyStrings(String itemToCheck)
Validates the user input against known bad strings.
|
List<String> |
getTableTypes()
Grabs the tableTypeString and returns as a List.
|
boolean |
supports(Class clazz) |
void |
validate(Object obj,
org.springframework.validation.Errors errors)
Validates the user input contained in the Table object.
|
void |
validateCenter(int input,
org.springframework.validation.Errors errors)
Validates the user input for the center field.
|
void |
validateDescription(String input,
org.springframework.validation.Errors errors)
Validates the user input for the description field.
|
void |
validateFileSize(org.springframework.web.multipart.commons.CommonsMultipartFile file,
org.springframework.validation.Errors errors)
Validates the size of the uploaded File.
|
void |
validateFileType(String contentType,
org.springframework.validation.Errors errors)
Validates the content type of the uploaded File.
|
void |
validateInput(String formField,
String input,
org.springframework.validation.Errors errors)
A generic utility method to validate user input against known bad characters and strings.
|
void |
validateLocalVersion(int input,
org.springframework.validation.Errors errors)
Validates the user input for the local version field.
|
void |
validateSubCenter(int input,
org.springframework.validation.Errors errors)
Validates the user input for the sub center field.
|
void |
validateTableType(String input,
org.springframework.validation.Errors errors)
Validates the user input for the tableType field.
|
void |
validateTitle(String input,
org.springframework.validation.Errors errors)
Validates the user input for the title field.
|
public boolean supports(Class clazz)
supports in interface org.springframework.validation.Validatorpublic void validate(Object obj, org.springframework.validation.Errors errors)
validate in interface org.springframework.validation.Validatorobj - The target object to validate.errors - Object in which to store any validation errors.public void validateFileSize(org.springframework.web.multipart.commons.CommonsMultipartFile file,
org.springframework.validation.Errors errors)
file - The uploaded CommonsMultipartFile file.errors - Object in which to store any validation errors.public void validateFileType(String contentType, org.springframework.validation.Errors errors)
contentType - The content type of the uploaded file.errors - Object in which to store any validation errors.public void validateTitle(String input, org.springframework.validation.Errors errors)
input - The table input to validate.errors - Object in which to store any validation errors.public void validateDescription(String input, org.springframework.validation.Errors errors)
input - The table input to validate.errors - Object in which to store any validation errors.public void validateLocalVersion(int input,
org.springframework.validation.Errors errors)
input - The table input to validate.errors - Object in which to store any validation errors.public void validateCenter(int input,
org.springframework.validation.Errors errors)
input - The user input to validate.errors - Object in which to store any validation errors.public void validateSubCenter(int input,
org.springframework.validation.Errors errors)
input - The user input to validate.errors - Object in which to store any validation errors.public void validateTableType(String input, org.springframework.validation.Errors errors)
input - The table input to validate.errors - Object in which to store any validation errors.public void validateInput(String formField, String input, org.springframework.validation.Errors errors)
formField - The form field corresponding to the table input.input - The table input to validate.errors - Object in which to store any validation errors.public String checkForNaughtyStrings(String itemToCheck)
itemToCheck - The user input to validate.public String checkForNaughtyChars(String itemToCheck)
itemToCheck - The user input to validate.Copyright © 1999–2013 UCAR/Unidata. All rights reserved.