Package org.aspectj.org.eclipse.jdt.internal.compiler.env

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.ISourceType


  if (progressMonitor != null && progressMonitor.isCanceled())
    throw new OperationCanceledException();
 
  // find most enclosing type first (needed when explicit askForType(...) is done
  // with a member type (e.g. p.A$B))
  ISourceType sourceType = sourceTypes[0];
  while (sourceType.getEnclosingType() != null)
    sourceType = sourceType.getEnclosingType();
 
  // build corresponding compilation unit
  CompilationResult result = new CompilationResult(sourceType.getFileName(), 1, 1, this.options.maxProblemsPerUnit);
  CompilationUnitDeclaration unit =
    SourceTypeConverter.buildCompilationUnit(
      new ISourceType[] {sourceType}, // ignore secondary types, to improve laziness
      SourceTypeConverter.MEMBER_TYPE, // need member types
      // no need for field initialization
View Full Code Here


  char separator;
  if (type instanceof IBinaryType) {
    superInterfaceNames = ((IBinaryType)type).getInterfaceNames();
    separator = '/';
  } else if (type instanceof ISourceType) {
    ISourceType sourceType = (ISourceType)type;
    if (sourceType.getName().length == 0) { // if anonymous type
      if (typeBinding.superInterfaces() != null && typeBinding.superInterfaces().length > 0) {
        superInterfaceNames = new char[][] {sourceType.getSuperclassName()};
      } else {
        superInterfaceNames = sourceType.getInterfaceNames();
      }
    } else {
      if (TypeDeclaration.kind(sourceType.getModifiers()) == TypeDeclaration.ANNOTATION_TYPE_DECL)
        superInterfaceNames = new char[][] {TypeConstants.CharArray_JAVA_LANG_ANNOTATION_ANNOTATION};
      else
        superInterfaceNames = sourceType.getInterfaceNames();
    }
    separator = '.';
  } else if (type instanceof HierarchyType) {
    HierarchyType hierarchyType = (HierarchyType)type;
    if (hierarchyType.name.length == 0) { // if anonymous type
View Full Code Here

}
/**
* @see IType#resolveType(String, WorkingCopyOwner)
*/
public String[][] resolveType(String typeName, WorkingCopyOwner owner) throws JavaModelException {
  ISourceType info = (ISourceType) getElementInfo();
  JavaProject project = (JavaProject) getJavaProject();
  SearchableEnvironment environment = project.newSearchableNameEnvironment(owner);

  class TypeResolveRequestor implements ISelectionRequestor {
    String[][] answers = null;
View Full Code Here

        }
      } else { //SourceType
        try {
          // retrieve the requested type
          SourceTypeElementInfo sourceType = (SourceTypeElementInfo)((SourceType) answer.type).getElementInfo();
          ISourceType topLevelType = sourceType;
          while (topLevelType.getEnclosingType() != null) {
            topLevelType = topLevelType.getEnclosingType();
          }
          // find all siblings (other types declared in same unit, since may be used for name resolution)
          IType[] types = sourceType.getHandle().getCompilationUnit().getTypes();
          ISourceType[] sourceTypes = new ISourceType[types.length];
 
          // in the resulting collection, ensure the requested type is the first one
          sourceTypes[0] = sourceType;
          int length = types.length;
          for (int i = 0, index = 1; i < length; i++) {
            ISourceType otherType =
              (ISourceType) ((JavaElement) types[i]).getElementInfo();
            if (!otherType.equals(topLevelType) && index < length) // check that the index is in bounds (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=62861)
              sourceTypes[index++] = otherType;
          }
          return new NameEnvironmentAnswer(sourceTypes, answer.restriction);
        } catch (JavaModelException npe) {
          return null;
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.env.ISourceType

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.