Package org.apache.regexp

Examples of org.apache.regexp.RE.match()


     * @return Query of the URI.
     */
    public static String getQuery(String uri) {
        RE re = new RE(uripattern);

        if (re.match(uri)) {
            return re.getParen(7);
        } else {
            throw new IllegalArgumentException("'"+uri+
                                               "' is not a correct URI");
        }
View Full Code Here


     * @return Fragment of the URI.
     */
    public static String getFragment(String uri) {
        RE re = new RE(uripattern);

        if (re.match(uri)) {
            return re.getParen(9);
        } else {
            throw new IllegalArgumentException("'"+uri+
                                               "' is not a correct URI");
        }
View Full Code Here

        if (match == null) {
            return false;
        }

        return re.match(match);
    }

    /**
     * Should be implemented by a concrete authorizer
     *
 
View Full Code Here

    protected boolean preparedMatch(REProgram preparedPattern, String match) {
        boolean result = false;
       
        if (match != null) {
            RE re = new RE(preparedPattern);
            result = re.match(match);
        }
        return result;
    }

    /**
 
View Full Code Here

        RE re = new RE();
       
        // Check the deny patterns, if any
        for (int i = 0; i < denies.length; i++) {
            re.setProgram(denies[i]);
            if (re.match(property)) {
                ServletResponse sres = response.getResponse();
                if (sres instanceof HttpServletResponse) {
                    HttpServletResponse hres = (HttpServletResponse) sres;
                    hres.sendError(HttpServletResponse.SC_FORBIDDEN);
                    return;
View Full Code Here

        }

        // Check the allow patterns, if any
        for (int i = 0; i < allows.length; i++) {
            re.setProgram(allows[i]);
            if (re.match(property)) {
                context.invokeNext(request, response);
                return;
            }
        }
View Full Code Here

        String match = getMatchString(objectModel, parameters);
       
        if (match == null)
            return null;
       
        if(re.match(match)) {
            /* Handle parenthesised subexpressions. XXX: could be faster if we count
             * parens *outside* the generated code.
             * Note: *ONE* based, not zero.
             */
            int parenCount = re.getParenCount();
View Full Code Here

                ree.printStackTrace();
            }

            while (fs.hasMoreElements() == true) {
                final String key = fs.nextElement().toString();
                if (re.match(cachedir) == true) {
                    this.add(key);
                }
            }
        }
View Full Code Here

        String match = getMatchString(objectModel, parameters);

        if (match == null)
            return null;

        if(re.match(match)) {
            /* Handle parenthesised subexpressions. XXX: could be faster if we count
             * parens *outside* the generated code.
             * Note: *ONE* based, not zero.
             */
            int parenCount = re.getParenCount();
View Full Code Here

            if (!"".equals (regex)) {
                getLogger().debug ("String parameter " + name +
                        " should match regexp \"" + regex + "\"" );
                try {
                    RE r = new RE ( regex );
                    if ( !r.match(value) ) {
                        getLogger().debug("and it does not match");
                        return new ValidatorActionHelper ( value, ValidatorActionResult.NOMATCH);
                    };
                } catch ( RESyntaxException rese ) {
                    getLogger().error ("String parameter " + name +
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.