Examples of IBinaryType


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

/**
* @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 = Util.scanClassTypeSignature(genericSignature, index) + 1;
    while (index  < signatureLength) {
      int start = index;
      index = 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

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

/**
* @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

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

/*
* @see IType#isAnonymous()
*/
public boolean isAnonymous() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  return info.isAnonymous();
}
View Full Code Here

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

}
/*
* @see IType#isClass()
*/
public boolean isClass() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  return TypeDeclaration.kind(info.getModifiers()) == TypeDeclaration.CLASS_DECL;

}
View Full Code Here

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

/**
* @see IType#isEnum()
* @since 3.0
*/
public boolean isEnum() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  return TypeDeclaration.kind(info.getModifiers()) == TypeDeclaration.ENUM_DECL;
}
View Full Code Here

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

/*
* @see IType#isInterface()
*/
public boolean isInterface() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  switch (TypeDeclaration.kind(info.getModifiers())) {
    case TypeDeclaration.INTERFACE_DECL:
    case TypeDeclaration.ANNOTATION_TYPE_DECL: // annotation is interface too
      return true;
  }
  return false;
View Full Code Here

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

/**
* @see IType#isAnnotation()
* @since 3.0
*/
public boolean isAnnotation() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  return TypeDeclaration.kind(info.getModifiers()) == TypeDeclaration.ANNOTATION_TYPE_DECL;
}
View Full Code Here

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

/*
* @see IType#isLocal()
*/
public boolean isLocal() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  return info.isLocal();
}
View Full Code Here

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

}
/*
* @see IType#isMember()
*/
public boolean isMember() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  return info.isMember();
}
View Full Code Here

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

*/
Compiler getCompiler(ICompilerRequestor compilerRequestor) {
  Compiler compiler = super.getCompiler(compilerRequestor);
 
  // Initialize the compiler's lookup environment with the already compiled super class
  IBinaryType binaryType = this.context.getRootCodeSnippetBinary();
  if (binaryType != null) {
    compiler.lookupEnvironment.cacheBinaryType(binaryType, null /*no access restriction*/);
  }

  // and the installed global variable classes
  VariablesInfo installedVars = this.context.installedVars;
  if (installedVars != null) {
    ClassFile[] classFiles = 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
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.