Package org.apache.tools.ant.types

Examples of org.apache.tools.ant.types.PatternSet$NameEntry


     */
    public synchronized PatternSet createPatternSet() {
        if (isReference()) {
            throw noChildrenAllowed();
        }
        PatternSet patterns = new PatternSet();
        additionalPatterns.addElement(patterns);
        ds = null;
        setChecked(false);
        return patterns;
    }
View Full Code Here


        }
        Files f = (Files) super.clone();
        f.defaultPatterns = (PatternSet) defaultPatterns.clone();
        f.additionalPatterns = new Vector(additionalPatterns.size());
        for (Iterator iter = additionalPatterns.iterator(); iter.hasNext();) {
            PatternSet ps = (PatternSet) iter.next();
            f.additionalPatterns.add(ps.clone());
        }
        return f;
    }
View Full Code Here

    public synchronized PatternSet mergePatterns(Project p) {
        if (isReference()) {
            return getRef().mergePatterns(p);
        }
        dieOnCircularReference();
        PatternSet ps = new PatternSet();
        ps.append(defaultPatterns, p);
        final int count = additionalPatterns.size();
        for (int i = 0; i < count; i++) {
            Object o = additionalPatterns.elementAt(i);
            ps.append((PatternSet) o, p);
        }
        return ps;
    }
View Full Code Here

    private synchronized void ensureDirectoryScannerSetup() {
        dieOnCircularReference();
        if (ds == null) {
            ds = new DirectoryScanner();
            PatternSet ps = mergePatterns(getProject());
            ds.setIncludes(ps.getIncludePatterns(getProject()));
            ds.setExcludes(ps.getExcludePatterns(getProject()));
            ds.setSelectors(getSelectors(getProject()));
            if (useDefaultExcludes) {
                ds.addDefaultExcludes();
            }
            ds.setCaseSensitive(caseSensitive);
View Full Code Here

            boolean included = false;
            Set includePatterns = new HashSet();
            Set excludePatterns = new HashSet();
            final int size = patternsets.size();
            for (int v = 0; v < size; v++) {
                PatternSet p = (PatternSet) patternsets.elementAt(v);
                String[] incls = p.getIncludePatterns(getProject());
                if (incls == null || incls.length == 0) {
                    // no include pattern implicitly means includes="**"
                    incls = new String[] {"**"};
                }

                for (int w = 0; w < incls.length; w++) {
                    String pattern = incls[w].replace('/', File.separatorChar)
                        .replace('\\', File.separatorChar);
                    if (pattern.endsWith(File.separator)) {
                        pattern += "**";
                    }
                    includePatterns.add(pattern);
                }

                String[] excls = p.getExcludePatterns(getProject());
                if (excls != null) {
                    for (int w = 0; w < excls.length; w++) {
                        String pattern = excls[w]
                            .replace('/', File.separatorChar)
                            .replace('\\', File.separatorChar);
View Full Code Here

    /**
     * Include files
     */
    public PatternSet createIncludes() {
        includes=new PatternSet(); //Path(project);
        return includes;
    }
View Full Code Here

        // for each sourcePath entry, add a directoryset with includes
        // taken from packagenames attribute and nested package
        // elements and excludes taken from excludepackages attribute
        // and nested excludepackage elements
        if (sourcePath != null) {
            PatternSet ps = new PatternSet();
            ps.setProject(getProject());
            if (packageNames.size() > 0) {
                Enumeration<PackageName> e = packageNames.elements();
                while (e.hasMoreElements()) {
                    PackageName p = e.nextElement();
                    String pkg = p.getName().replace('.', '/');
                    if (pkg.endsWith("*")) {
                        pkg += "*";
                    }
                    ps.createInclude().setName(pkg);
                }
            } else {
                ps.createInclude().setName("**");
            }

            Enumeration<PackageName> e = excludePackageNames.elements();
            while (e.hasMoreElements()) {
                PackageName p = e.nextElement();
                String pkg = p.getName().replace('.', '/');
                if (pkg.endsWith("*")) {
                    pkg += "*";
                }
                ps.createExclude().setName(pkg);
            }


            String[] pathElements = sourcePath.list();
            for (int i = 0; i < pathElements.length; i++) {
View Full Code Here

  /**
   * Setter for the "jars" attribute (required if no "jarfileset" is present)
   */
  public void setJars(String s) {
    PatternSet patset = new PatternSet();
    patset.setIncludes(s);

    String[] jarNames = patset.getIncludePatterns(getProject());

    for (int i = 0; i < jarNames.length; i++)
      mJarAttrs.add(getProject().resolveFile(jarNames[i]));
  }
View Full Code Here

  /**
   * Setter for the "execs" attribute (optional)
   */
  public void setExecs(String s) {
    PatternSet patset = new PatternSet();
    patset.setIncludes(s);

    String[] execNames = patset.getIncludePatterns(getProject());

    for (int i = 0; i < execNames.length; i++) {
      File f = new File(execNames[i]);
      mExecAttrs.add(f);
    }
View Full Code Here

  /**
   * Setter for the "extraclasspath" attribute (optional)
   */
  public void setExtraclasspath(String s) {
    if (s == null || s.trim().equals("")) return;
    PatternSet patset = new PatternSet();
    patset.setIncludes(s);

    String[] cpNames = patset.getIncludePatterns(getProject());

    for (int i = 0; i < cpNames.length; i++) {
      File f = new File(cpNames[i]);
      mExtraClassPathAttrs.add(f);
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.PatternSet$NameEntry

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.