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

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


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

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

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

}
View Full Code Here

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

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

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

/*
* @see IType#isLocal()
*/
public boolean isLocal() throws JavaModelException {
  IBinaryType info = (IBinaryType) getElementInfo();
  return info.isLocal();
}
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.