コード例 #1
0
    private boolean isWrittenInTypeConstructors(ArrayList writes, ITypeBinding declaringClass) {

      for (int i = 0; i < writes.size(); i++) {
        SimpleName name = (SimpleName) writes.get(i);

        MethodDeclaration methodDeclaration = getWritingConstructor(name);
        if (methodDeclaration == null) return false;

        if (!methodDeclaration.isConstructor()) return false;

        IMethodBinding constructor = methodDeclaration.resolveBinding();
        if (constructor == null) return false;

        ITypeBinding declaringClass2 = constructor.getDeclaringClass();
        if (!declaringClass.equals(declaringClass2)) return false;
      }

      return true;
    }
コード例 #2
0
  public static List<ITypeBinding> filterSubtypeExceptions(ITypeBinding[] exceptions) {
    List<ITypeBinding> filteredExceptions = new ArrayList<>();
    filteredExceptions.addAll(Arrays.asList(exceptions));

    for (Iterator<ITypeBinding> subtypeIterator = filteredExceptions.iterator();
        subtypeIterator.hasNext(); ) {
      ITypeBinding iTypeBinding = subtypeIterator.next();
      for (Iterator<ITypeBinding> supertypeIterator = filteredExceptions.iterator();
          supertypeIterator.hasNext(); ) {
        ITypeBinding superTypeBinding = supertypeIterator.next();
        if (!iTypeBinding.equals(superTypeBinding)
            && iTypeBinding.isSubTypeCompatible(superTypeBinding)) {
          subtypeIterator.remove();
          break;
        }
      }
    }
    return filteredExceptions;
  }
コード例 #3
0
ファイル: Types.java プロジェクト: hellojory/j2objc
 public boolean isJavaStringType(ITypeBinding type) {
   return javaStringType.equals(type);
 }
コード例 #4
0
ファイル: Types.java プロジェクト: hellojory/j2objc
 public boolean isJavaObjectType(ITypeBinding type) {
   return javaObjectType.equals(type);
 }