Package org.eclipse.jdt.internal.compiler.lookup

Examples of org.eclipse.jdt.internal.compiler.lookup.PackageBinding


  // receiverType can be an array binding in one case... see if you can change it
  if (receiverType instanceof ArrayBinding)
    return false;
  ReferenceBinding type = (ReferenceBinding) receiverType;
  PackageBinding declaringPackage = fieldBinding.declaringClass.fPackage;
  TypeBinding originalDeclaringClass = fieldBinding.declaringClass .original();
  do {
    if (type.isCapture()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=285002
      if (originalDeclaringClass == type.erasure().original()) return true
    } else {
View Full Code Here


  // receiverType can be an array binding in one case... see if you can change it
  if (receiverType instanceof ArrayBinding)
    return false;
  ReferenceBinding type = (ReferenceBinding) receiverType;
  PackageBinding declaringPackage = methodBinding.declaringClass.fPackage;
  TypeBinding originalDeclaringClass = methodBinding.declaringClass .original();
  do {
    if (type.isCapture()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=285002
      if (originalDeclaringClass == type.erasure().original()) return true;
    } else {
View Full Code Here

    return binding;

  int length = compoundName.length;
  int currentIndex = 1;
  foundType: if (binding instanceof PackageBinding) {
    PackageBinding packageBinding = (PackageBinding) binding;

    while (currentIndex < length) {
      binding = packageBinding.getTypeOrPackage(compoundName[currentIndex++]);
      invocationSite.setFieldIndex(currentIndex);
       if (binding == null) {
         if (currentIndex == length) // must be a type if its the last name, otherwise we have no idea if its a package or type
          return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), null, ProblemReasons.NotFound);
        else
View Full Code Here

public int size() {
  return this.elementSize;
}
public String toString() {
  String s = ""; //$NON-NLS-1$
  PackageBinding pkg;
  for (int i = 0, length = this.valueTable.length; i < length; i++)
    if ((pkg = this.valueTable[i]) != null)
      s += pkg.toString() + "\n"; //$NON-NLS-1$
  return s;
}
View Full Code Here

  @Override
  PackageElement getPackage()
  {
    if (_binding instanceof FieldBinding) {
      PackageBinding pkgBinding = ((FieldBinding)_binding).declaringClass.fPackage;
      return _env.getFactory().newPackageElement(pkgBinding);
    }
    else {
      // TODO: what is the package of a method parameter?
      throw new UnsupportedOperationException("NYI: VariableElmentImpl.getPackage() for method parameter"); //$NON-NLS-1$
View Full Code Here

        }
        break;
      case PACKAGE :
        // might need to handle javadoc of package-info.java file
        PackageElementImpl packageElementImpl = (PackageElementImpl) e;
        PackageBinding packageBinding = (PackageBinding) packageElementImpl._binding;
        char[][] compoundName = CharOperation.arrayConcat(packageBinding.compoundName, TypeConstants.PACKAGE_INFO_NAME);
        ReferenceBinding type = this._env.getLookupEnvironment().getType(compoundName);
        if (type != null && type.isValidBinding() && (type instanceof SourceTypeBinding)) {
          SourceTypeBinding sourceTypeBinding = (SourceTypeBinding) type;
          referenceContext = sourceTypeBinding.scope.referenceContext;
View Full Code Here

    LookupEnvironment le = _env.getLookupEnvironment();
    if (name.length() == 0) {
      return new PackageElementImpl(_env, le.defaultPackage);
    }
    char[] packageName = name.toString().toCharArray();
    PackageBinding packageBinding = le.createPackage(CharOperation.splitOn('.', packageName));
    if (packageBinding == null) {
      return null;
    }
    return new PackageElementImpl(_env, packageBinding);
  }
View Full Code Here

  }

  @Override
  protected AnnotationBinding[] getAnnotationBindings()
  {
    PackageBinding packageBinding = (PackageBinding) this._binding;
    char[][] compoundName = CharOperation.arrayConcat(packageBinding.compoundName, TypeConstants.PACKAGE_INFO_NAME);
    ReferenceBinding type = this._env.getLookupEnvironment().getType(compoundName);
    AnnotationBinding[] annotations = null;
    if (type != null && type.isValidBinding()) {
      annotations = type.getAnnotations();
View Full Code Here

    return annotations;
  }

  @Override
  public List<? extends Element> getEnclosedElements() {
    PackageBinding binding = (PackageBinding)_binding;
    LookupEnvironment environment = binding.environment;
    char[][][] typeNames = null;
    INameEnvironment nameEnvironment = binding.environment.nameEnvironment;
    if (nameEnvironment instanceof FileSystem) {
      typeNames = ((FileSystem) nameEnvironment).findTypeNames(binding.compoundName);
View Full Code Here

    return new NameImpl(CharOperation.concatWith(((PackageBinding)_binding).compoundName, '.'));
  }

  @Override
  public boolean isUnnamed() {
    PackageBinding binding = (PackageBinding)_binding;
    return binding.compoundName == CharOperation.NO_CHAR_CHAR;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.lookup.PackageBinding

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.