Package org.apache.regexp

Examples of org.apache.regexp.RE


     * @param uri Uniform resource identifier.
     *
     * @return Scheme of the URI.
     */
    public static String getAuthority(String uri) {
        RE re = new RE(uripattern);

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


     * @param uri Uniform resource identifier.
     *
     * @return Path of the URI.
     */
    public static String getPath(String uri) {
        RE re = new RE(uripattern);

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

     * @param uri Uniform resource identifier.
     *
     * @return Path of the URI.
     */
    public static String getPathWithoutAuthority(String uri) {
        RE re = new RE(uripattern);

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

     * @param uri Uniform resource identifier.
     *
     * @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

     * @param uri Uniform resource identifier.
     *
     * @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

         * @param  includeName            Description of Parameter
         * @param  excludeName            Description of Parameter
         * @exception  RESyntaxException  Description of Exception
         */
        public ElementAttributeMatching(String includeName, String excludeName) throws RESyntaxException {
            includeNameRE = new RE(includeName, RE.MATCH_CASEINDEPENDENT);
            excludeNameRE = new RE(excludeName, RE.MATCH_CASEINDEPENDENT);
        }
View Full Code Here

     *          expression.
     */
    public Filter addAttribute(String expression,Object substitution)
    {
        try {
            RE r = new RE(expression);
            put(r, substitution);
        }
        catch (RESyntaxException e) {
            return null;
        }
View Full Code Here

     */
    public Filter removeAttribute(String expression)
    {
        try
        {
             RE r = new RE(expression);
             remove(r);
        }
        catch(Exception e)
        {
        }
View Full Code Here

     * as an argument.
     */
    public boolean hasAttribute(String expression)
    {
        try {
            RE r = new RE(expression);
            return containsKey(r);
        }
        catch (Exception e) {
        }
        return false;
View Full Code Here

        } else {
            action = false;
        }

        try {
            filter = new RE(xpf.getElementValue(itemElement));
        } catch (RESyntaxException e) {
            System.err.println(this.getClass().getName() + ": " + e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.regexp.RE

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.