Package org.aspectj.org.eclipse.jdt.core

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


    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

      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

  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

      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

    }
  }
 
  private boolean hasSuperTypeChange(IType type) throws JavaModelException {
    // check super class
    IType superclass = this.hierarchy.getSuperclass(type);
    String existingSuperclassName = superclass == null ? null : superclass.getElementName();
    String newSuperclassName = type.getSuperclassName();
    if (existingSuperclassName != null && !existingSuperclassName.equals(newSuperclassName)) {
      return true;
    }
   
View Full Code Here

  public void complete(IType type, char[] snippet, int position, char[][] localVariableTypeNames, char[][] localVariableNames, int[] localVariableModifiers, boolean isStatic){ 
    if(this.requestor != null){
      this.requestor.beginReporting();
    }
    boolean contextAccepted = false;
    IType topLevelType = type;
    while(topLevelType.getDeclaringType() != null) {
      topLevelType = topLevelType.getDeclaringType();
    }
   
    this.fileName = topLevelType.getParent().getElementName().toCharArray();
    CompilationResult compilationResult = new CompilationResult(this.fileName, 1, 1, this.compilerOptions.maxProblemsPerUnit);
 
    CompilationUnitDeclaration compilationUnit = null;
 
    try {
View Full Code Here

          this.typeCache.put(compoundName, sourceType);
        }
      }
     
      if(sourceType != null) {
        IType typeHandle = ((SourceTypeElementInfo) sourceType).getHandle();
       
        String[] parameterTypeSignatures = new String[length];
        for (int i = 0; i < length; i++) {
          parameterTypeSignatures[i] = Signature.createTypeSignature(parameterTypeNames[i], false);
        }
        IMethod searchedMethod = typeHandle.getMethod(String.valueOf(method.selector), parameterTypeSignatures);
        IMethod[] foundMethods = typeHandle.findMethods(searchedMethod);
       
        if(foundMethods != null) {
          int len = foundMethods.length;
          if(len == 1) {
            try {
View Full Code Here

  public HierarchyBuilder(TypeHierarchy hierarchy) throws JavaModelException {
   
    this.hierarchy = hierarchy;
    JavaProject project = (JavaProject) hierarchy.javaProject();
   
    IType focusType = hierarchy.getType();
    org.aspectj.org.eclipse.jdt.core.ICompilationUnit unitToLookInside = focusType == null ? null : focusType.getCompilationUnit();
    org.aspectj.org.eclipse.jdt.core.ICompilationUnit[] workingCopies = this.hierarchy.workingCopies;
    org.aspectj.org.eclipse.jdt.core.ICompilationUnit[] unitsToLookInside;
    if (unitToLookInside != null) {
      int wcLength = workingCopies == null ? 0 : workingCopies.length;
      if (wcLength == 0) {
        unitsToLookInside = new org.aspectj.org.eclipse.jdt.core.ICompilationUnit[] {unitToLookInside};
      } else {
        unitsToLookInside = new org.aspectj.org.eclipse.jdt.core.ICompilationUnit[wcLength+1];
        unitsToLookInside[0] = unitToLookInside;
        System.arraycopy(workingCopies, 0, unitsToLookInside, 1, wcLength);
      }
    } else {
      unitsToLookInside = workingCopies;
    }
    if (project != null) {
      SearchableEnvironment searchableEnvironment = project.newSearchableNameEnvironment(unitsToLookInside);
      this.nameLookup = searchableEnvironment.nameLookup;
      this.hierarchyResolver =
        new HierarchyResolver(
          searchableEnvironment,
          project.getOptions(true),
          this,
          new DefaultProblemFactory());
    }
    this.infoToHandle = new HashMap(5);
    this.focusQualifiedName = focusType == null ? null : focusType.getFullyQualifiedName();
  }
View Full Code Here

    throws JavaModelException, CoreException;
  /**
   * Configure this type hierarchy by computing the supertypes only.
   */
  protected void buildSupertypes() {
    IType focusType = this.getType();
    if (focusType == null)
      return;
    // get generic type from focus type
    IGenericType type;
    try {
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.core.IType

Copyright © 2018 www.massapicom. 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.