com.apple.internal.jobjc.generator.model.Clazz Java Examples

The following examples show how to use com.apple.internal.jobjc.generator.model.Clazz. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClassConsolidator.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void addCategoriesAndPatchClasses(final List<Clazz> clazzes, final Clazz clazz) {
    final List<String> fwNames = new ArrayList<String>(clazzes.size());

    for (final Clazz cls : clazzes) {
        if (cls == clazz) continue;
        fwNames.add(cls.parent.name);
        cls.parent.classes.remove(cls);
        cls.parent.categories.add(new Category(cls, clazz));
    }

    System.out.println("creating categories in: " + Utils.joinWComma(fwNames));
}
 
Example #2
Source File: MethodDisambiguator.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static void disambiguateMethodNames() {
    // link all subclassers off their parents
    for (final Clazz clazz : TypeCache.inst().getAllClasses()) {
        final Clazz superClazz = clazz.superClass;
        if (superClazz != null) superClazz.subClassers.add(clazz);
    }

    // recursively call all subclassers, starting from NSObject on down
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSObject"));

    // NSProxy does not appear to subclass from NSObject, but it is still a real full class...?
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSProxy"));
}
 
Example #3
Source File: MethodDisambiguator.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
static void disambiguateMethodNames() {
    // link all subclassers off their parents
    for (final Clazz clazz : TypeCache.inst().getAllClasses()) {
        final Clazz superClazz = clazz.superClass;
        if (superClazz != null) superClazz.subClassers.add(clazz);
    }

    // recursively call all subclassers, starting from NSObject on down
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSObject"));

    // NSProxy does not appear to subclass from NSObject, but it is still a real full class...?
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSProxy"));
}
 
Example #4
Source File: MethodDisambiguator.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
static void disambiguateMethodNames() {
    // link all subclassers off their parents
    for (final Clazz clazz : TypeCache.inst().getAllClasses()) {
        final Clazz superClazz = clazz.superClass;
        if (superClazz != null) superClazz.subClassers.add(clazz);
    }

    // recursively call all subclassers, starting from NSObject on down
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSObject"));

    // NSProxy does not appear to subclass from NSObject, but it is still a real full class...?
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSProxy"));
}
 
Example #5
Source File: MethodDisambiguator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static void disambiguateMethodNames() {
    // link all subclassers off their parents
    for (final Clazz clazz : TypeCache.inst().getAllClasses()) {
        final Clazz superClazz = clazz.superClass;
        if (superClazz != null) superClazz.subClassers.add(clazz);
    }

    // recursively call all subclassers, starting from NSObject on down
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSObject"));

    // NSProxy does not appear to subclass from NSObject, but it is still a real full class...?
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSProxy"));
}
 
Example #6
Source File: SuperClassExtractor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static Clazz getSuperClassFor(final String className, final MacOSXFramework nativeFramework, final Map<String, Clazz> allClasses) throws Throwable {
    final NSClass<ID> nativeClass = new NSClass<ID>(className, nativeFramework.getRuntime());
    final NSClass<? extends ID> nativeSuperClass = UnsafeRuntimeAccess.getSuperClass(nativeClass);
    final String superClassName = UnsafeRuntimeAccess.getClassNameFor(nativeSuperClass);
    if ("nil".equals(superClassName)) return null;

    final Clazz superClazz = allClasses.get(superClassName);
    if (superClazz != null) return superClazz;

    final Clazz superClazzX = getSuperClassFor(superClassName, nativeFramework, allClasses);
    System.out.print("[Warning] class \"" + superClassName + "\" not found in bridge support files, ");
    System.out.println("using \"" + superClazzX.name + "\" as superclass for \"" + className + "\"");
    return superClazzX;
}
 
Example #7
Source File: ClassConsolidator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void addCategoriesAndPatchClasses(final List<Clazz> clazzes, final Clazz clazz) {
    final List<String> fwNames = new ArrayList<String>(clazzes.size());

    for (final Clazz cls : clazzes) {
        if (cls == clazz) continue;
        fwNames.add(cls.parent.name);
        cls.parent.classes.remove(cls);
        cls.parent.categories.add(new Category(cls, clazz));
    }

    System.out.println("creating categories in: " + Utils.joinWComma(fwNames));
}
 
