Пример #1
0
        // enforces a bijection Type-->_nTIB:
        public static _nTIB getTIB(global::System.Type myType, string jTypeName)
        {
            _nTIB result;

            if (!tibTable.TryGetValue(myType, out result))
            {
                result = new _nTIB(myType, jTypeName);
                tibTable.Add(myType, result);
            }
            return(result);
        }
Пример #2
0
 private static void bootstrapSetClass(_nTIB tib)
 {
     //   note we do not really need:
     //   java.lang.String javaTypeStr = nativeTypeToJavaTypeName(aType);
     //   because we will be called back soon to get the TIB.
     //   so let's store a dummy:
     java.lang.String dummy = new java.lang.String();
     dummy.@this();
     bootstrapTable.Add(dummy, tib);
     java.lang.Class.forName(dummy); // this will set the class of the tib
 }
Пример #3
0
        public static java.lang.Class getClass(global::System.Type aType)
        {
            _nTIB aTIB = getTIB(aType, aType.ToString());

            java.lang.Class result = aTIB.getClass();
            if (result == null)
            {
                // need to initialize with java.lang.Class instant
                bootstrapSetClass(aTIB);
                result = aTIB.getClass();
            }
            return(result);
        }
Пример #4
0
 private _nTIB(global::System.Type myType, string javaName)
 {
     this.myType       = myType;
     this.javaName     = javaName;
     this.componentTIB = null;
 }
Пример #5
0
        static _nTIB()
        {
            voidType       = typeof(void);
            tibTable       = new global::System.Collections.Generic.Dictionary <global::System.Type, _nTIB>();
            bootstrapTable = new System.Collections.Generic.Dictionary <java.lang.String, _nTIB>();
            jNameTable     = new System.Collections.Generic.Dictionary <string, _nTIB>();
            //inBootstrap = true;

            _nTIB voidTib = new _nTIB(voidType, "void");

            tibTable.Add(voidType, voidTib);
            jNameTable.Add("void", voidTib);
            bootstrapSetClass(voidTib);

            _nTIB booleanTib = new _nTIB(booleanType, "boolean");

            tibTable.Add(booleanType, booleanTib);
            jNameTable.Add("boolean", booleanTib);
            bootstrapSetClass(booleanTib);

            _nTIB byteTib = new _nTIB(byteType, "byte");

            tibTable.Add(byteType, byteTib);
            jNameTable.Add("byte", byteTib);
            bootstrapSetClass(byteTib);

            _nTIB charTib = new _nTIB(charType, "char");

            tibTable.Add(charType, charTib);
            jNameTable.Add("char", charTib);
            bootstrapSetClass(charTib);

            _nTIB shortTib = new _nTIB(shortType, "short");

            tibTable.Add(shortType, shortTib);
            jNameTable.Add("short", shortTib);
            bootstrapSetClass(shortTib);

            _nTIB intTib = new _nTIB(intType, "int");

            tibTable.Add(intType, intTib);
            jNameTable.Add("int", intTib);
            bootstrapSetClass(intTib);

            _nTIB longTib = new _nTIB(longType, "long");

            tibTable.Add(longType, longTib);
            jNameTable.Add("long", longTib);
            bootstrapSetClass(longTib);

            _nTIB floatTib = new _nTIB(floatType, "float");

            tibTable.Add(floatType, floatTib);
            jNameTable.Add("float", floatTib);
            bootstrapSetClass(floatTib);

            _nTIB doubleTib = new _nTIB(doubleType, "double");

            tibTable.Add(doubleType, doubleTib);
            jNameTable.Add("double", doubleTib);
            bootstrapSetClass(doubleTib);

            _nTIB objectTib = new _nTIB(objectType, "java.lang.Object");

            tibTable.Add(objectType, objectTib);
            jNameTable.Add("java.lang.Object", objectTib);
            bootstrapSetClass(objectTib);

            _nTIB booleanArrayTib = new _nTIB(booleanArrayType, "[Z");

            tibTable.Add(booleanArrayType, booleanArrayTib);
            jNameTable.Add("[Z", booleanArrayTib);
            bootstrapSetClass(booleanArrayTib);
            booleanArrayTib.setComponentTIB(booleanTib);

            _nTIB byteArrayTib = new _nTIB(byteArrayType, "[B");

            tibTable.Add(byteArrayType, byteArrayTib);
            jNameTable.Add("[B", byteArrayTib);
            bootstrapSetClass(byteArrayTib);
            byteArrayTib.setComponentTIB(byteTib);

            _nTIB charArrayTib = new _nTIB(charArrayType, "[C");

            tibTable.Add(charArrayType, charArrayTib);
            jNameTable.Add("[C", charArrayTib);
            bootstrapSetClass(charArrayTib);
            charArrayTib.setComponentTIB(charTib);

            _nTIB shortArrayTib = new _nTIB(shortArrayType, "[S");

            tibTable.Add(shortArrayType, shortArrayTib);
            jNameTable.Add("[S", shortArrayTib);
            bootstrapSetClass(shortArrayTib);
            shortArrayTib.setComponentTIB(shortTib);

            _nTIB intArrayTib = new _nTIB(intArrayType, "[I");

            tibTable.Add(intArrayType, intArrayTib);
            jNameTable.Add("[I", intArrayTib);
            bootstrapSetClass(intArrayTib);
            intArrayTib.setComponentTIB(intTib);

            _nTIB longArrayTib = new _nTIB(longArrayType, "[J");

            tibTable.Add(longArrayType, longArrayTib);
            jNameTable.Add("[J", longArrayTib);
            bootstrapSetClass(longArrayTib);
            longArrayTib.setComponentTIB(longTib);

            _nTIB floatArrayTib = new _nTIB(floatArrayType, "[F");

            tibTable.Add(floatArrayType, floatArrayTib);
            jNameTable.Add("[F", floatArrayTib);
            bootstrapSetClass(floatArrayTib);
            floatArrayTib.setComponentTIB(floatTib);

            _nTIB doubleArrayTib = new _nTIB(doubleArrayType, "[D");

            tibTable.Add(doubleArrayType, doubleArrayTib);
            jNameTable.Add("[D", doubleArrayTib);
            bootstrapSetClass(doubleArrayTib);
            doubleArrayTib.setComponentTIB(doubleTib);

            _nTIB objectArrayTib = new _nTIB(objectArrayType, "[Ljava.lang.Object");

            tibTable.Add(objectArrayType, objectArrayTib);
            jNameTable.Add("[Ljava.lang.Object", objectArrayTib);
            bootstrapSetClass(objectArrayTib);
            objectArrayTib.setComponentTIB(objectTib);
        }
