Examples of IType


Examples of org.aspectj.org.eclipse.jdt.core.IType

    HashMap knownScopes = new HashMap(parsedUnit.localTypeCount);
    for (int i = 0; i < parsedUnit.localTypeCount; i++) {
      LocalTypeBinding localType = parsedUnit.localTypes[i];
      ClassScope classScope = localType.scope;
      TypeDeclaration typeDecl = classScope.referenceType();
      IType typeHandle = (IType)factory.createElement(classScope, cu, existingElements, knownScopes);
      rememberWithMemberTypes(typeDecl, typeHandle);
    }
  }
}
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IType

    if (!subOrSuperOfFocus(typeBinding)) {
      continue; // ignore types outside of hierarchy
    }

    IType superclass;
    if (typeBinding.isInterface()){ // do not connect interfaces to Object
      superclass = null;
    } else {
      superclass = findSuperClass(suppliedType, typeBinding);
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IType

    org.aspectj.org.eclipse.jdt.core.ICompilationUnit[] cus = new org.aspectj.org.eclipse.jdt.core.ICompilationUnit[openablesLength];
    int unitsIndex = 0;
   
    CompilationUnitDeclaration focusUnit = null;
    ReferenceBinding focusBinaryBinding = null;
    IType focus = this.builder.getType();
    Openable focusOpenable = null;
    if (focus != null) {
      if (focus.isBinary()) {
        focusOpenable = (Openable)focus.getClassFile();
      } else {
        focusOpenable = (Openable)focus.getCompilationUnit();
      }
    }
   
    // build type bindings
    Parser parser = new Parser(this.lookupEnvironment.problemReporter, true);
    for (int i = 0; i < openablesLength; i++) {
      Openable openable = openables[i];
      if (openable instanceof org.aspectj.org.eclipse.jdt.core.ICompilationUnit) {
        org.aspectj.org.eclipse.jdt.core.ICompilationUnit cu = (org.aspectj.org.eclipse.jdt.core.ICompilationUnit)openable;

        // contains a potential subtype as a local or anonymous type?
        boolean containsLocalType = false;
        if (localTypes == null) { // case of hierarchy on region
          containsLocalType = true;
        } else {
          IPath path = cu.getPath();
          containsLocalType = localTypes.contains(path.toString());
        }
       
        // build parsed unit
        CompilationUnitDeclaration parsedUnit = null;
        if (cu.isOpen()) {
          // create parsed unit from source element infos
          CompilationResult result = new CompilationResult(((ICompilationUnit)cu).getFileName(), i, openablesLength, this.options.maxProblemsPerUnit);
          SourceTypeElementInfo[] typeInfos = null;
          try {
            IType[] topLevelTypes = cu.getTypes();
            int topLevelLength = topLevelTypes.length;
            if (topLevelLength == 0) continue; // empty cu: no need to parse (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=65677)
            typeInfos = new SourceTypeElementInfo[topLevelLength];
            for (int j = 0; j < topLevelLength; j++) {
              IType topLevelType = topLevelTypes[j];
              typeInfos[j] = (SourceTypeElementInfo)((JavaElement)topLevelType).getElementInfo();
            }
          } catch (JavaModelException e) {
            // types/cu exist since cu is opened
          }
          int flags = !containsLocalType
            ? SourceTypeConverter.MEMBER_TYPE
            : SourceTypeConverter.FIELD_AND_METHOD | SourceTypeConverter.MEMBER_TYPE | SourceTypeConverter.LOCAL_TYPE;
          parsedUnit =
            SourceTypeConverter.buildCompilationUnit(
              typeInfos,
              flags,
              this.lookupEnvironment.problemReporter,
              result);
          if (containsLocalType)   parsedUnit.bits |= ASTNode.HasAllMethodBodies;
        } else {
          // create parsed unit from file
          IFile file = (IFile) cu.getResource();
          ICompilationUnit sourceUnit = this.builder.createCompilationUnitFromPath(openable, file);
         
          CompilationResult unitResult = new CompilationResult(sourceUnit, i, openablesLength, this.options.maxProblemsPerUnit);
          parsedUnit = parser.dietParse(sourceUnit, unitResult);
        }

        if (parsedUnit != null) {
          hasLocalType[unitsIndex] = containsLocalType;
          cus[unitsIndex] = cu;
          parsedUnits[unitsIndex++] = parsedUnit;
          try {
            this.lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/);
            if (openable.equals(focusOpenable)) {
              focusUnit = parsedUnit;
            }
          } catch (AbortCompilation e) {
            // classpath problem for this type: ignore
          }
        }
      } else {
        // cache binary type binding
        ClassFile classFile = (ClassFile)openable;
        IBinaryType binaryType = null;
        if (classFile.isOpen()) {
          // create binary type from info
          IType type = classFile.getType();
          try {
            binaryType = (IBinaryType)((JavaElement)type).getElementInfo();
          } catch (JavaModelException e) {
            // type exists since class file is opened
          }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IType

    switch (newKind) {
      case IJavaElementDelta.ADDED:
        ArrayList allTypes = new ArrayList();
        getAllTypesFromElement(cu, allTypes);
        for (int i = 0, length = allTypes.size(); i < length; i++) {
          IType type = (IType)allTypes.get(i);
          addTypeAddition(type, (SimpleDelta)this.changes.get(type));
        }
        break;
      case IJavaElementDelta.REMOVED:
        allTypes = new ArrayList();
        getAllTypesFromHierarchy((JavaElement)cu, allTypes);
        for (int i = 0, length = allTypes.size(); i < length; i++) {
          IType type = (IType)allTypes.get(i);
          addTypeRemoval(type, (SimpleDelta)this.changes.get(type));
        }
        break;
      case IJavaElementDelta.CHANGED:
        addAffectedChildren(newDelta);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IType

    switch (newKind) {
      case IJavaElementDelta.ADDED:
        ArrayList allTypes = new ArrayList();
        getAllTypesFromElement(member, allTypes);
        for (int i = 0, length = allTypes.size(); i < length; i++) {
          IType innerType = (IType)allTypes.get(i);
          addTypeAddition(innerType, (SimpleDelta)this.changes.get(innerType));
        }
        break;
      case IJavaElementDelta.REMOVED:
        allTypes = new ArrayList();
        getAllTypesFromHierarchy((JavaElement)member, allTypes);
        for (int i = 0, length = allTypes.size(); i < length; i++) {
          IType type = (IType)allTypes.get(i);
          addTypeRemoval(type, (SimpleDelta)this.changes.get(type));
        }
        break;
      case IJavaElementDelta.CHANGED:
        addAffectedChildren(newDelta);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IType

      case IJavaElementDelta.ADDED:
        addTypeAddition(type, existingDelta);
        ArrayList allTypes = new ArrayList();
        getAllTypesFromElement(type, allTypes);
        for (int i = 0, length = allTypes.size(); i < length; i++) {
          IType innerType = (IType)allTypes.get(i);
          addTypeAddition(innerType, (SimpleDelta)this.changes.get(innerType));
        }
        break;
      case IJavaElementDelta.REMOVED:
        addTypeRemoval(type, existingDelta);
        allTypes = new ArrayList();
        getAllTypesFromHierarchy((JavaElement)type, allTypes);
        for (int i = 0, length = allTypes.size(); i < length; i++) {
          IType innerType = (IType)allTypes.get(i);
          addTypeRemoval(innerType, (SimpleDelta)this.changes.get(innerType));
        }
        break;
      case IJavaElementDelta.CHANGED:
        addTypeChange(type, newDelta.getFlags(), existingDelta);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IType

  private void getAllTypesFromElement(IJavaElement element, ArrayList allTypes) throws JavaModelException {
    switch (element.getElementType()) {
      case IJavaElement.COMPILATION_UNIT:
        IType[] types = ((ICompilationUnit)element).getTypes();
        for (int i = 0, length = types.length; i < length; i++) {
          IType type = types[i];
          allTypes.add(type);
          getAllTypesFromElement(type, allTypes);
        }
        break;
      case IJavaElement.TYPE:
        types = ((IType)element).getTypes();
        for (int i = 0, length = types.length; i < length; i++) {
          IType type = types[i];
          allTypes.add(type);
          getAllTypesFromElement(type, allTypes);
        }
        break;
      case IJavaElement.INITIALIZER:
      case IJavaElement.FIELD:
      case IJavaElement.METHOD:
        IJavaElement[] children = ((IMember)element).getChildren();
        for (int i = 0, length = children.length; i < length; i++) {
          IType type = (IType)children[i];
          allTypes.add(type);
          getAllTypesFromElement(type, allTypes);
        }
        break;
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IType

      case IJavaElement.FIELD:
      case IJavaElement.METHOD:
        types = (ArrayList)this.hierarchy.files.get(((IMember)element).getCompilationUnit());
        if (types != null) {
          for (int i = 0, length = types.size(); i < length; i++) {
            IType type = (IType)types.get(i);
            if (element.isAncestorOf(type)) {
              allTypes.add(type);
            }
          }
        }
View Full Code Here

Examples of org.eclipse.cdt.core.dom.ast.IType

    }
    return new CppToProtobufMapping(bindings.qualifiedNameOf(typeDef), MESSAGE);
  }

  private String typeNameOf(CPPTypedef typeDef) {
    IType type = typeDef.getType();
    if (type instanceof CPPClassType) {
      return ((CPPClassType) type).getName();
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.dltk.core.IType

    if (projectTypes.length != 1) {
      return;
    }

    IType currentType = projectTypes[0];
    ITypeHierarchy hierarchy = this.getCompanion().getSuperTypeHierarchy(type, new NullProgressMonitor());
    IType[] superTypes = hierarchy.getAllSupertypes(currentType);

    List<String> reported = new ArrayList<String>();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.