Example #8
Source File: SuperClassExtractor.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static Clazz getSuperClassFor(final String className, final MacOSXFramework nativeFramework, final Map<String, Clazz> allClasses) throws Throwable {
    final NSClass<ID> nativeClass = new NSClass<ID>(className, nativeFramework.getRuntime());
    final NSClass<? extends ID> nativeSuperClass = UnsafeRuntimeAccess.getSuperClass(nativeClass);
    final String superClassName = UnsafeRuntimeAccess.getClassNameFor(nativeSuperClass);
    if ("nil".equals(superClassName)) return null;

    final Clazz superClazz = allClasses.get(superClassName);
    if (superClazz != null) return superClazz;

    final Clazz superClazzX = getSuperClassFor(superClassName, nativeFramework, allClasses);
    System.out.print("[Warning] class \"" + superClassName + "\" not found in bridge support files, ");
    System.out.println("using \"" + superClazzX.name + "\" as superclass for \"" + className + "\"");
    return superClazzX;
}
 
Example #9
Source File: ClassConsolidator.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void addCategoriesAndPatchClasses(final List<Clazz> clazzes, final Clazz clazz) {
    final List<String> fwNames = new ArrayList<String>(clazzes.size());

    for (final Clazz cls : clazzes) {
        if (cls == clazz) continue;
        fwNames.add(cls.parent.name);
        cls.parent.classes.remove(cls);
        cls.parent.categories.add(new Category(cls, clazz));
    }

    System.out.println("creating categories in: " + Utils.joinWComma(fwNames));
}
 
Example #10
Source File: MethodDisambiguator.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static void disambiguateMethodNames() {
    // link all subclassers off their parents
    for (final Clazz clazz : TypeCache.inst().getAllClasses()) {
        final Clazz superClazz = clazz.superClass;
        if (superClazz != null) superClazz.subClassers.add(clazz);
    }

    // recursively call all subclassers, starting from NSObject on down
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSObject"));

    // NSProxy does not appear to subclass from NSObject, but it is still a real full class...?
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSProxy"));
}
 
Example #11
Source File: SuperClassExtractor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static Clazz getSuperClassFor(final String className, final MacOSXFramework nativeFramework, final Map<String, Clazz> allClasses) throws Throwable {
    final NSClass<ID> nativeClass = new NSClass<ID>(className, nativeFramework.getRuntime());
    final NSClass<? extends ID> nativeSuperClass = UnsafeRuntimeAccess.getSuperClass(nativeClass);
    final String superClassName = UnsafeRuntimeAccess.getClassNameFor(nativeSuperClass);
    if ("nil".equals(superClassName)) return null;

    final Clazz superClazz = allClasses.get(superClassName);
    if (superClazz != null) return superClazz;

    final Clazz superClazzX = getSuperClassFor(superClassName, nativeFramework, allClasses);
    System.out.print("[Warning] class \"" + superClassName + "\" not found in bridge support files, ");
    System.out.println("using \"" + superClazzX.name + "\" as superclass for \"" + className + "\"");
    return superClazzX;
}
 
Example #12
Source File: SuperClassExtractor.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static Clazz getSuperClassFor(final String className, final MacOSXFramework nativeFramework, final Map<String, Clazz> allClasses) throws Throwable {
    final NSClass<ID> nativeClass = new NSClass<ID>(className, nativeFramework.getRuntime());
    final NSClass<? extends ID> nativeSuperClass = UnsafeRuntimeAccess.getSuperClass(nativeClass);
    final String superClassName = UnsafeRuntimeAccess.getClassNameFor(nativeSuperClass);
    if ("nil".equals(superClassName)) return null;

    final Clazz superClazz = allClasses.get(superClassName);
    if (superClazz != null) return superClazz;

    final Clazz superClazzX = getSuperClassFor(superClassName, nativeFramework, allClasses);
    System.out.print("[Warning] class \"" + superClassName + "\" not found in bridge support files, ");
    System.out.println("using \"" + superClazzX.name + "\" as superclass for \"" + className + "\"");
    return superClazzX;
}
 