Пример #6
0
 private void setComponentTIB(_nTIB componentTIB)
 {
     this.componentTIB = componentTIB;
 }
Пример #7
0
        static _nTIB()
        {
            voidType = typeof(void);
            tibTable = new global::System.Collections.Generic.Dictionary<global::System.Type, _nTIB>();
            bootstrapTable = new System.Collections.Generic.Dictionary<java.lang.String, _nTIB>();
            jNameTable = new System.Collections.Generic.Dictionary<string,_nTIB>();
            //inBootstrap = true;

            _nTIB voidTib = new _nTIB(voidType, "void");
            tibTable.Add(voidType, voidTib);
            jNameTable.Add("void", voidTib);
            bootstrapSetClass(voidTib);

            _nTIB booleanTib = new _nTIB(booleanType, "boolean");
            tibTable.Add(booleanType, booleanTib);
            jNameTable.Add("boolean", booleanTib);
            bootstrapSetClass(booleanTib);

            _nTIB byteTib = new _nTIB(byteType, "byte");
            tibTable.Add(byteType, byteTib);
            jNameTable.Add("byte", byteTib);
            bootstrapSetClass(byteTib);

            _nTIB charTib = new _nTIB(charType, "char");
            tibTable.Add(charType, charTib);
            jNameTable.Add("char", charTib);
            bootstrapSetClass(charTib);

            _nTIB shortTib = new _nTIB(shortType, "short");
            tibTable.Add(shortType, shortTib);
            jNameTable.Add("short", shortTib);
            bootstrapSetClass(shortTib);

            _nTIB intTib = new _nTIB(intType, "int");
            tibTable.Add(intType, intTib);
            jNameTable.Add("int", intTib);
            bootstrapSetClass(intTib);

            _nTIB longTib = new _nTIB(longType, "long");
            tibTable.Add(longType, longTib);
            jNameTable.Add("long", longTib);
            bootstrapSetClass(longTib);

            _nTIB floatTib = new _nTIB(floatType, "float");
            tibTable.Add(floatType, floatTib);
            jNameTable.Add("float", floatTib);
            bootstrapSetClass(floatTib);

            _nTIB doubleTib = new _nTIB(doubleType, "double");
            tibTable.Add(doubleType, doubleTib);
            jNameTable.Add("double", doubleTib);
            bootstrapSetClass(doubleTib);

            _nTIB objectTib = new _nTIB(objectType, "java.lang.Object");
            tibTable.Add(objectType, objectTib);
            jNameTable.Add("java.lang.Object", objectTib);
            bootstrapSetClass(objectTib);

            _nTIB booleanArrayTib = new _nTIB(booleanArrayType, "[Z");
            tibTable.Add(booleanArrayType, booleanArrayTib);
            jNameTable.Add("[Z", booleanArrayTib);
            bootstrapSetClass(booleanArrayTib);
            booleanArrayTib.setComponentTIB(booleanTib);

            _nTIB byteArrayTib = new _nTIB(byteArrayType, "[B");
            tibTable.Add(byteArrayType, byteArrayTib);
            jNameTable.Add("[B", byteArrayTib);
            bootstrapSetClass(byteArrayTib);
            byteArrayTib.setComponentTIB(byteTib);

            _nTIB charArrayTib = new _nTIB(charArrayType, "[C");
            tibTable.Add(charArrayType, charArrayTib);
            jNameTable.Add("[C", charArrayTib);
            bootstrapSetClass(charArrayTib);
            charArrayTib.setComponentTIB(charTib);

            _nTIB shortArrayTib = new _nTIB(shortArrayType, "[S");
            tibTable.Add(shortArrayType, shortArrayTib);
            jNameTable.Add("[S", shortArrayTib);
            bootstrapSetClass(shortArrayTib);
            shortArrayTib.setComponentTIB(shortTib);

            _nTIB intArrayTib = new _nTIB(intArrayType, "[I");
            tibTable.Add(intArrayType, intArrayTib);
            jNameTable.Add("[I", intArrayTib);
            bootstrapSetClass(intArrayTib);
            intArrayTib.setComponentTIB(intTib);

            _nTIB longArrayTib = new _nTIB(longArrayType, "[J");
            tibTable.Add(longArrayType, longArrayTib);
            jNameTable.Add("[J", longArrayTib);
            bootstrapSetClass(longArrayTib);
            longArrayTib.setComponentTIB(longTib);

            _nTIB floatArrayTib = new _nTIB(floatArrayType, "[F");
            tibTable.Add(floatArrayType, floatArrayTib);
            jNameTable.Add("[F", floatArrayTib);
            bootstrapSetClass(floatArrayTib);
            floatArrayTib.setComponentTIB(floatTib);

            _nTIB doubleArrayTib = new _nTIB(doubleArrayType, "[D");
            tibTable.Add(doubleArrayType, doubleArrayTib);
            jNameTable.Add("[D", doubleArrayTib);
            bootstrapSetClass(doubleArrayTib);
            doubleArrayTib.setComponentTIB(doubleTib);

            _nTIB objectArrayTib = new _nTIB(objectArrayType, "[Ljava.lang.Object");
            tibTable.Add(objectArrayType, objectArrayTib);
            jNameTable.Add("[Ljava.lang.Object", objectArrayTib);
            bootstrapSetClass(objectArrayTib);
            objectArrayTib.setComponentTIB(objectTib);
        }
Пример #8
0
 private void setComponentTIB(_nTIB componentTIB)
 {
     this.componentTIB = componentTIB;
 }
Пример #9
0
 private static void bootstrapSetClass(_nTIB tib)
 {
     //   note we do not really need:
     //   java.lang.String javaTypeStr = nativeTypeToJavaTypeName(aType);
     //   because we will be called back soon to get the TIB.
     //   so let's store a dummy:
     java.lang.String dummy = new java.lang.String();
     dummy.@this();
     bootstrapTable.Add(dummy, tib);
     java.lang.Class.forName(dummy); // this will set the class of the tib
 }
Пример #10
0
 // enforces a bijection Type-->_nTIB:
 public static _nTIB getTIB(global::System.Type myType, string jTypeName)
 {
     _nTIB result;
     if (!tibTable.TryGetValue(myType, out result)) {
         result = new _nTIB(myType, jTypeName);
         tibTable.Add(myType,result);
     }
     return result;
 }
Пример #11
0
 private _nTIB(global::System.Type myType, string javaName)
 {
     this.myType = myType;
     this.javaName = javaName;
     this.componentTIB = null;
 }