@Override public void consumePackage(char[] pkgName) { this.compoundName = CharOperation.splitOn('/', pkgName); this.compilerBinding = new PackageBinding(this.compoundName, null, this.environment, this.environment.module); //TODO(SHMOD) enclosingModule }
protected static String[] readNameTable(String filename) throws java.io.IOException { char[] contents = readTable(filename); char[][] nameAsChar = CharOperation.splitOn('\n', contents); String[] result = new String[nameAsChar.length + 1]; result[0] = null; for (int i = 0; i < nameAsChar.length; i++) { result[i + 1] = new String(nameAsChar[i]); } return result; } protected static String[] readReadableNameTable(String filename){
/** * EXTERNAL API * Answer the compound name of the class file. * @return char[][] * e.g. {{java}, {util}, {Hashtable}}. */ public char[][] getCompoundName() { return CharOperation.splitOn('/', fileName()); }
/** * EXTERNAL API * Answer the compound name of the class file. * @return char[][] * e.g. {{java}, {util}, {Hashtable}}. */ public char[][] getCompoundName() { return CharOperation.splitOn('/', fileName()); }
public static char[][][] internQualifiedNames(StringSet qualifiedStrings) { if (qualifiedStrings == null) return EmptyQualifiedNames; int length = qualifiedStrings.elementSize; if (length == 0) return EmptyQualifiedNames; char[][][] result = new char[length][][]; String[] strings = qualifiedStrings.values; for (int i = 0, l = strings.length; i < l; i++) if (strings[i] != null) result[--length] = CharOperation.splitOn('/', strings[i].toCharArray()); return internQualifiedNames(result, false); }
/** * EXTERNAL API * Answer the compound name of the class file. * @return char[][] * e.g. {{java}, {util}, {Hashtable}}. */ public char[][] getCompoundName() { return CharOperation.splitOn('/', fileName()); }
public static char[][][] internQualifiedNames(StringSet qualifiedStrings) { if (qualifiedStrings == null) return EmptyQualifiedNames; int length = qualifiedStrings.elementSize; if (length == 0) return EmptyQualifiedNames; char[][][] result = new char[length][][]; String[] strings = qualifiedStrings.values; for (int i = 0, l = strings.length; i < l; i++) if (strings[i] != null) result[--length] = CharOperation.splitOn('/', strings[i].toCharArray()); return internQualifiedNames(result, false); }
/** * EXTERNAL API * Answer the compound name of the class file. * @return char[][] * e.g. {{java}, {util}, {Hashtable}}. */ public char[][] getCompoundName() { return CharOperation.splitOn('/', fileName()); }
/** * EXTERNAL API * Answer the compound name of the class file. * @return char[][] * e.g. {{java}, {util}, {Hashtable}}. */ public char[][] getCompoundName() { return CharOperation.splitOn('/', fileName()); }
protected static String[] readNameTable(String filename) throws java.io.IOException { char[] contents = readTable(filename); char[][] nameAsChar = CharOperation.splitOn('\n', contents); String[] result = new String[nameAsChar.length + 1]; result[0] = null; for (int i = 0; i < nameAsChar.length; i++) { result[i + 1] = new String(nameAsChar[i]); } return result; } protected static String[] readReadableNameTable(String filename){
@Override public TypeElement getTypeElement(CharSequence name) { final char[][] compoundName = CharOperation.splitOn('.', name.toString().toCharArray()); Set<? extends ModuleElement> allModuleElements = getAllModuleElements(); for (ModuleElement moduleElement : allModuleElements) { TypeElement t = getTypeElement(compoundName, ((ModuleElementImpl) moduleElement).binding); if (t != null) { return t; } } return null; }
private AccessRestriction getViolatedRestriction(String typeName, String packageName, ClasspathEntry entry, AccessRestriction accessRestriction) { AccessRuleSet accessRuleSet = entry.getAccessRuleSet(); if (accessRuleSet != null) { // TODO (philippe) improve char[] <-> String conversions to avoid performing them on the fly char[][] packageChars = CharOperation.splitOn('.', packageName.toCharArray()); char[] typeChars = typeName.toCharArray(); accessRestriction = accessRuleSet.getViolatedRestriction(CharOperation.concatWith(packageChars, typeChars, '/')); } return accessRestriction; }
public PossibleMatch(MatchLocator locator, IResource resource, Openable openable, SearchDocument document, boolean mustResolve) { this.resource = resource; this.openable = openable; this.document = document; this.nodeSet = new MatchingNodeSet(mustResolve); char[] qualifiedName = getQualifiedName(); if (qualifiedName != null) this.compoundName = CharOperation.splitOn('.', qualifiedName); } public void cleanUp() {
@Override public TypeBinding[] getUses() { if (this.uses == null) { this.uses = new TypeBinding[this.unresolvedUses.length]; for (int i = 0; i < this.unresolvedUses.length; i++) this.uses[i] = this.environment.getType(CharOperation.splitOn('.', this.unresolvedUses[i]), this); } return super.getUses(); }
@Override public TypeBinding[] getUses() { if (this.uses == null) { this.uses = new TypeBinding[this.unresolvedUses.length]; for (int i = 0; i < this.unresolvedUses.length; i++) this.uses[i] = this.environment.getType(CharOperation.splitOn('.', this.unresolvedUses[i]), this); } return super.getUses(); }
@Override public void addExports(char[] packageName, char[][] targetModules) { PackageBinding declaredPackage = getVisiblePackage(CharOperation.splitOn('.', packageName)); if (declaredPackage != null && declaredPackage.isValidBinding()) addResolvedExport(declaredPackage, targetModules); }
public void acceptType( char[] packageName, char[] typeName, char[][] enclosingTypeNames, int modifiers, AccessRestriction accessRestriction) { char[] fullyQualifiedName = CharOperation.concat(packageName, CharOperation.concat(CharOperation.concatWith(enclosingTypeNames, '.'), typeName, '.'), '.'); if (isQualified && !CharOperation.endsWith(fullyQualifiedName, missingFullyQualifiedName)) return; char[][] compoundName = CharOperation.splitOn('.', fullyQualifiedName); results.add(compoundName); }
public BinaryTypeBinding cacheBinaryType(IBinaryType binaryType, boolean needFieldsAndMethods, AccessRestriction accessRestriction) { char[][] compoundName = CharOperation.splitOn('/', binaryType.getName()); ReferenceBinding existingType = getCachedType(compoundName); if (existingType == null || existingType instanceof UnresolvedReferenceBinding) // only add the binary type if its not already in the cache return createBinaryTypeFrom(binaryType, computePackageFrom(compoundName, false /* valid pkg */), needFieldsAndMethods, accessRestriction); return null; // the type already exists & can be retrieved from the cache }
public BinaryTypeBinding cacheBinaryType(IBinaryType binaryType, boolean needFieldsAndMethods, AccessRestriction accessRestriction) { char[][] compoundName = CharOperation.splitOn('/', binaryType.getName()); ReferenceBinding existingType = getCachedType(compoundName); if (existingType == null || existingType instanceof UnresolvedReferenceBinding) // only add the binary type if its not already in the cache return createBinaryTypeFrom(binaryType, computePackageFrom(compoundName, false /* valid pkg */), needFieldsAndMethods, accessRestriction); return null; // the type already exists & can be retrieved from the cache }
public BinaryTypeBinding cacheBinaryType(IBinaryType binaryType, boolean needFieldsAndMethods, AccessRestriction accessRestriction) { char[][] compoundName = CharOperation.splitOn('/', binaryType.getName()); ReferenceBinding existingType = getCachedType(compoundName); if (existingType == null || existingType instanceof UnresolvedReferenceBinding) // only add the binary type if its not already in the cache return createBinaryTypeFrom(binaryType, computePackageFrom(compoundName, false /* valid pkg */), needFieldsAndMethods, accessRestriction); return null; // the type already exists & can be retrieved from the cache }