All Downloads are FREE. Search and download functionalities are using the official Maven repository.

colesico.framework.dslvalidator.commands.MandatoryChain Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
package colesico.framework.dslvalidator.commands;

import colesico.framework.dslvalidator.ValidationContext;
import colesico.framework.dslvalidator.t9n.ValidatorMessages;

/**
 * If context value is not null executes all sequence commands within the current context.
 * Commands executed until first validation error occurs.
 * 

* If current context value is null throws validation exception. */ public class MandatoryChain extends AbstractSequence { private final ValidatorMessages msg; public MandatoryChain(ValidatorMessages msg) { this.msg = msg; } @Override public void execute(ValidationContext context) { if (context.getValue() != null) { executeChain(context); } else { context.addError(MandatoryChain.class.getSimpleName(), msg.mandatoryValueIsNull()); } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy