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

Examples of org.eclipse.jdt.internal.compiler.env.IBinaryType


        IType type;
        type = classFile.getType();
        if (type == null || !type.isBinary()) {
            return null;
        }
        IBinaryType info = null;
        try {
            info = (IBinaryType) ((BinaryType) type).getElementInfo();
        } catch (JavaModelException e) {
            BytecodeOutlinePlugin.log(e, IStatus.ERROR);
            return null;
View Full Code Here


  };

  CompletionEngine engine = new CompletionEngine(environment, mapper.getCompletionRequestor(requestor), options, project, owner, monitor);

  if (this.installedVars != null) {
    IBinaryType binaryType = getRootCodeSnippetBinary();
    if (binaryType != null) {
      engine.lookupEnvironment.cacheBinaryType(binaryType, null /*no access restriction*/);
    }

    ClassFile[] classFiles = this.installedVars.classFiles;
    for (int i = 0; i < classFiles.length; i++) {
      ClassFile classFile = classFiles[i];
      IBinaryType binary = null;
      try {
        binary = new ClassFileReader(classFile.getBytes(), null);
      } catch (ClassFormatException e) {
        e.printStackTrace(); // Should never happen since we compiled this type
      }
View Full Code Here

          }
        }
      } else {
        // cache binary type binding
        ClassFile classFile = (ClassFile)openable;
        IBinaryType binaryType = (IBinaryType) JavaModelManager.getJavaModelManager().getInfo(classFile.getType());
        if (binaryType == null) {
          // create binary type from file
          if (classFile.getPackageFragmentRoot().isArchive()) {
            binaryType = this.builder.createInfoFromClassFileInJar(classFile);
          } else {
View Full Code Here

  IType type = locator.lookupType(typeBinding);
  if (type == null) return; // case of a secondary type

  IResource resource = type.getResource();
  boolean isBinary = type.isBinary();
  IBinaryType info = null;
  if (isBinary) {
    if (resource == null)
      resource = type.getJavaProject().getProject();
    info = locator.getBinaryInfo((org.eclipse.jdt.internal.core.ClassFile) type.getClassFile(), resource);
  }
View Full Code Here

*
* @see Openable
* @see Signature
*/
protected boolean buildStructure(OpenableElementInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws JavaModelException {
  IBinaryType typeInfo = getBinaryTypeInfo((IFile) underlyingResource);
  if (typeInfo == null) {
    // The structure of a class file is unknown if a class file format errors occurred
    //during the creation of the diet class file representative of this ClassFile.
    info.setChildren(new IJavaElement[] {});
    return false;
View Full Code Here

}
public IBinaryType getBinaryTypeInfo(IFile file, boolean fullyInitialize) throws JavaModelException {
  JavaElement pkg = (JavaElement) getParent();
  if (pkg instanceof JarPackageFragment) {
    try {
      IBinaryType info = getJarBinaryTypeInfo((PackageFragment) pkg, fullyInitialize);
      if (info == null) {
        throw newNotPresentException();
      }
      return info;
    } catch (ClassFormatException cfe) {
View Full Code Here

  // Check the cache for the top-level type first
  IType outerMostEnclosingType = getOuterMostEnclosingType();
  IBuffer buffer = getBufferManager().getBuffer(outerMostEnclosingType.getClassFile());
  if (buffer == null) {
    SourceMapper mapper = getSourceMapper();
    IBinaryType typeInfo = info instanceof IBinaryType ? (IBinaryType) info : null;
    if (mapper != null) {
      buffer = mapSource(mapper, typeInfo, outerMostEnclosingType.getClassFile());
    }
  }
  return buffer;
View Full Code Here

    // if type doesn't exist, no matching method can exist
    return null;
  }
}
public IAnnotation[] getAnnotations() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  IBinaryAnnotation[] binaryAnnotations = info.getAnnotations();
  return getAnnotations(binaryAnnotations, info.getTagBits());
}
View Full Code Here

}
/*
* @see IMember#getFlags()
*/
public int getFlags() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  return info.getModifiers() & ~ClassFileConstants.AccSuper;
}
View Full Code Here

/**
* @see IType#getSuperclassTypeSignature()
* @since 3.0
*/
public String getSuperclassTypeSignature() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  char[] genericSignature = info.getGenericSignature();
  if (genericSignature != null) {
    int signatureLength = genericSignature.length;
    // skip type parameters
    int index = 0;
    if (genericSignature[0] == '<') {
      int count = 1;
      while (count > 0 && ++index < signatureLength) {
        switch (genericSignature[index]) {
          case '<':
            count++;
            break;
          case '>':
            count--;
            break;
        }
      }
      index++;
    }
    int start = index;
    index = org.eclipse.jdt.internal.compiler.util.Util.scanClassTypeSignature(genericSignature, start) + 1;
    char[] superclassSig = CharOperation.subarray(genericSignature, start, index);
    return new String(ClassFile.translatedName(superclassSig));
  } else {
    char[] superclassName = info.getSuperclassName();
    if (superclassName == null) {
      return null;
    }
    return new String(Signature.createTypeSignature(ClassFile.translatedName(superclassName), true));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.env.IBinaryType

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.