Get the {@link PointSymbolizer} from the given rule.

@param rule the rule to check for symbolizers.
@return the first symbolizer found.
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;
    }
854765
public static ParserRuleContext getFirstChildNode(final ParserRuleContext node, final RuleName ruleName) {
        Optional<ParserRuleContext> result = findFirstChildNode(node, ruleName);
        Preconditions.checkState(result.isPresent());
        return result.get();
    }
999986
function(rule){
    rule = basis.getter(rule || UNION);

    if (this.rule !== rule)
    {
      var oldRule = this.rule;

      this.rule = rule;
      this.emit_ruleChanged(oldRule);

      return this.applyRule();
    }
  }
1136003
public MultipleRuleContext<DPO, RI, RO> check(Rule<RI, RO> rule) {
        if (rule != null) {
            addedRules.add(rule);
        }

        // Change context
        return new MultipleRuleContext<DPO, RI, RO>(addedTriggers, addedDataProviders, dataProviderToRuleMapping,
                addedRuleInputTransformers, addedRules);
    }
1076223
def _to_rule(self, lark_rule):
        """"""
        assert isinstance(lark_rule.origin, NT)
        assert all(isinstance(x, Symbol) for x in lark_rule.expansion)
        return Rule(
            lark_rule.origin, lark_rule.expansion,
            weight=lark_rule.options.priority if lark_rule.options and lark_rule.options.priority else 0,
            alias=lark_rule)
292686
public static Rule getRule(final String inequalitySymbol,
                             final Stack stack) {
      if (stack.size() < 2) {
          throw new IllegalArgumentException("Invalid " + inequalitySymbol
                  + " rule - expected two parameters but received "
                  + stack.size());
      } 

      String p2 = stack.pop().toString();
      String p1 = stack.pop().toString();
      return getRule(inequalitySymbol, p1, p2);
  }
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();
    }
42995
public static Rule getRule(final String field, final String pattern) {
    try {
        return new LikeRule(field, Pattern.compile(pattern, Pattern.CASE_INSENSITIVE));
    } catch (PatternSyntaxException e) {
        throw new IllegalArgumentException(
                "Invalid LIKE rule - " + e.getMessage());
    }
  }
1087608
@Nullable
    static String removeElExpressionBraces(@Nullable final String rule) {
        if(isEmptyWhitespace(rule)) {
            return null;
        }
        int startchar = 0; // inclusive
        int endchar = rule.length() - 1; // inclusive

        // garbage free trim()
        while(startchar < rule.length() && CharMatcher.WHITESPACE.matches(rule.charAt(startchar))) {
            ++startchar;
        }
        while(endchar > startchar && CharMatcher.WHITESPACE.matches(rule.charAt(endchar))) {
            --endchar;
        }

        if(rule.regionMatches(startchar, "${", 0, 2) && rule.charAt(endchar) == '}') {
            startchar += 2; // skip "${"
            --endchar; // skip '}'
        }
        // garbage free trim()
        while(startchar < rule.length() && CharMatcher.WHITESPACE.matches(rule.charAt(startchar))) {
            ++startchar;
        }
        while(endchar > startchar && CharMatcher.WHITESPACE.matches(rule.charAt(endchar))) {
            --endchar;
        }
        if(endchar < startchar ) {
            // null instead of empty string for consistency with 'isEmptyWhitespace' check at the beginning
            return null;
        }
        return rule.substring(startchar, endchar + 1);
    }
1122027
public NeedleRule withOuter(final MethodRule rule) {
        if (rule instanceof InjectionProvider) {
            addInjectionProvider((InjectionProvider<?>) rule);
        }
        methodRuleChain.add(0, rule);
        return this;
    }
303351
public static List<Contour> contourExternal(GrayU8 input, ConnectRule rule ) {
		BinaryContourFinder alg = FactoryBinaryContourFinder.linearExternal();
		alg.setConnectRule(rule);
		alg.process(input);

		return convertContours(alg);
	}
1067936
def get_weight(self, rule):
        
        if not issubclass(rule.__class__, (Rule, RuleLeaf)):
            raise TypeError("Rule to get weight ({}) is not subclass "
                            "of {} or {}.".format(rule, Rule, RuleLeaf))
        try:
            ind = self._R.index(rule)
            return self._W[ind]
        except:
            return None
149066
public static PolygonSymbolizer polygonSymbolizerFromRule( Rule rule ) {
        List<Symbolizer> symbolizers = rule.symbolizers();
        PolygonSymbolizer polygonSymbolizer = null;
        for( Symbolizer symbolizer : symbolizers ) {
            if (symbolizer instanceof PolygonSymbolizer) {
                polygonSymbolizer = (PolygonSymbolizer) symbolizer;
                break;
            }
        }
        if (polygonSymbolizer == null) {
            throw new IllegalArgumentException();
        }
        return polygonSymbolizer;
    }
1009614
public static PointSymbolizerInfo createPointSymbolizer(GraphicInfo graphicInfo) {
		PointSymbolizerInfo symbolizerInfo = new PointSymbolizerInfo();
		symbolizerInfo.setGraphic(graphicInfo);
		return symbolizerInfo;
	}
112790
public boolean isSyntheticTerminalRule(final TerminalRule rule) {
    AbstractElement _alternatives = rule.getAlternatives();
    if ((_alternatives instanceof Keyword)) {
      AbstractElement _alternatives_1 = rule.getAlternatives();
      String value = ((Keyword) _alternatives_1).getValue();
      String _name = AntlrGrammarGenUtil.<TerminalRule>getOriginalElement(rule).getName();
      String _plus = ("synthetic:" + _name);
      return Objects.equal(_plus, value);
    }
    return false;
  }
1273146
public Rule getRule(String name) {
		Rule rule = rules.get(name);
		if (rule == null) {
			throw new FuzzerException(name + ": rule not found");
		}
		return rule;
	}
840076
@Override
    public void visit(@Nonnull SWRLRule rule) {
        for (SWRLAtom atom : rule.getBody()) {
            atom.accept(this);
        }
        for (SWRLAtom atom : rule.getHead()) {
            atom.accept(this);
        }
        processAxiomAnnotations(rule);
    }