1 11 package org.eclipse.jdt.internal.core.builder; 12 13 import org.eclipse.core.resources.*; 14 15 import org.eclipse.jdt.core.compiler.CharOperation; 16 import org.eclipse.jdt.internal.core.util.Util; 17 18 class ClasspathMultiDirectory extends ClasspathDirectory { 19 20 IContainer sourceFolder; 21 char[][] inclusionPatterns; char[][] exclusionPatterns; boolean hasIndependentOutputFolder; 25 ClasspathMultiDirectory(IContainer sourceFolder, IContainer binaryFolder, char[][] inclusionPatterns, char[][] exclusionPatterns) { 26 super(binaryFolder, true, null); 27 28 this.sourceFolder = sourceFolder; 29 this.inclusionPatterns = inclusionPatterns; 30 this.exclusionPatterns = exclusionPatterns; 31 this.hasIndependentOutputFolder = false; 32 33 if (this.inclusionPatterns != null && this.inclusionPatterns.length == 0) 35 this.inclusionPatterns = null; 36 if (this.exclusionPatterns != null && this.exclusionPatterns.length == 0) 37 this.exclusionPatterns = null; 38 } 39 40 public boolean equals(Object o) { 41 if (this == o) return true; 42 if (!(o instanceof ClasspathMultiDirectory)) return false; 43 44 ClasspathMultiDirectory md = (ClasspathMultiDirectory) o; 45 return sourceFolder.equals(md.sourceFolder) && binaryFolder.equals(md.binaryFolder) 46 && CharOperation.equals(inclusionPatterns, md.inclusionPatterns) 47 && CharOperation.equals(exclusionPatterns, md.exclusionPatterns); 48 } 49 50 protected boolean isExcluded(IResource resource) { 51 if (this.exclusionPatterns != null || this.inclusionPatterns != null) 52 if (this.sourceFolder.equals(this.binaryFolder)) 53 return Util.isExcluded(resource, this.inclusionPatterns, this.exclusionPatterns); 54 return false; 55 } 56 57 public String toString() { 58 return "Source classpath directory " + sourceFolder.getFullPath().toString() + " with " + super.toString(); } 61 } 62 | Popular Tags |