6#if FIRST_PASS == false && EXPORTER == false && IMPORTER == false
11 internal sealed class SystemAccessor : Accessor<object>
14 Type ikvmInternalCallerID;
15 Type javaLangSecurityManager;
17 FieldAccessor<object> _in;
18 FieldAccessor<object> _out;
19 FieldAccessor<object> _err;
20 MethodAccessor<Action> initializeSystemClass;
21 MethodAccessor<Func<string, string>> getProperty;
22 MethodAccessor<Func<string, string, string>> setProperty;
23 MethodAccessor<Func<object>> getSecurityManager;
24 MethodAccessor<Action<string, object>> loadLibrary;
30 public SystemAccessor(AccessorTypeResolver resolver) :
31 base(resolver,
"java.lang.System")
36 Type IkvmInternalCallerID => Resolve(
ref ikvmInternalCallerID,
"ikvm.internal.CallerID");
38 Type JavaLangSecurityManager => Resolve(
ref javaLangSecurityManager,
"java.lang.SecurityManager");
45 public void SetIn(
object value) => GetField(
ref _in, nameof(_in)).SetValue(value);
52 public void SetOut(
object value) => GetField(
ref _out, nameof(_out)).SetValue(value);
59 public void SetErr(
object value) => GetField(
ref _err, nameof(_err)).SetValue(value);
65 public void InvokeInitializeSystemClass() => GetMethod(
ref initializeSystemClass, nameof(initializeSystemClass), typeof(
void)).Invoker();
72 public string InvokeGetProperty(
string key) => GetMethod(
ref getProperty, nameof(getProperty), typeof(
string), typeof(
string)).Invoker(key);
80 public string InvokeSetProperty(
string key,
string value) => GetMethod(
ref setProperty, nameof(setProperty), typeof(
string), typeof(
string), typeof(
string)).Invoker(key, value);
86 public object InvokeGetSecurityManager() => GetMethod(
ref getSecurityManager, nameof(getSecurityManager), JavaLangSecurityManager).Invoker();
93 public void InvokeLoadLibrary(
string libname,
object callerID) => GetMethod(
ref loadLibrary, nameof(loadLibrary), typeof(
void), typeof(
string), IkvmInternalCallerID).Invoker(libname, callerID);
IKVM.Reflection.Type Type