Package org.apache.tools.ant.types

Examples of org.apache.tools.ant.types.RegularExpression


            }
            options = convertRegexOptions(flags);
            if (from == null) {
                throw new BuildException("Missing from in containsregex");
            }
            regularExpression = new RegularExpression();
            regularExpression.setPattern(from);
            regexp = regularExpression.getRegexp(getProject());
            if (to == null) {
                return;
            }
View Full Code Here


            final int regexpsSize = regexps.size();

            for (line = readLine(); line != null; line = readLine()) {
                boolean matches = true;
                for (int i = 0; matches && i < regexpsSize; i++) {
                    RegularExpression regexp
                        = (RegularExpression) regexps.elementAt(i);
                    Regexp re = regexp.getRegexp(getProject());
                    matches = re.matches(line);
                }
                if (matches ^ isNegated()) {
                    break;
                }
View Full Code Here

        Parameter[] params = getParameters();
        if (params != null) {
            for (int i = 0; i < params.length; i++) {
                if (REGEXP_KEY.equals(params[i].getType())) {
                    String pattern = params[i].getValue();
                    RegularExpression regexp = new RegularExpression();
                    regexp.setPattern(pattern);
                    regexps.addElement(regexp);
                } else if (NEGATE_KEY.equals(params[i].getType())) {
                    setNegate(Project.toBoolean(params[i].getValue()));
                }
            }
View Full Code Here

    private boolean matches(String name) {
        if (pattern != null) {
            return SelectorUtils.match(modify(pattern), modify(name), cs);
        } else {
            if (reg == null) {
                reg = new RegularExpression();
                reg.setPattern(regex);
                expression = reg.getRegexp(project);
            }
            int options = Regexp.MATCH_DEFAULT;
            if (!cs) {
View Full Code Here

    public void setMatch(String match) {
        if (regex != null) {
            throw new BuildException("Only one regular expression is allowed");
        }

        regex = new RegularExpression();
        regex.setPattern(match);
    }
View Full Code Here

    public RegularExpression createRegexp() {
        if (regex != null) {
            throw new BuildException("Only one regular expression is allowed.");
        }

        regex = new RegularExpression();
        return regex;
    }
View Full Code Here

        if (r.isDirectory()) {
            return true;
        }

        if (myRegExp == null) {
            myRegExp = new RegularExpression();
            myRegExp.setPattern(userProvidedExpression);
            myExpression = myRegExp.getRegexp(getProject());
        }

        try {
View Full Code Here

        if (pattern != null) {
            return (SelectorUtils.matchPath(pattern, filename,
                                            casesensitive) == !(negated));
        } else {
            if (reg == null) {
                reg = new RegularExpression();
                reg.setPattern(regex);
                expression = reg.getRegexp(getProject());
            }
            int options = Regexp.MATCH_DEFAULT;
            if (!casesensitive) {
View Full Code Here

    public void setPattern(String pattern) {
        if (regularExpression != null) {
            throw new BuildException(
                "Only one regular expression is allowed.");
        }
        regularExpression = new RegularExpression();
        regularExpression.setPattern(pattern);
    }
View Full Code Here

            }
            options = convertRegexOptions(flags);
            if (from == null) {
                throw new BuildException("Missing pattern in replaceregex");
            }
            regularExpression = new RegularExpression();
            regularExpression.setPattern(from);
            regexp = regularExpression.getRegexp(getProject());
            if (to == null) {
                to = "";
            }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.RegularExpression

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.