package com.brilliance.isc.common.validator.es.rule.impl;

import com.brilliance.isc.common.validator.es.rule.IPatternRule;
import com.brilliance.isc.common.validator.es.utils.EsConstant;
import org.springframework.stereotype.Component;

/**
 * 正则校验规则
 * @author fukai
 */
@Component(EsConstant.VALIDATOR_TYPE_PATTERN +"."+EsConstant.VALIDATOR_SUFFIX_NAME)
public class PatternRuleImpl extends AbstractRuleValidator implements IPatternRule {
    /**
     * 获取当前校验器的js实现函数
     *
     * @return
     */
    @Override
    public String getValidateFunction() {
        return String.format("execute%sRule",toUpperFirst(EsConstant.VALIDATOR_TYPE_PATTERN));
    }
}
