All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.qt.core.internal.QFactoryLoader Maven / Gradle / Ivy

The newest version!
package io.qt.core.internal;

import io.qt.core.*;
import io.qt.*;
import java.lang.reflect.*;
import java.util.logging.*;

/**
 * 

Java wrapper for Qt class QFactoryLoader

*/ public class QFactoryLoader extends io.qt.core.QObject { static { QtJambi_LibraryUtilities.initialize(); } /** * This variable stores the meta-object for the class. */ public static final io.qt.core.QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QFactoryLoader.class); /** *

Overloaded constructor for {@link #QFactoryLoader(java.lang.Class, java.lang.String, io.qt.core.Qt.CaseSensitivity)} * with arg__3 = io.qt.core.Qt.CaseSensitivity.CaseSensitive.

*/ public QFactoryLoader(java.lang.Class iid, java.lang.String suffix) { this(iid, suffix, io.qt.core.Qt.CaseSensitivity.CaseSensitive); } /** *

Overloaded constructor for {@link #QFactoryLoader(java.lang.Class, java.lang.String, io.qt.core.Qt.CaseSensitivity)}

*

with:

    *
  • suffix = ""
  • *
  • arg__3 = io.qt.core.Qt.CaseSensitivity.CaseSensitive
  • *
*/ public QFactoryLoader(java.lang.Class iid) { this(iid, "", io.qt.core.Qt.CaseSensitivity.CaseSensitive); } public QFactoryLoader(java.lang.Class iid, java.lang.String suffix, io.qt.core.Qt.CaseSensitivity arg__3){ super((QPrivateConstructor)null); io.qt.QtUtilities.initializePackage(iid); if(suffix==null || !suffix.startsWith("/")) throw new IllegalArgumentException("For historical reasons, the suffix must start with '/' (and it can't be empty)"); initialize_native(this, iid, suffix, arg__3); } private native static void initialize_native(QFactoryLoader instance, java.lang.Class iid, java.lang.String suffix, io.qt.core.Qt.CaseSensitivity arg__3); @io.qt.QtUninvokable public final int indexOf(java.lang.String needle){ return indexOf_native_cref_QString_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), needle); } @io.qt.QtUninvokable private native int indexOf_native_cref_QString_constfct(long __this__nativeId, java.lang.String needle); @io.qt.QtUninvokable public final io.qt.core.QObject instance(int index){ return instance_native_int_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), index); } @io.qt.QtUninvokable private native io.qt.core.QObject instance_native_int_constfct(long __this__nativeId, int index); @io.qt.QtUninvokable public final io.qt.core.QMultiMap keyMap(){ return keyMap_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @io.qt.QtUninvokable private native io.qt.core.QMultiMap keyMap_native_constfct(long __this__nativeId); @io.qt.QtUninvokable public final io.qt.core.QList metaData(){ return metaData_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @io.qt.QtUninvokable private native io.qt.core.QList metaData_native_constfct(long __this__nativeId); @io.qt.QtUninvokable public final void setExtraSearchPath(java.lang.String path){ setExtraSearchPath_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), path); } @io.qt.QtUninvokable private native void setExtraSearchPath_native_cref_QString(long __this__nativeId, java.lang.String path); @io.qt.QtUninvokable public final void update(){ update_native(QtJambi_LibraryUtilities.internal.nativeId(this)); } @io.qt.QtUninvokable private native void update_native(long __this__nativeId); public native static void refreshAll(); /** * Constructor for internal use only. * @param p expected to be null. */ @io.qt.NativeAccess protected QFactoryLoader(QPrivateConstructor p) { super(p); } public static void registerFactory(Class factoryClass){ Method createMethod = null; for(Method method : factoryClass.getDeclaredMethods()) { if(!Modifier.isStatic(method.getModifiers()) && Modifier.isPublic(method.getModifiers()) && method.getReturnType()!=void.class) { createMethod = method; break; } } if(createMethod==null) { throw new IllegalArgumentException("Missing factory method in interface "+factoryClass.getName()); } io.qt.internal.QtJambiPlugins.qRegisterPluginInterface(factoryClass); } public

R loadPlugin(QMetaObject.Method2 create, String key) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, key); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method3 create, String key, A a) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, key, a); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method4 create, String key, A a, B b) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, key, a, b); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method5 create, String key, A a, B b, C c) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, key, a, b, c); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method6 create, String key, A a, B b, C c, D d) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, key, a, b, c, d); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method7 create, String key, A a, B b, C c, D d, E e) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, key, a, b, c, d, e); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method8 create, String key, A a, B b, C c, D d, E e, F f) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, key, a, b, c, d, e, f); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method9 create, String key, A a, B b, C c, D d, E e, F f, G g) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, key, a, b, c, d, e, f, g); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method1 create, String key) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory); } catch (Throwable e) { Logger.getLogger(QFactoryLoader.class.getName()).throwing(QFactoryLoader.class.getName(), "loadPlugin", e); } } } } } return null; } public