Example #13
Source File: ClassConsolidator.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void addCategoriesAndPatchClasses(final List<Clazz> clazzes, final Clazz clazz) {
    final List<String> fwNames = new ArrayList<String>(clazzes.size());

    for (final Clazz cls : clazzes) {
        if (cls == clazz) continue;
        fwNames.add(cls.parent.name);
        cls.parent.classes.remove(cls);
        cls.parent.categories.add(new Category(cls, clazz));
    }

    System.out.println("creating categories in: " + Utils.joinWComma(fwNames));
}
 
Example #14
Source File: ClassConsolidator.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void addCategoriesAndPatchClasses(final List<Clazz> clazzes, final Clazz clazz) {
    final List<String> fwNames = new ArrayList<String>(clazzes.size());

    for (final Clazz cls : clazzes) {
        if (cls == clazz) continue;
        fwNames.add(cls.parent.name);
        cls.parent.classes.remove(cls);
        cls.parent.categories.add(new Category(cls, clazz));
    }

    System.out.println("creating categories in: " + Utils.joinWComma(fwNames));
}
 
Example #15
Source File: MethodDisambiguator.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
static void disambiguateMethodNames() {
    // link all subclassers off their parents
    for (final Clazz clazz : TypeCache.inst().getAllClasses()) {
        final Clazz superClazz = clazz.superClass;
        if (superClazz != null) superClazz.subClassers.add(clazz);
    }

    // recursively call all subclassers, starting from NSObject on down
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSObject"));

    // NSProxy does not appear to subclass from NSObject, but it is still a real full class...?
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSProxy"));
}
 
Example #16
Source File: MethodDisambiguator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static void disambiguateMethodNames() {
    // link all subclassers off their parents
    for (final Clazz clazz : TypeCache.inst().getAllClasses()) {
        final Clazz superClazz = clazz.superClass;
        if (superClazz != null) superClazz.subClassers.add(clazz);
    }

    // recursively call all subclassers, starting from NSObject on down
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSObject"));

    // NSProxy does not appear to subclass from NSObject, but it is still a real full class...?
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSProxy"));
}
 
Example #17
Source File: SuperClassExtractor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static Clazz getSuperClassFor(final String className, final MacOSXFramework nativeFramework, final Map<String, Clazz> allClasses) throws Throwable {
    final NSClass<ID> nativeClass = new NSClass<ID>(className, nativeFramework.getRuntime());
    final NSClass<? extends ID> nativeSuperClass = UnsafeRuntimeAccess.getSuperClass(nativeClass);
    final String superClassName = UnsafeRuntimeAccess.getClassNameFor(nativeSuperClass);
    if ("nil".equals(superClassName)) return null;

    final Clazz superClazz = allClasses.get(superClassName);
    if (superClazz != null) return superClazz;

    final Clazz superClazzX = getSuperClassFor(superClassName, nativeFramework, allClasses);
    System.out.print("[Warning] class \"" + superClassName + "\" not found in bridge support files, ");
    System.out.println("using \"" + superClazzX.name + "\" as superclass for \"" + className + "\"");
    return superClazzX;
}
 
Example #18
Source File: SuperClassExtractor.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static Clazz getSuperClassFor(final String className, final MacOSXFramework nativeFramework, final Map<String, Clazz> allClasses) throws Throwable {
    final NSClass<ID> nativeClass = new NSClass<ID>(className, nativeFramework.getRuntime());
    final NSClass<? extends ID> nativeSuperClass = UnsafeRuntimeAccess.getSuperClass(nativeClass);
    final String superClassName = UnsafeRuntimeAccess.getClassNameFor(nativeSuperClass);
    if ("nil".equals(superClassName)) return null;

    final Clazz superClazz = allClasses.get(superClassName);
    if (superClazz != null) return superClazz;

    final Clazz superClazzX = getSuperClassFor(superClassName, nativeFramework, allClasses);
    System.out.print("[Warning] class \"" + superClassName + "\" not found in bridge support files, ");
    System.out.println("using \"" + superClazzX.name + "\" as superclass for \"" + className + "\"");
    return superClazzX;
}
 
Example #19
Source File: MethodDisambiguator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static void disambiguateMethodNames() {
    // link all subclassers off their parents
    for (final Clazz clazz : TypeCache.inst().getAllClasses()) {
        final Clazz superClazz = clazz.superClass;
        if (superClazz != null) superClazz.subClassers.add(clazz);
    }

    // recursively call all subclassers, starting from NSObject on down
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSObject"));

    // NSProxy does not appear to subclass from NSObject, but it is still a real full class...?
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSProxy"));
}
 
