![JAR search and dependency download from the Maven repository](/logo.png)
no.difi.certvalidator.parser.RuleReferenceRuleParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-certvalidator Show documentation
Show all versions of commons-certvalidator Show documentation
Rule engine for creation of certificate validator.
package no.difi.certvalidator.parser;
import no.difi.certvalidator.api.ValidatorRule;
import no.difi.certvalidator.api.ValidatorRuleParser;
import no.difi.certvalidator.jaxb.RuleReferenceType;
import no.difi.certvalidator.lang.ValidatorParsingException;
import org.kohsuke.MetaInfServices;
import java.util.Map;
/**
* @author erlend
*/
@MetaInfServices
public class RuleReferenceRuleParser implements ValidatorRuleParser {
@Override
public boolean supports(Class cls) {
return RuleReferenceType.class.equals(cls);
}
@Override
public ValidatorRule parse(Object o, Map objectStorage) throws ValidatorParsingException {
RuleReferenceType ruleReferenceType = (RuleReferenceType) o;
if (!objectStorage.containsKey(ruleReferenceType.getValue()))
throw new ValidatorParsingException(
String.format("Rule for '%s' not found.", ruleReferenceType.getValue()));
return (ValidatorRule) objectStorage.get(ruleReferenceType.getValue());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy