GET /rules/(some,surt,)

@param surt
@return
@throws URIException
499362
public ModelAndView getRuleNode(String surt) throws URIException {
        return new ModelAndView(view, "object", ruleDao.getRulesWithExactSurt(surt));        
    }
999967
function (rules) {

    var parsedRules = {};
    rules = this._flattenObject(rules);

    for (var attribute in rules) {

      var rulesArray = rules[attribute];

      this._parseRulesCheck(attribute, rulesArray, parsedRules);
    }
    return parsedRules;


  }
4779
public String getPathQuery() throws URIException {
        char[] rawPathQuery = getRawPathQuery();
        return (rawPathQuery == null) ? null : decode(rawPathQuery,
                getProtocolCharset());
    }
843722
public Object parse(JsonRule jsonRule) {
        // filter
        for (IRuleFilter ruleFilter : ruleFilters) {
            ruleFilter.doFilter(jsonRule, builderType);
        }

        // parse
        if (jsonRule.isGroup()) {
            return groupParser.parse(jsonRule, this);
        } else {
            for (IRuleParser ruleParser : ruleParsers) {
                if (ruleParser.canParse(jsonRule)) {
                    return ruleParser.parse(jsonRule, this);
                }
            }

            throw new ParserNotFoundException("Can't found rule parser for:" + jsonRule);
        }
    }
413599
private URI checkURI(String uri)
  {
    try
    {
      return new URI(Preconditions.checkNotNull(uri).trim());
    } catch (URISyntaxException e)
    {
      parser.getReport().message(MessageId.RSC_020, parser.getLocation(), uri);
      return null;
    }
  }
216025
private static RuleList parseRuleChain(String description)
            throws ParseException {
        RuleList result = new RuleList();
        // remove trailing ;
        if (description.endsWith(";")) {
            description = description.substring(0,description.length()-1);
        }
        String[] rules = SEMI_SEPARATED.split(description);
        for (int i = 0; i < rules.length; ++i) {
            Rule rule = parseRule(rules[i].trim());
            result.hasExplicitBoundingInfo |= rule.integerSamples != null || rule.decimalSamples != null;
            result.addRule(rule);
        }
        return result.finish();
    }
4629
private void updateRuleIndexes(CQIE rule) {
		Function head = rule.getHead();
		ruleIndex.put(head.getFunctionSymbol(), rule);
		updateRuleIndexByBodyPredicate(rule);
	}
157344
public Rule getRule(Resource resource) {
    for (Rule rule : rules) {
      if (rule.matches(resource)) {
        return rule;
      }
    }
    return null;
  }
748806
public ModelAndView getRules(HttpServletRequest request, HttpServletResponse response, boolean isHead) throws UnsupportedEncodingException, ParseException {
        String prefix = request.getParameter("prefix");
        if (prefix != null) {
            return new ModelAndView(view, "object", ruleDao.getRulesWithSurtPrefix(prefix));
        }

        String surt = request.getParameter("surt");
        if (surt != null) {
            return new ModelAndView(view, "object", ruleDao.getRulesWithExactSurt(surt));
        }
        
		List<Rule> rules = null;
        String modifiedAfter = request.getParameter("modifiedAfter");
                
        String who = request.getParameter("who");
        
        if (modifiedAfter != null || who != null) {
        	rules = ruleDao.getRulesModifiedAfter(modifiedAfter, who, view.getCustomRestrict());
        }
        
        if (rules == null) {
        	rules = ruleDao.getAllRules();
        }
        
        response.addIntHeader(HttpRuleDao.ORACLE_NUM_RULES, rules.size());
        
    	return new ModelAndView(view, "object", rules);        
    }
1055456
public java.util.List<String> getRuleNames() {
        if (ruleNames == null) {
            ruleNames = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return ruleNames;
    }
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];
    }
  }