Example #20
Source File: ClassConsolidator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static void addCategoriesAndPatchClasses(final List<Clazz> clazzes, final Clazz clazz) {
    final List<String> fwNames = new ArrayList<String>(clazzes.size());

    for (final Clazz cls : clazzes) {
        if (cls == clazz) continue;
        fwNames.add(cls.parent.name);
        cls.parent.classes.remove(cls);
        cls.parent.categories.add(new Category(cls, clazz));
    }

    System.out.println("creating categories in: " + Utils.joinWComma(fwNames));
}
 
Example #21
Source File: MethodDisambiguator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static void disambiguateMethodNames() {
    // link all subclassers off their parents
    for (final Clazz clazz : TypeCache.inst().getAllClasses()) {
        final Clazz superClazz = clazz.superClass;
        if (superClazz != null) superClazz.subClassers.add(clazz);
    }

    // recursively call all subclassers, starting from NSObject on down
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSObject"));

    // NSProxy does not appear to subclass from NSObject, but it is still a real full class...?
    disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSProxy"));
}
 
Example #22
Source File: SuperClassExtractor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static Clazz getSuperClassFor(final String className, final MacOSXFramework nativeFramework, final Map<String, Clazz> allClasses) throws Throwable {
    final NSClass<ID> nativeClass = new NSClass<ID>(className, nativeFramework.getRuntime());
    final NSClass<? extends ID> nativeSuperClass = UnsafeRuntimeAccess.getSuperClass(nativeClass);
    final String superClassName = UnsafeRuntimeAccess.getClassNameFor(nativeSuperClass);
    if ("nil".equals(superClassName)) return null;

    final Clazz superClazz = allClasses.get(superClassName);
    if (superClazz != null) return superClazz;

    final Clazz superClazzX = getSuperClassFor(superClassName, nativeFramework, allClasses);
    System.out.print("[Warning] class \"" + superClassName + "\" not found in bridge support files, ");
    System.out.println("using \"" + superClazzX.name + "\" as superclass for \"" + className + "\"");
    return superClazzX;
}
 
Example #23
Source File: JType.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public JObject(final Type type, final Clazz clazz) {
    this.type = type;
    this.clazz = clazz;
}
 
Example #24
Source File: JObjCClassFile.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public JObjCClassFile(final Clazz clazz) {
    super(clazz, clazz.name,
            clazz.superClass == null ? "com.apple.jobjc.ID"
                    : clazz.superClass.getFullPath());
}
 
Example #25
Source File: JObjCClassFile.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public JObjCClassFile(final Clazz clazz) {
    super(clazz, clazz.name,
            clazz.superClass == null ? "com.apple.jobjc.ID"
                    : clazz.superClass.getFullPath());
}
 
Example #26
Source File: JObjCClassClassFile.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public JObjCClassClassFile(final Clazz clazz) {
    super(clazz, clazz.name + "Class", clazz.superClass != null ? clazz.superClass.getFullPath() + "Class" : ClassGenerator.JOBJC_PACKAGE + ".NSClass<" + clazz.name + ">");
}
 
Example #27
Source File: AbstractObjCClassFile.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public AbstractObjCClassFile(final Clazz clazz, final String classname, final String genericArgs, final String superClass) {
    super(clazz.getPackage(), classname, genericArgs, superClass);
    this.clazz = clazz;
}
 
Example #28
Source File: MethodDisambiguator.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
static void disambiguateMethodNamesFor(final Clazz clazz) {
    clazz.disambiguateMethods();
    for (final Clazz subClazz : clazz.subClassers) {
        disambiguateMethodNamesFor(subClazz);
    }
}
 
Example #29
Source File: MethodDisambiguator.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
static void disambiguateMethodNamesFor(final Clazz clazz) {
    clazz.disambiguateMethods();
    for (final Clazz subClazz : clazz.subClassers) {
        disambiguateMethodNamesFor(subClazz);
    }
}
 
Example #30
Source File: MethodDisambiguator.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
static void disambiguateMethodNamesFor(final Clazz clazz) {
    clazz.disambiguateMethods();
    for (final Clazz subClazz : clazz.subClassers) {
        disambiguateMethodNamesFor(subClazz);
    }
}