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

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


  IPackageFragmentRoot root = classFile.getPackageFragmentRoot();
  IPath path = root.getPath();
  // take the OS path for external jars, and the forward slash path for internal jars
  String rootPath = path.getDevice() == null ? path.toString() : path.toOSString();
  String documentPath = rootPath + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + filePath;
  IBinaryType binaryType = (IBinaryType)this.binariesFromIndexMatches.get(documentPath);
  if (binaryType != null) {
    this.infoToHandle.put(binaryType, classFile);
    return binaryType;
  } else {
    return super.createInfoFromClassFileInJar(classFile);
View Full Code Here


  /**
* Creates the type info from the given class file on disk and
* adds it to the given list of infos.
*/
protected IBinaryType createInfoFromClassFile(Openable handle, IResource file) {
  IBinaryType info = null;
  try {
    info = Util.newClassFileReader(file);
  } catch (org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException e) {
    if (TypeHierarchy.DEBUG) {
      e.printStackTrace();
View Full Code Here

* Create a type info from the given class file in a jar and adds it to the given list of infos.
*/
protected IBinaryType createInfoFromClassFileInJar(Openable classFile) {
  PackageFragment pkg = (PackageFragment) classFile.getParent();
  String classFilePath = Util.concatWith(pkg.names, classFile.getElementName(), '/');
  IBinaryType info = null;
  java.util.zip.ZipFile zipFile = null;
  try {
    zipFile = ((JarPackageFragmentRoot)pkg.getParent()).getJar();
    info = org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.read(
      zipFile,
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

/*
* @see IType#getSuperclassName()
*/
public String getSuperclassName() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  char[] superclassName = info.getSuperclassName();
  if (superclassName == null) {
    return null;
  }
  return new String(ClassFile.translatedName(superclassName));
}
View Full Code Here

}
/*
* @see IType#getSuperInterfaceNames()
*/
public String[] getSuperInterfaceNames() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  char[][] names= info.getInterfaceNames();
  int length;
  if (names == null || (length = names.length) == 0) {
    return CharOperation.NO_STRINGS;
  }
  names= ClassFile.translatedNames(names);
View Full Code Here

/**
* @see IType#getSuperInterfaceTypeSignatures()
* @since 3.0
*/
public String[] getSuperInterfaceTypeSignatures() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  char[] genericSignature = info.getGenericSignature();
  if (genericSignature != null) {
    ArrayList interfaces = new ArrayList();
    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++;
    }
    // skip superclass
    index = org.eclipse.jdt.internal.compiler.util.Util.scanClassTypeSignature(genericSignature, index) + 1;
    while (index  < signatureLength) {
      int start = index;
      index = org.eclipse.jdt.internal.compiler.util.Util.scanClassTypeSignature(genericSignature, start) + 1;
      char[] interfaceSig = CharOperation.subarray(genericSignature, start, index);
      interfaces.add(new String(ClassFile.translatedName(interfaceSig)));
    }
    int size = interfaces.size();
    String[] result = new String[size];
    interfaces.toArray(result);
    return result;
  } else {
    char[][] names= info.getInterfaceNames();
    int length;
    if (names == null || (length = names.length) == 0) {
      return CharOperation.NO_STRINGS;
    }
    names= ClassFile.translatedNames(names);
View Full Code Here

/**
* @see IType#getTypeParameterSignatures()
* @since 3.0
*/
public String[] getTypeParameterSignatures() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  char[] genericSignature = info.getGenericSignature();
  if (genericSignature == null)
    return CharOperation.NO_STRINGS;

  char[] dotBaseSignature = CharOperation.replaceOnCopy(genericSignature, '/', '.');
  char[][] typeParams = Signature.getTypeParameters(dotBaseSignature);
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.