R loadPlugin(QMetaObject.Method2 create, String key, A a) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, a); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method3 create, String key, A a, B b) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, a, b); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method4 create, String key, A a, B b, C c) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, a, b, c); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method5 create, String key, A a, B b, C c, D d) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, a, b, c, d); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method6 create, String key, A a, B b, C c, D d, E e) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, a, b, c, d, e); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method7 create, String key, A a, B b, C c, D d, E e, F f) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, a, b, c, d, e, f); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method8 create, String key, A a, B b, C c, D d, E e, F f, G g) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, a, b, c, d, e, f, g); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public

R loadPlugin(QMetaObject.Method9 create, String key, A a, B b, C c, D d, E e, F f, G g, H h) { int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class

factoryClass = io.qt.internal.QtJambiInternal.getFactoryClass(create); if(factoryClass!=null && factoryClass==io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid)) { QObject factoryObject = instance(index); P factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ try { return create.invoke(factory, a, b, c, d, e, f, g, h); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } return null; } public QObject loadPlugin(String key, Object... args){ return loadPlugin(QObject.class, key, args); } public

P loadPlugin(Class

pluginClass, String key, Object... args){ int index = indexOf(key); if (index != -1) { QJsonValue iidValue = getIID(index); if(iidValue.isString()) { QByteArray iid = new QByteArray(iidValue.toString()); Class factoryClass = io.qt.internal.QtJambiPlugins.qRegisteredPluginInterface(iid); if(factoryClass!=null) { QObject factoryObject = instance(index); QtObjectInterface factory = QMetaObject.cast(factoryClass, factoryObject); if(factory!=null){ Method createMethod = null; for(Method method : factoryClass.getDeclaredMethods()) { Class[] argClassTypes = method.getParameterTypes(); if(argClassTypes.length==args.length && !Modifier.isStatic(method.getModifiers()) && Modifier.isPublic(method.getModifiers()) && pluginClass==method.getReturnType()) { createMethod = method; for (int i = 0; i < method.getParameterCount(); i++) { Class argClassType = argClassTypes[i]; if(argClassType.isPrimitive()) { if(args[i]==null || (argClassType==int.class && !(args[i] instanceof Integer)) || (argClassType==short.class && !(args[i] instanceof Short)) || (argClassType==byte.class && !(args[i] instanceof Byte)) || (argClassType==long.class && !(args[i] instanceof Long)) || (argClassType==boolean.class && !(args[i] instanceof Boolean)) || (argClassType==float.class && !(args[i] instanceof Float)) || (argClassType==char.class && !(args[i] instanceof Character)) || (argClassType==double.class && !(args[i] instanceof Double)) ) { createMethod = null; break; } }else if(args[i]!=null && !argClassType.isInstance(args[i])){ createMethod = null; break; } } if(createMethod!=null) break; }else if(argClassTypes.length==args.length+1 && argClassTypes[0]==String.class && !Modifier.isStatic(method.getModifiers()) && Modifier.isPublic(method.getModifiers()) && pluginClass==method.getReturnType()) { createMethod = method; for (int i = 0; i <= method.getParameterCount(); i++) { Class argClassType = argClassTypes[i+1]; if(argClassType.isPrimitive()) { if(args[i]==null || (argClassType==int.class && !(args[i] instanceof Integer)) || (argClassType==short.class && !(args[i] instanceof Short)) || (argClassType==byte.class && !(args[i] instanceof Byte)) || (argClassType==long.class && !(args[i] instanceof Long)) || (argClassType==boolean.class && !(args[i] instanceof Boolean)) || (argClassType==float.class && !(args[i] instanceof Float)) || (argClassType==char.class && !(args[i] instanceof Character)) || (argClassType==double.class && !(args[i] instanceof Double)) ) { createMethod = null; break; } }else if(args[i]!=null && !argClassType.isInstance(args[i])){ createMethod = null; break; } } if(createMethod!=null) break; } } if(createMethod!=null) { try { Object result; if(createMethod.getParameterCount()==args.length+1) { Object[] _args = new Object[args.length+1]; System.arraycopy(args, 0, _args, 1, args.length); _args[0] = key; result = io.qt.internal.QtJambiInternal.invokeMethod(createMethod, factory, _args); }else { result = io.qt.internal.QtJambiInternal.invokeMethod(createMethod, factory, args); } if(pluginClass.isInterface() && result instanceof QObject) { return QMetaObject.cast(pluginClass, (QObject)result); }else if(result!=null){ return pluginClass.cast(result); } } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable ex) { throw new RuntimeException(ex); } } } } } } return null; } private QJsonValue getIID(int index){ return metaData().get(index).toCbor().value(QtPluginMetaDataKeys.IID.value()).toJsonValue(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy