<p>
Validation rules that are attached to the attribute definition.
</p>

@param rules
Validation rules that are attached to the attribute definition.
@return Returns a reference to this object so that method calls can be chained together.
762903
public TypedLinkAttributeDefinition withRules(java.util.Map<String, Rule> rules) {
        setRules(rules);
        return this;
    }
72973
public void setRules(java.util.Collection<Rule> rules) {
        if (rules == null) {
            this.rules = null;
            return;
        }

        this.rules = new java.util.ArrayList<Rule>(rules);
    }
1232162
public JSONObject batchRules(List<JSONObject> rules) throws AlgoliaException {
    return batchRules(rules, false, false);
  }
524481
public final AntlrDatatypeRuleToken ruleValidID() throws RecognitionException {
        AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();

        Token this_ID_0=null;
        Token kw=null;


        	enterRule();

        try {
            // InternalSARL.g:9830:2: ( (this_ID_0= RULE_ID | kw= 'create' | kw= 'annotation' | kw= 'AFTER' | kw= 'BEFORE' | kw= 'SEPARATOR' ) )
            // InternalSARL.g:9831:2: (this_ID_0= RULE_ID | kw= 'create' | kw= 'annotation' | kw= 'AFTER' | kw= 'BEFORE' | kw= 'SEPARATOR' )
            {
            // InternalSARL.g:9831:2: (this_ID_0= RULE_ID | kw= 'create' | kw= 'annotation' | kw= 'AFTER' | kw= 'BEFORE' | kw= 'SEPARATOR' )
            int alt255=6;
            switch ( input.LA(1) ) {
            case RULE_ID:
                {
                alt255=1;
                }
                break;
            case 92:
                {
                alt255=2;
                }
                break;
            case 44:
                {
                alt255=3;
                }
                break;
            case 93:
                {
                alt255=4;
                }
                break;
            case 94:
                {
                alt255=5;
                }
                break;
            case 95:
                {
                alt255=6;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return current;}
                NoViableAltException nvae =
                    new NoViableAltException("", 255, 0, input);

                throw nvae;
            }

            switch (alt255) {
                case 1 :
                    // InternalSARL.g:9832:3: this_ID_0= RULE_ID
                    {
                    this_ID_0=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(this_ID_0);
                      		
                    }
                    if ( state.backtracking==0 ) {

                      			newLeafNode(this_ID_0, grammarAccess.getValidIDAccess().getIDTerminalRuleCall_0());
                      		
                    }

                    }
                    break;
                case 2 :
                    // InternalSARL.g:9840:3: kw= 'create'
                    {
                    kw=(Token)match(input,92,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getValidIDAccess().getCreateKeyword_1());
                      		
                    }

                    }
                    break;
                case 3 :
                    // InternalSARL.g:9846:3: kw= 'annotation'
                    {
                    kw=(Token)match(input,44,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getValidIDAccess().getAnnotationKeyword_2());
                      		
                    }

                    }
                    break;
                case 4 :
                    // InternalSARL.g:9852:3: kw= 'AFTER'
                    {
                    kw=(Token)match(input,93,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getValidIDAccess().getAFTERKeyword_3());
                      		
                    }

                    }
                    break;
                case 5 :
                    // InternalSARL.g:9858:3: kw= 'BEFORE'
                    {
                    kw=(Token)match(input,94,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getValidIDAccess().getBEFOREKeyword_4());
                      		
                    }

                    }
                    break;
                case 6 :
                    // InternalSARL.g:9864:3: kw= 'SEPARATOR'
                    {
                    kw=(Token)match(input,95,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getValidIDAccess().getSEPARATORKeyword_5());
                      		
                    }

                    }
                    break;

            }


            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
1322805
public BaseValidationCheck getValidationChecker(ValidationRule rule) {
        ValidationRule existRule = this.rules.stream().filter(r -> r.getRuleName().equals(rule.getRuleName())).findFirst().orElse(null);
        if (existRule == null) {
            throw new ValidationLibException("rulename : " + rule.getRuleName() + "checker is notfound  ", HttpStatus.INTERNAL_SERVER_ERROR);
        }
        return existRule.getValidationCheck();
    }
494355
public static PointSymbolizer pointSymbolizerFromRule( Rule rule ) {
        List<Symbolizer> symbolizers = rule.symbolizers();
        PointSymbolizer pointSymbolizer = null;
        for( Symbolizer symbolizer : symbolizers ) {
            if (symbolizer instanceof PointSymbolizer) {
                pointSymbolizer = (PointSymbolizer) symbolizer;
                break;
            }
        }
        if (pointSymbolizer == null) {
            throw new IllegalArgumentException();
        }
        return pointSymbolizer;
    }
1172400
public Map<String, Map<String, Map<String, Map<String, ?>>>> validationConstraints(String type) {
		return getEntity(invokeGet(Utils.formatMessage("_constraints/{0}", type), null), Map.class);
	}
1116032
public Map<String, Map<String, Map<String, Map<String, ?>>>> getValidationConstraints() {
		if (validationConstraints == null) {
			validationConstraints = new LinkedHashMap<>();
		}
		return validationConstraints;
	}
