Package jregex

Examples of jregex.Matcher


        Matcher matcher = operatorRegex.matcher(line);
        return matcher.matches() ? matcher.group("score") : "0.0";
    }

    private void addFlogResults(String filePath, FlogFileResults flogResults, String line) {
        Matcher matcher = methodRegex.matcher(line);
        if (matcher.matches()) {
            String methodName = prettifyMethodPath(filePath, matcher.group("method"));
            FlogMethodResults methodResults = new FlogMethodResults(methodName, matcher.group("score"));
            flogResults.addMethodResult(methodResults);
        } else {
            matcher = operatorRegex.matcher(line);
            if (matcher.matches()) {
                flogResults.addOperatorResult(matcher.group("operator"), matcher.group("score"));
            }
        }
    }
View Full Code Here


    preCompileRegExes(); // recompile
  }

  public String parseBrowserFamily(String userAgent) {
    for (Map.Entry<Pattern, Long> entry : compiledBrowserRegMap.entrySet()) {
      Matcher matcher = entry.getKey().matcher(userAgent);
      if (matcher.find()) {
        Long idBrowser = entry.getValue();
        BrowserEntry be = browserMap.get(idBrowser);
        if (be != null) {
          return be.getFamily();
        }
View Full Code Here

     */
    @Override
    protected void processOsRegex(String useragent, UserAgentInfo retObj) {
        Set<Entry<Matcher, Long>> osMatcherSet = getOsMatcherSet();
        for (Map.Entry<Matcher, Long> entry : osMatcherSet) {
            Matcher matcher = entry.getKey();
            matcher.setTarget(useragent);
            if (matcher.find()) {
                retObj.setOsEntry(osMap.get(entry.getValue()));
                break;
            }
        }
    }
View Full Code Here

     */
    @Override
    protected void processBrowserRegex(String useragent, UserAgentInfo retObj) {
        Set<Entry<Matcher, Long>> browserMatcherSet = getBrowserMatcherSet();
        for (Map.Entry<Matcher, Long> entry : browserMatcherSet) {
            Matcher matcher = entry.getKey();
            matcher.setTarget(useragent);
            if (matcher.find()) {
                Long idBrowser = entry.getValue();
                BrowserEntry be = browserMap.get(idBrowser);
                if (be != null) {
                    retObj.setType(browserTypeMap.get(be.getType()));;
                    if (matcher.groupCount() > 1) {
                        retObj.setBrowserVersionInfo(matcher.group(1));
                    }
                    retObj.setBrowserEntry(be);
                }
                // check if this browser has exactly one OS mapped
                Long idOs = browserOsMap.get(idBrowser);
View Full Code Here

        Set<Entry<Matcher, Long>> deviceMatcherSet = getDeviceMatcherSet();
        if (deviceMatcherSet == null || deviceMap == null) {
            return;
        }
        for (Map.Entry<Matcher, Long> entry : deviceMatcherSet) {
            Matcher matcher = entry.getKey();
            matcher.setTarget(useragent);
            if (matcher.find()) {
                uaInfo.setDeviceEntry(deviceMap.get(entry.getValue()));
                return;
            }
        }
    }
View Full Code Here

     * @param useragent
     * @param uaInfo
     */
    protected void processBrowserRegex(String useragent, UserAgentInfo uaInfo) {
        for (Map.Entry<Pattern, Long> entry : compiledBrowserRegMap.entrySet()) {
            Matcher matcher = entry.getKey().matcher(useragent);
            if (matcher.find()) {
                Long idBrowser = entry.getValue();
                BrowserEntry be = browserMap.get(idBrowser);
                if (be != null) {
                    uaInfo.setType(browserTypeMap.get(be.getType()));;
                    if (matcher.groupCount() > 1) {
                        uaInfo.setBrowserVersionInfo(matcher.group(1));
                    }
                    uaInfo.setBrowserEntry(be);
                }
                // check if this browser has exactly one OS mapped
                Long idOs = browserOsMap.get(idBrowser);
View Full Code Here

     * @param useragent
     * @param uaInfo
     */
    protected void processOsRegex(String useragent, UserAgentInfo uaInfo) {
        for (Map.Entry<Pattern, Long> entry : compiledOsRegMap.entrySet()) {
            Matcher matcher = entry.getKey().matcher(useragent);
            if (matcher.find()) {
                uaInfo.setOsEntry(osMap.get(entry.getValue()));
                return;
            }
        }
    }
View Full Code Here

     * @param uaInfo
     */
    protected void processDeviceRegex(String useragent, UserAgentInfo uaInfo) {
        if (compiledDeviceRegMap != null && deviceMap != null) {
        for (Map.Entry<Pattern, Long> entry : compiledDeviceRegMap.entrySet()) {
              Matcher matcher = entry.getKey().matcher(useragent);
              if (matcher.find()) {
                  uaInfo.setDeviceEntry(deviceMap.get(entry.getValue()));
                  return;
              }
          }
        }
View Full Code Here

TOP

Related Classes of jregex.Matcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.