1 11 package org.eclipse.jdt.internal.compiler.batch; 12 13 import java.io.File ; 14 15 import org.eclipse.jdt.core.compiler.CharOperation; 16 import org.eclipse.jdt.internal.compiler.env.AccessRestriction; 17 import org.eclipse.jdt.internal.compiler.env.AccessRuleSet; 18 import org.eclipse.jdt.internal.compiler.util.SuffixConstants; 19 20 public abstract class ClasspathLocation implements FileSystem.Classpath, 21 SuffixConstants { 22 23 public static final int SOURCE = 1; 24 public static final int BINARY = 2; 25 26 public AccessRuleSet accessRuleSet; 27 28 public String destinationPath; 29 39 protected ClasspathLocation(AccessRuleSet accessRuleSet, 40 String destinationPath) { 41 this.accessRuleSet = accessRuleSet; 42 this.destinationPath = destinationPath; 43 } 44 45 57 protected AccessRestriction fetchAccessRestriction(String qualifiedBinaryFileName) { 58 if (this.accessRuleSet == null) 59 return null; 60 char [] qualifiedTypeName = qualifiedBinaryFileName. 61 substring(0, qualifiedBinaryFileName.length() - SUFFIX_CLASS.length) 62 .toCharArray(); 63 if (File.separatorChar == '\\') { 64 CharOperation.replace(qualifiedTypeName, File.separatorChar, '/'); 65 } 66 return this.accessRuleSet.getViolatedRestriction(qualifiedTypeName); 67 } 68 } 69 | Popular Tags |