Exemplo n.º 1
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
 }
Exemplo n.º 2
0
        public static java.lang.Exception ToJavaException(this Exception exception)
        {
            java.lang.Exception je;

            if (exception is IOException)
            {
                je = new java.io.IOException();
            }
            else if (exception is EndOfStreamException)
            {
                je = new java.io.EOFException();
            }
            else if (exception is ArgumentException)
            {
                je = new java.lang.IllegalArgumentException();
            }
            else if (exception is UnauthorizedAccessException)
            {
                je = new java.lang.IllegalThreadStateException();
            }
            else if (exception is FormatException)
            {
                je = new java.lang.NumberFormatException();
            }
            else if (exception is NullReferenceException)
            {
                je = new java.lang.NullPointerException();
            }
            else if (exception is ArithmeticException)
            {
                je = new java.lang.ArithmeticException();
            }
            else if (exception is IndexOutOfRangeException)
            {
                je = new java.lang.ArrayIndexOutOfBoundsException();
            }
            else if (exception is InvalidCastException)
            {
                je = new java.lang.ClassCastException();
            }
            else
            {
                je = new java.lang.RuntimeException();
            }

            java.lang.String message = new java.lang.String();
            message.@this(new org.xmlvm._nArrayAdapter<char>(exception.ToString().ToCharArray()));
            je.@this(message);

            // TODO strack trace
            // TODO cause

            return je;
        }
Exemplo n.º 3
0
 public static java.lang.String toJavaString(global::System.String str)
 {
     java.lang.String result = new java.lang.String();
     result.@this(new org.xmlvm._nArrayAdapter<char>(str.ToCharArray()));
     return result;
 }
 public static java.lang.String toJava(System.String str)
 {
     global::org.xmlvm._nArrayAdapter<char> n = new global::org.xmlvm._nArrayAdapter<char>(str.ToCharArray());
     java.lang.String s = new java.lang.String();
     s.@this(n);
     return s;
 }
 public override int charsWidth(global::java.lang.Object n1, global::org.xmlvm._nArrayAdapter<char> n2, int off, int len)
 {
     java.lang.String str = new java.lang.String();
     str.@this(n2, off, len);
     return stringWidth(n1, str);
 }
 public static java.lang.String toJava(char str) {
     if (str.ToString() == null) {
         return null;
     }
     global::org.xmlvm._nArrayAdapter<char> n = new global::org.xmlvm._nArrayAdapter<char>(str.ToString().ToCharArray());
     java.lang.String s = new java.lang.String();
     s.@this(n);
     return s;
 }
Exemplo n.º 7
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
 }
Exemplo n.º 8
0
 public static java.lang.String toJavaString(global::System.String str)
 {
     java.lang.String result = new java.lang.String();
     result.@this(new org.xmlvm._nArrayAdapter <char>(str.ToCharArray()));
     return(result);
 }