/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createPackageDeclarationHandle(CompilationUnitDeclaration unit) { if (unit.isPackageInfo()) { char[] packName = CharOperation.concatWith(unit.currentPackage.getImportName(), '.'); Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) { return ((CompilationUnit) openable).getPackageDeclaration(new String(packName)); } } return createTypeHandle(new String(unit.getMainTypeName())); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createPackageDeclarationHandle(CompilationUnitDeclaration unit) { if (unit.isPackageInfo()) { char[] packName = CharOperation.concatWith(unit.currentPackage.getImportName(), '.'); Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) { return ((CompilationUnit) openable).getPackageDeclaration(new String(packName)); } } return createTypeHandle(new String(unit.getMainTypeName())); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createPackageDeclarationHandle(CompilationUnitDeclaration unit) { if (unit.isPackageInfo()) { char[] packName = CharOperation.concatWith(unit.currentPackage.getImportName(), '.'); Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) { return ((CompilationUnit) openable).getPackageDeclaration(new String(packName)); } } return createTypeHandle(new String(unit.getMainTypeName())); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createPackageDeclarationHandle(CompilationUnitDeclaration unit) { if (unit.isPackageInfo()) { char[] packName = CharOperation.concatWith(unit.currentPackage.getImportName(), '.'); Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) { return ((CompilationUnit) openable).getPackageDeclaration(new String(packName)); } } return createTypeHandle(new String(unit.getMainTypeName())); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createPackageDeclarationHandle(CompilationUnitDeclaration unit) { if (unit.isPackageInfo()) { char[] packName = CharOperation.concatWith(unit.currentPackage.getImportName(), '.'); Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) { return ((CompilationUnit) openable).getPackageDeclaration(new String(packName)); } } return createTypeHandle(new String(unit.getMainTypeName())); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createPackageDeclarationHandle(CompilationUnitDeclaration unit) { if (unit.isPackageInfo()) { char[] packName = CharOperation.concatWith(unit.currentPackage.getImportName(), '.'); Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) { return ((CompilationUnit) openable).getPackageDeclaration(new String(packName)); } } return createTypeHandle(new String(unit.getMainTypeName())); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); if (openable instanceof ModularClassFile) return openable; // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); if (openable instanceof ModularClassFile) return openable; // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**
if (length == 0) return null; IType type = createTypeHandle(new String(qualifiedName[0])); // find the top-level type if (type == null) return null;
if (length == 0) return null; IType type = createTypeHandle(new String(qualifiedName[0])); // find the top-level type if (type == null) return null;
if (length == 0) return null; IType type = createTypeHandle(new String(qualifiedName[0])); // find the top-level type if (type == null) return null;
if (length == 0) return null; IType type = createTypeHandle(new String(qualifiedName[0])); // find the top-level type if (type == null) return null;
if (length == 0) return null; IType type = createTypeHandle(new String(qualifiedName[0])); // find the top-level type if (type == null) return null;
if (length == 0) return null; IType type = createTypeHandle(new String(qualifiedName[0])); // find the top-level type if (type == null) return null;
enclosingElement = createTypeHandle(new String(type.name)); } else if (enclosingElement instanceof IType) { enclosingElement = ((IType) parent).getType(new String(type.name));
enclosingElement = createTypeHandle(new String(type.name)); } else if (enclosingElement instanceof IType) { enclosingElement = ((IType) parent).getType(new String(type.name));