Package org.apache.tools.ant.types

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


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

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

        try {
View Full Code Here


            }
            result.setInputString(input.toString());
            result.setLogInputString(false);
            // Try to avoid showing password prompts on log output, as they would be confusing.
            LineContainsRegExp filter = new LineContainsRegExp();
            RegularExpression rx = new RegularExpression();
            // TODO only handles English locale, not ja or zh_CN
            rx.setPattern("^(Enter Passphrase for keystore: |Enter key password for .+: )$");
            filter.addConfiguredRegexp(rx);
            filter.setNegate(true);
            result.createErrorFilterChain().addLineContainsRegExp(filter);
        }
        return result;
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

    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

    private void configureConcat() {
        concat.setProject(getProject());
        concat.setTaskName(getTaskName());
        FilterChain filterChain = new FilterChain();
        LineContainsRegExp lcre = new LineContainsRegExp();
        RegularExpression regexp = new RegularExpression();
        regexp.setPattern("^import .+;");
        lcre.addConfiguredRegexp(regexp);
        filterChain.add(lcre);
        TokenFilter tf = new TokenFilter();
        TokenFilter.ReplaceRegex rre = new TokenFilter.ReplaceRegex();
        rre.setPattern("import (.+);.*");
 
View Full Code Here

    private void configureConcat() {
        _concat.setProject(getProject());
        _concat.setTaskName(getTaskName());
        FilterChain filterChain = new FilterChain();
        LineContainsRegExp lcre = new LineContainsRegExp();
        RegularExpression regexp = new RegularExpression();
        regexp.setPattern("^import .+;");
        lcre.addConfiguredRegexp(regexp);
        filterChain.add(lcre);
        TokenFilter tf = new TokenFilter();
        TokenFilter.ReplaceRegex rre = new TokenFilter.ReplaceRegex();
        rre.setPattern("import (.+);.*");
 
View Full Code Here

    public void setRegexp(String regex)
    {
        if (this.regexp != null)
            throw new BuildException("Cannot specify more than one regular expression");

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

    public RegularExpression createRegexp()
    {
        if (this.regexp != null)
            throw new BuildException("Cannot specify more than one regular expression");
        regexp = new RegularExpression();
        return regexp;
    }
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.