538175
protected Validator createValidator()
        throws JspException {
        
        FacesContext context = FacesContext.getCurrentInstance();
        Validator validator = null;
        ValueExpression vb = null;
        
        // If "binding" is set, use it to create a validator instance.
        if (binding != null) {
            try {
                vb = context.getApplication().getExpressionFactory().createValueExpression(context.getELContext(), 
                        binding, Object.class);
                if (vb != null) {
                    validator = (Validator)vb.getValue(context.getELContext());
                    if (validator != null) {
                        return validator;
                    }
                }
            } catch (Exception e) {
                throw new JspException(e);
            }
        } 
        // If "validatorId" is set, use it to create the validator
        // instance.  If "validatorId" and "binding" are both set, store the 
        // validator instance in the value of the property represented by
        // the value binding expression.      
        if (validatorId != null) {
            try {
                String validatorIdVal = validatorId;
                if (UIComponentTag.isValueReference(validatorId)) {
                    ValueExpression idBinding = context.getApplication().
                        getExpressionFactory().createValueExpression(context.getELContext(), 
                            validatorId, Object.class);
                    validatorIdVal = (String)idBinding.getValue(context.getELContext());
                }
                validator = context.getApplication().createValidator(validatorIdVal);
                if (validator != null) { 
                    if (vb != null) {
                        vb.setValue(context.getELContext(), validator);
                    }
                }
            } catch (Exception e) {
                throw new JspException(e);
            }
        }
        return validator;
    }
1313066
public <RO> MultipleRuleContext<DPO, TDPO, RO> check(Collection<Rule<TDPO, RO>> rules) {
        List<Rule<TDPO, RO>> addedRules = new ArrayList<Rule<TDPO, RO>>();
        if (rules != null) {
            addedRules.addAll(rules);
        }

        // Change context
        return new MultipleRuleContext<DPO, TDPO, RO>(addedTriggers, addedDataProviders, dataProviderToRuleMapping,
                addedRuleInputTransformers, addedRules);
    }
964359
@Override
    protected List<TestRule> classRules() {
        List<JUnitClassRulesFilter> junitClassRulesFilters =
            new JavaSPILoader().all(Arquillian.class.getClassLoader(), JUnitClassRulesFilter.class);
        List<TestRule> result = super.classRules();

        if (!junitClassRulesFilters.isEmpty()) {
            for (final JUnitClassRulesFilter junitClassRulesFilter : junitClassRulesFilters) {
                result = junitClassRulesFilter.filter(result);
            }
        }
        return result;
    }
67008
public void setRules(java.lang.String rules) {
        getStateHelper().put(PropertyKeys.rules, rules);
        handleAttribute("rules", rules);
    }
449563
FieldConstraints extractValidationRules() {
    Annotation[] annotations = field.getAnnotations();
    FieldConstraints fieldConstraints = new FieldConstraints();

    for (Annotation annotation : annotations) {
      if (Iterables.contains(relevantAnnotationClasses, annotation.annotationType())) {
        ConstraintAttributes constraintAttributes = new ConstraintAttributes(annotation);
        BuiltInConstraint supportedValidator = BuiltInConstraint.valueOfAnnotationClassOrNull(annotation
          .annotationType());
        if (supportedValidator == null) {
          fieldConstraints.put(annotation.annotationType().getName(), constraintAttributes);
        } else {
          fieldConstraints.put(supportedValidator.toString(),
            supportedValidator.createDecoratorFor(constraintAttributes));
        }
      }
    }

    return fieldConstraints;
  }
1194079
public MethodRuleChain around(MethodRule enclosedRule) {
        final List<MethodRule> rules = new ArrayList<MethodRule>();

        rules.add(enclosedRule);
        rules.addAll(this.rules);
        return new MethodRuleChain(rules);
    }
1329708
public void addRule(final TreeRule rule) {
    if (rule == null) {
      throw new IllegalArgumentException("Null rules are not accepted");
    }
    if (rules == null) {
      rules = new TreeMap<Integer, TreeMap<Integer, TreeRule>>();
    }
    
    TreeMap<Integer, TreeRule> level = rules.get(rule.getLevel());
    if (level == null) {
      level = new TreeMap<Integer, TreeRule>();
      level.put(rule.getOrder(), rule);
      rules.put(rule.getLevel(), level);
    } else {
      level.put(rule.getOrder(), rule);
    }
    
    changed.put("rules", true);
  }
739274
public QueryRule createDisMaxQueryRuleForTerms(List<String> queryTerms) {
    List<QueryRule> rules = new ArrayList<>();
    queryTerms
        .stream()
        .filter(StringUtils::isNotEmpty)
        .map(this::escapeCharsExcludingCaretChar)
        .forEach(
            query -> {
              rules.add(new QueryRule(AttributeMetadata.LABEL, Operator.FUZZY_MATCH, query));
              rules.add(new QueryRule(AttributeMetadata.DESCRIPTION, Operator.FUZZY_MATCH, query));
            });
    QueryRule finalDisMaxQuery = new QueryRule(rules);
    finalDisMaxQuery.setOperator(Operator.DIS_MAX);
    return finalDisMaxQuery;
  }
337107
function _getRule(attribute, rules) {
    rules = rules || [];

    if ( ! rules[attribute]) {
      return;
    }

    for(var i in rules[attribute]) {
      var value = rules[attribute][i];
      parsedRule = _parseRule(rule);

      if (in_array(parsedRule.rule, rules))
        return [parsedRule.rule, parsedRule.parameters];
    }
  }