146019
public static String getScheme(String uriString) {
        try {
            return (new URI(uriString)).getScheme();
        }
        catch (URISyntaxException e) {
            try {
                return (new NetworkInterfaceURI(uriString)).getScheme();
            }
            catch (IllegalArgumentException ne) {
                throw new IllegalArgumentException(ne.getMessage(), ne);
            }
        }
    }
1259931
function( rule ) {
    var exports = {};

    if ( !rule.match( regexp.URLS ) ) {
        return false;
    }

    if ( ! ( this instanceof UrlsHelper ) ) {
        return new UrlsHelper( rule );
    }

    this._originalRule = rule;
    this._helpers = [];
    this.URIS = [];

    rule.match( regexp.URLS ).forEach( function( url ) {
        var urlHelper = new UrlHelper( url );

        this._helpers.push( urlHelper );
        this.URIS.push( urlHelper.URI );
    }, this );

    exports.URIS            = this.URIS;
    exports.getOriginalURIS = this.getOriginalURIS.bind( this );
    exports.getModifiedRule = this.getModifiedRule.bind( this );
    exports.getOriginalRule = this.getOriginalRule.bind( this );

    return exports;
}
1076410
private TreeRule parseRule(HttpQuery query) {
    final TreeRule rule = new TreeRule(parseTreeId(query, true));
    
    if (query.hasQueryStringParam("type")) {
      try {
        rule.setType(TreeRule.stringToType(query.getQueryStringParam("type")));
      } catch (IllegalArgumentException e) {
        throw new BadRequestException("Unable to parse the 'type' parameter", e);
      }
    }
    if (query.hasQueryStringParam("field")) {
      rule.setField(query.getQueryStringParam("field"));
    }
    if (query.hasQueryStringParam("custom_field")) {
      rule.setCustomField(query.getQueryStringParam("custom_field"));
    }
    if (query.hasQueryStringParam("regex")) {
      try {
        rule.setRegex(query.getQueryStringParam("regex"));
      } catch (PatternSyntaxException e) {
        throw new BadRequestException(
            "Unable to parse the 'regex' parameter", e);
      }
    }
    if (query.hasQueryStringParam("separator")) {
      rule.setSeparator(query.getQueryStringParam("separator"));
    }
    if (query.hasQueryStringParam("description")) {
      rule.setDescription(query.getQueryStringParam("description"));
    }
    if (query.hasQueryStringParam("notes")) {
      rule.setNotes(query.getQueryStringParam("notes"));
    }
    if (query.hasQueryStringParam("regex_group_idx")) {
      try {
        rule.setRegexGroupIdx(Integer.parseInt(
            query.getQueryStringParam("regex_group_idx")));
      } catch (NumberFormatException e) {
        throw new BadRequestException(
            "Unable to parse the 'regex_group_idx' parameter", e);
      }
    }
    if (query.hasQueryStringParam("display_format")) {
      rule.setDisplayFormat(query.getQueryStringParam("display_format"));
    }
    //if (query.hasQueryStringParam("level")) {
      try {
        rule.setLevel(Integer.parseInt(
            query.getRequiredQueryStringParam("level")));
      } catch (NumberFormatException e) {
        throw new BadRequestException(
            "Unable to parse the 'level' parameter", e);
      }
    //}
    //if (query.hasQueryStringParam("order")) {
      try {
        rule.setOrder(Integer.parseInt(
            query.getRequiredQueryStringParam("order")));
      } catch (NumberFormatException e) {
        throw new BadRequestException(
            "Unable to parse the 'order' parameter", e);
      }
    //}
    return rule;
  }
1273146
public Rule getRule(String name) {
		Rule rule = rules.get(name);
		if (rule == null) {
			throw new FuzzerException(name + ": rule not found");
		}
		return rule;
	}
265379
public com.google.protobuf.ByteString
      getRuleIdBytes() {
    java.lang.Object ref = ruleId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      ruleId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
447015
private List<String> collectRuleNames() {
        List<String> ruleNames = new ArrayList<>();
        for (Rule rule : rules) {
            ruleNames.add(rule.getName());
        }
        Collections.sort(ruleNames);
        return ruleNames;
    }