Package org.hdiv.regex

Examples of org.hdiv.regex.PatternMatcher


      method = method.toUpperCase();
    }

    for (StartPage startPage : this.startPages) {

      PatternMatcher m = startPage.getCompiledPattern();

      if (m.matches(target)) {
        if (startPage.isAnyMethod()) {
          return true;
        } else if (startPage.getMethod().equalsIgnoreCase(method)) {
          return true;
        }
View Full Code Here


   */
  public String isLongLivingPages(String url) {

    for (Map.Entry<PatternMatcher, String> page : this.longLivingPages.entrySet()) {

      PatternMatcher m = page.getKey();

      if (m.matches(url)) {
        return page.getValue();
      }
    }
    return null;
  }
View Full Code Here

    if (errorPage != null && !errorPage.startsWith("/")) {
      errorPage = "/" + errorPage;
    }
    this.errorPage = errorPage;
    if (errorPage != null) {
      PatternMatcher matcher = this.patternMatcherFactory.getPatternMatcher(errorPage);
      this.startPages.add(new StartPage(null, matcher));
    }
  }
View Full Code Here

    if (sessionExpiredLoginPage != null && !sessionExpiredLoginPage.startsWith("/")) {
      sessionExpiredLoginPage = "/" + sessionExpiredLoginPage;
    }
    this.sessionExpiredLoginPage = sessionExpiredLoginPage;
    if (sessionExpiredLoginPage != null) {
      PatternMatcher matcher = this.patternMatcherFactory.getPatternMatcher(sessionExpiredLoginPage);
      this.startPages.add(new StartPage(null, matcher));
    }
  }
View Full Code Here

    if (sessionExpiredHomePage != null && !sessionExpiredHomePage.startsWith("/")) {
      sessionExpiredHomePage = "/" + sessionExpiredHomePage;
    }
    this.sessionExpiredHomePage = sessionExpiredHomePage;
    if (sessionExpiredHomePage != null) {
      PatternMatcher matcher = this.patternMatcherFactory.getPatternMatcher(sessionExpiredHomePage);
      this.startPages.add(new StartPage(null, matcher));
    }
  }
View Full Code Here

  public void setParamsWithoutValidation(Map<String, List<String>> paramsWithoutValidation) {
    this.paramsWithoutValidation = new HashMap<PatternMatcher, List<PatternMatcher>>();
    for (String url : paramsWithoutValidation.keySet()) {

      PatternMatcher matcher = this.patternMatcherFactory.getPatternMatcher(url);
      List<PatternMatcher> paramMatchers = new ArrayList<PatternMatcher>();

      for (String param : paramsWithoutValidation.get(url)) {
        PatternMatcher paramMatcher = this.patternMatcherFactory.getPatternMatcher(param);
        paramMatchers.add(paramMatcher);
      }
      this.paramsWithoutValidation.put(matcher, paramMatchers);
    }
  }
View Full Code Here

   */
  public void setUserStartPages(List<StartPage> userStartPages) {

    for (StartPage startPage : userStartPages) {

      PatternMatcher matcher = this.patternMatcherFactory.getPatternMatcher(startPage.getPattern());
      startPage.setCompiledPattern(matcher);
      this.startPages.add(startPage);

    }
  }
View Full Code Here

   *            the longLivingPages to set
   */
  public void setLongLivingPages(Map<String, String> longLivingPages) {

    for (Map.Entry<String, String> page : longLivingPages.entrySet()) {
      PatternMatcher pattern = this.patternMatcherFactory.getPatternMatcher(page.getKey());
      String scope = page.getValue();
      this.longLivingPages.put(pattern, scope);
    }
  }
View Full Code Here

      // Add default rules if is required
      if (useDefaultRules) {
        activeRules.addAll(defaultRules);
      }
      PatternMatcher patternMatcher = patternMatcherFactory.getPatternMatcher(urlPattern);
      validationsData.put(patternMatcher, activeRules);
    }

    HDIVValidations validations = new HDIVValidations();
    validations.setUrls(validationsData);
View Full Code Here

    Map<PatternMatcher, List<IValidation>> urls = new HashMap<PatternMatcher, List<IValidation>>();

    for (String url : this.validationsData.keySet()) {
      List<String> ids = validationsData.get(url);
      PatternMatcher matcher = this.patternMatcherFactory.getPatternMatcher(url);
      urls.put(matcher, this.createValidationList(ids));
    }
    validations.setUrls(urls);

    return validations;
View Full Code Here

TOP

Related Classes of org.hdiv.regex.PatternMatcher

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.