Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.IPackageBinding


    }
    return null; // there is no parent;
  }
 
  public boolean visit(PackageDeclaration node) {
    IPackageBinding binding = node.resolveBinding();
   
    if (binding != null) {
      generatePackageDecls(getParent((ISourceLocation) ownValue), (ISourceLocation) ownValue, getParent(loc));
      insert(containment, ownValue, getParent());
    } else {
View Full Code Here


        }
        while (typeBinding != null && !typeBinding.isTopLevel()) {
            typeBinding= typeBinding.getDeclaringClass();
        }
        if (typeBinding != null) {
            IPackageBinding pack= typeBinding.getPackage();
            String packageName= pack.isUnnamed() ? "" : pack.getName(); //$NON-NLS-1$
            IType type= project.findType(packageName, typeBinding.getName());
            if (type != null) {
                return type.getCompilationUnit();
            }
        }
View Full Code Here

    return new InterfaceInfoPojo(this);
  }

  @Override
  public PackageInfo getPackageInfo() {
    IPackageBinding thePackage = binding.getPackage();
    return IPackageBindingWrapper.wrapperOf(thePackage)
        .toPackageInfo();
  }
View Full Code Here

  Optional<PackageInfo> getPackageInfo() {
    Optional<PackageInfo> res = super.getPackageInfo();

    ITypeBinding binding = type.resolveBinding();
    if (binding != null) {
      IPackageBinding pkg = binding.getPackage();
      PackageInfo packageInfo = IPackageBindingWrapper.wrapperOf(pkg)
          .toPackageInfo();
      res = Optional.of(packageInfo);
    }
View Full Code Here

    super(binding);
  }

  @Override
  Optional<PackageInfo> getPackageInfo() {
    IPackageBinding pkg = binding.getPackage();
    PackageInfo packageInfo = IPackageBindingWrapper.wrapperOf(pkg)
        .toPackageInfo();
    return Optional.of(packageInfo);
  }
View Full Code Here

   
    // Last test is with an annotation value
    IAnnotationBinding annoBinding = createMock(IAnnotationBinding.class);
    ITypeBinding annoTypeBinding = createMock(ITypeBinding.class);
    IMemberValuePairBinding memberValuePairBinding = createMock(IMemberValuePairBinding.class);
    IPackageBinding packageBinding = createMock(IPackageBinding.class);
   
    expect(binding.getQualifiedName()).andReturn("de.supertest.TestClass");
    expect(binding.getAnnotations()).andReturn(new IAnnotationBinding[] {annoBinding});
    expect(annoBinding.getAnnotationType()).andReturn(annoTypeBinding);
    expect(annoTypeBinding.getQualifiedName()).andReturn(BelongsToComponent.class.getCanonicalName());
    expect(annoBinding.getAllMemberValuePairs()).andReturn(new IMemberValuePairBinding[]
                             { memberValuePairBinding });
    expect(memberValuePairBinding.getName()).andReturn("value");
    expect(memberValuePairBinding.getValue()).andReturn("Comp1");
   
    expect(binding.getName()).andReturn("TestClass");
    expect(binding.getPackage()).andReturn(packageBinding);
    expect(packageBinding.getName()).andReturn("de.supertest");
    expect(binding.getAnnotations()).andReturn(new IAnnotationBinding[] {}).anyTimes();
   
    replay(binding, annoBinding, annoTypeBinding, memberValuePairBinding);
    assertEquals("Comp1", mappingHelper.getComponentName(binding));
  }
View Full Code Here

      // DirectAction.Action()
      boolean isDirectAction = declaredClassBinding.getName().equals("DirectAction");
      skip = skip || (isDirectAction && (binding.getName().endsWith("Action") || binding.getName().equals("performActionNamed")));

      // app || logic && Constructor
      IPackageBinding packageBinding = declaredClassBinding.getPackage();
      String[] comps = packageBinding.getNameComponents();
      if (comps.length > 0) {
        String comp = comps[comps.length - 1];
        skip = skip || ((comp.equals("app") || comp.equals("logic")) && binding.isConstructor());
      }
View Full Code Here

    if(!typeBinding.isClass()){
      throw new IllegalArgumentException(
          Services.getMessage("type.not.a.class", typeBinding.getQualifiedName()));
    }

    IPackageBinding packageBinding = typeBinding.getPackage();
    IMethodBinding[] methods =
      StubUtility2.getOverridableMethods(cu.getAST(), typeBinding, false);
    ArrayList<IMethodBinding> overridable = new ArrayList<IMethodBinding>();
    for (IMethodBinding methodBinding : methods) {
      if (Bindings.isVisibleInHierarchy(methodBinding, packageBinding)){
View Full Code Here

    return prefix + "fwd-" + project + ".hpp";
  }

  public static String qualifiedName(ITypeBinding tb) {
    IPackageBinding pkg = elementPackage(tb);
    return pkg == null || pkg.getName().isEmpty() ? CName.of(tb) : (CName
        .of(pkg) + "." + CName.of(tb));
  }
View Full Code Here

      INSTANCE_INIT, STATIC_INIT, GET_CLASS, DEFAULT_INIT_TAG, JAVA_CAST,
      "int8_t", "int16_t", "int32_t", "int64_t", "char16_t", "NULL",
      "npc", "EOF");

  public static String qualified(ITypeBinding tb, boolean global) {
    IPackageBinding pkg = TransformUtil.elementPackage(tb);
    return (global && !tb.isPrimitive() ? "::" : "")
        + (pkg == null || pkg.getName().isEmpty() ? of(tb) : (of(pkg)
            + "." + of(tb))).replace(".", "::");
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.IPackageBinding

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.