'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#End Region
Sub Process_Globals
Type BiomeType(t1 As String, t2 As String, t3 As String, t4 As String)
End Sub
Sub AppStart (Args() As String)
Dim t As BiomeType
t.Initialize
t=TypeToType(t)
Log(t)
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub TypeToType(o As Object) As Object
Dim r As Reflector
r.Target = o
Dim jo As JavaObject = Me
Dim fields() As String = jo.RunMethod("GetFields", Array(o))
For Each f As String In fields
If f="IsInitialized" Then Continue
r.SetField(f,f,"java.lang.String")
Next
Return o
End Sub
#If JAVA
import java.lang.reflect.Field;
public static String[] GetFields(Object o)
{
Class oc = o.getClass();
Field[] fields = oc.getDeclaredFields();
String[] res = new String[fields.length] ;
for(int j=0;j<fields.length;j++)
{
res[j] = fields[j].getName();
}
return res;
}
#End If