public class ConfluenceActionValidatorManager extends Object
This class makes use of a delegating validationContext. This is to prevent race conditions. It delegates to a threadlocal to ensure that any validation messages are set on the appropriate context and any information is retrieved from the correct context. As the context contains rather large (in Mb) objects, it is absolutely essential that it is set to null when the method returns.
Contains code that is Copyright (c) 2002-2003 by OpenSymphony, used under the Apache license, original author credits included below:
Modifier and Type | Field and Description |
---|---|
protected static String |
VALIDATION_CONFIG_SUFFIX
The file suffix for any validation file.
|
Constructor and Description |
---|
ConfluenceActionValidatorManager() |
Modifier and Type | Method and Description |
---|---|
protected static String |
buildValidatorKey(Class clazz,
String context)
Builds a key for validators - used when caching validators.
|
static List |
getValidators(Class clazz,
String context)
Returns a list of validators for the given class and context.
|
static void |
validate(Object object,
String context)
Validates the given object using action and its context.
|
static void |
validate(Object object,
String context,
com.opensymphony.xwork.validator.ValidatorContext validatorContext)
Validates an action give its context and a validation context.
|
protected static final String VALIDATION_CONFIG_SUFFIX
public static List getValidators(Class clazz, String context)
clazz
- the class to lookup.context
- the context of the action class - can be null.public static void validate(Object object, String context) throws com.opensymphony.xwork.validator.ValidationException
object
- the action to validate.context
- the action's context.com.opensymphony.xwork.validator.ValidationException
- if an error happens when validating the action.public static void validate(Object object, String context, com.opensymphony.xwork.validator.ValidatorContext validatorContext) throws com.opensymphony.xwork.validator.ValidationException
object
- the action to validate.context
- the action's context.validatorContext
- com.opensymphony.xwork.validator.ValidationException
- if an error happens when validating the action.Copyright © 2003–2020 Atlassian. All rights reserved.