public class ControlService extends Object
Modifier and Type | Field and Description |
---|---|
protected CoserBusinessConfig |
config |
protected com.opensymphony.xwork2.ActionContext |
context |
protected static Pattern |
FISH_LENGTH_PATTERN
Pattern des tailles de poisson (ex : 1.5, 1.50, 2.00).
|
protected com.opensymphony.xwork2.validator.DelegatingValidatorContext |
validationContext |
protected com.opensymphony.xwork2.ValidationAwareSupport |
validationSupport |
protected com.opensymphony.xwork2.validator.ActionValidatorManager |
validator |
Constructor and Description |
---|
ControlService(CoserBusinessConfig config)
Initialise le context xworks.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getSignificantData(Project project,
CoserConstants.Category category,
String[] data)
Retourne sous forme de clé la partie significative des données.
|
protected boolean |
isValidFishLength(String length)
Return
true if given length is valid length (cm or half cm). |
protected List<ControlError> |
validate(AbstractDataEntity bean,
CoserConstants.Category category)
Valide un seul bean, retourne la liste des erreurs trouvées.
|
protected List<ControlError> |
validateCategorySpecific(Project project,
Control control,
CoserConstants.Category category,
ProgressMonitor progress)
Effectue un calcul global, mais specific a chaque categorie.
|
protected List<ControlError> |
validateCategorySpecificCatch(Project project,
Control control,
ProgressMonitor progress)
Alerte si Somme(CAPTURES$Nombre par CAPTURES$Annee|Strate|Espece) < nobsmin.
|
protected List<ControlError> |
validateCategorySpecificHaul(Project project,
Control control,
ProgressMonitor progress)
Specific validation for Haul category.
|
protected List<ControlError> |
validateCategorySpecificLength(Project project,
Control control,
ProgressMonitor progress)
Alerte si Somme(TAILLES$Nombre par TAILLES$Annee|Strate|Espece) < nobsmin
Warning sur les tailles aberrantes par espèce:
premiere passe pour calculer l'écart type et la moyenne par espèce
seconde passe pour détecter les valeurs abérentes (> ecart type)
L'ecart étant : racine( somme (x - moyenne)^2 / n)
|
protected List<ControlError> |
validateCategorySpecificStrata(Project project,
Control control,
ProgressMonitor progress)
Specific validation for Strata category.
|
List<ControlError> |
validateCategoryXWork(Project project,
Control control,
CoserConstants.Category category,
ProgressMonitor progress)
Valide une category entière d'un project.
|
List<ControlError> |
validateData(Project project,
Control control,
ProgressMonitor progress)
Valide toutes les données du projet.
|
protected List<? extends ControlError> |
validateDiffCatchLength(Project project,
Control control,
ProgressMonitor progress)
Detecte des différences entre les nombres dans captures
et les nombres dans taille.
|
protected List<ControlError> |
validationCrossFiles(Project project,
Control control,
ProgressMonitor progress)
Validation par croisement de fichiers.
|
protected CoserBusinessConfig config
protected com.opensymphony.xwork2.ValidationAwareSupport validationSupport
protected com.opensymphony.xwork2.validator.DelegatingValidatorContext validationContext
protected com.opensymphony.xwork2.validator.ActionValidatorManager validator
protected com.opensymphony.xwork2.ActionContext context
protected static final Pattern FISH_LENGTH_PATTERN
public ControlService(CoserBusinessConfig config)
config
- configurationprotected List<ControlError> validate(AbstractDataEntity bean, CoserConstants.Category category)
bean
- bean to validatecategory
- result errors categorypublic List<ControlError> validateData(Project project, Control control, ProgressMonitor progress)
project
- projectcontrol
- control a validerprogress
- progress monitor (can be null)public List<ControlError> validateCategoryXWork(Project project, Control control, CoserConstants.Category category, ProgressMonitor progress)
project
- projectcontrol
- control a validercategory
- category a validerprogress
- progress monitor (can be null)protected String getSignificantData(Project project, CoserConstants.Category category, String[] data)
project
- projectcategory
- categorydata
- dataprotected List<ControlError> validateCategorySpecific(Project project, Control control, CoserConstants.Category category, ProgressMonitor progress)
project
- projectcontrol
- controlcategory
- categoryprogress
- progress monitornull
)protected List<ControlError> validateCategorySpecificCatch(Project project, Control control, ProgressMonitor progress)
project
- projectcontrol
- controlprogress
- progress monitor (can be null)protected List<? extends ControlError> validateDiffCatchLength(Project project, Control control, ProgressMonitor progress)
project
- projectcontrol
- data containerprogress
- progress (can be null)for details
,
for option
protected List<ControlError> validateCategorySpecificLength(Project project, Control control, ProgressMonitor progress)
project
- projectcontrol
- controlprogress
- progress (can be null)protected List<ControlError> validateCategorySpecificHaul(Project project, Control control, ProgressMonitor progress)
project
- control
- controlprogress
- progressnull
protected List<ControlError> validateCategorySpecificStrata(Project project, Control control, ProgressMonitor progress)
project
- projectcontrol
- controlprogress
- progressnull
protected List<ControlError> validationCrossFiles(Project project, Control control, ProgressMonitor progress)
control
- controlprogress
- progressprotected boolean isValidFishLength(String length)
true
if given length is valid length (cm or half cm).length
- lengthto testtrue
if given length is valid length (cm or half cm)Copyright © 2010–2015 Ifremer. All rights reserved.