Package org.nuiton.validator
Class AbstractNuitonValidatorProvider
- java.lang.Object
-
- org.nuiton.validator.AbstractNuitonValidatorProvider
-
- All Implemented Interfaces:
NuitonValidatorProvider
- Direct Known Subclasses:
XWork2NuitonValidatorProvider
public abstract class AbstractNuitonValidatorProvider extends Object implements NuitonValidatorProvider
Abstract provider of validator.- Since:
- 2.0
- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractNuitonValidatorProvider.ModelEntry<O>
-
Field Summary
Fields Modifier and Type Field Description protected Map<AbstractNuitonValidatorProvider.ModelEntry<?>,NuitonValidatorModel<?>>
models
protected String
name
-
Constructor Summary
Constructors Constructor Description AbstractNuitonValidatorProvider(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <O> NuitonValidatorModel<O>
getModel(Class<O> type, String context, NuitonValidatorScope... scopes)
Obtain a validator model, the model should be cached and not be reinstanciated at each time a validator model is asked.protected Map<AbstractNuitonValidatorProvider.ModelEntry<?>,NuitonValidatorModel<?>>
getModels()
String
getName()
Obtains the name of the provider.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuiton.validator.NuitonValidatorProvider
detectValidators, newModel, newValidator
-
-
-
-
Field Detail
-
models
protected Map<AbstractNuitonValidatorProvider.ModelEntry<?>,NuitonValidatorModel<?>> models
-
name
protected final String name
-
-
Constructor Detail
-
AbstractNuitonValidatorProvider
public AbstractNuitonValidatorProvider(String name)
-
-
Method Detail
-
getModel
public <O> NuitonValidatorModel<O> getModel(Class<O> type, String context, NuitonValidatorScope... scopes)
Description copied from interface:NuitonValidatorProvider
Obtain a validator model, the model should be cached and not be reinstanciated at each time a validator model is asked.- Specified by:
getModel
in interfaceNuitonValidatorProvider
- Type Parameters:
O
- type of the class to validate- Parameters:
type
- type of the class to validatecontext
- context of validation (null
if no context)scopes
- filtered scope (if nothing given, then use all scopes)- Returns:
- the cached model of validation
-
getModels
protected Map<AbstractNuitonValidatorProvider.ModelEntry<?>,NuitonValidatorModel<?>> getModels()
-
getName
public String getName()
Description copied from interface:NuitonValidatorProvider
Obtains the name of the provider.- Specified by:
getName
in interfaceNuitonValidatorProvider
- Returns:
- the name of the provider.
-
-