Bootstrapper
Class
The bootstrapper handles resolving call-sites for dynamic method calls. This is used by functions in conjunction with the meta-factory.
Methods in this are used by name from dynamic invocation.
This is an adapted copy of Krow's bootstrapper.
Object
public final
// Randomly-generated example
Bootstrapper.bootstrap(caller, name, type, owner);
Bootstrapper.bootstrapFunction(caller, name, type, source, owner, args);
Bootstrapper.bootstrapPrivateDynamic(caller, name, type, owner);
Bootstrapper.bootstrapPrivate(caller, name, type, owner);
Constructors
new Bootstrapper ()
ConstructorBootstrapper
public
Methods
bootstrap (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a regular static method.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static
bootstrapFunction (Lookup, String, MethodType, String, Class, String)
MethodThis writes the call-site for invoking a Skript function from a script.
The metafactory is invoked to create a new bridge stub.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | String | source |
5 | Class | owner |
6 | String | args |
CallSite
public static
bootstrapPrivateDynamic (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a private dynamic method.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static
bootstrapPrivate (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a private static method.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static
bootstrapDynamic (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a regular dynamic method.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static
getBootstrapFunction ()
MethodGets the handle for a Skript function.
Handle
public static
getBootstrap (boolean, boolean)
MethodGets the handle for a regular method, used for writing a dynamic call-site.
Index | Type | Name |
---|---|---|
1 | boolean | isDynamic |
2 | boolean | isPrivate |
Handle
public static
bootstrapStaticFieldSetter (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a static field.
Rather than using the variable handle, this returns a method call-site. This allows the field to be treated like a method by the compiler.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static
bootstrapStaticFieldGetter (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a static field.
Rather than using the variable handle, this returns a method call-site. This allows the field to be treated like a method by the compiler.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static
bootstrapPrivateStaticFieldSetter (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a static field.
Rather than using the variable handle, this returns a method call-site. This allows the field to be treated like a method by the compiler.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static
bootstrapPrivateStaticFieldGetter (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a static field.
Rather than using the variable handle, this returns a method call-site. This allows the field to be treated like a method by the compiler.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static
bootstrapFieldSetter (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a static field.
Rather than using the variable handle, this returns a method call-site. This allows the field to be treated like a method by the compiler.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static
bootstrapFieldGetter (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a static field.
Rather than using the variable handle, this returns a method call-site. This allows the field to be treated like a method by the compiler.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static
bootstrapPrivateFieldSetter (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a static field.
Rather than using the variable handle, this returns a method call-site. This allows the field to be treated like a method by the compiler.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static
bootstrapPrivateFieldGetter (Lookup, String, MethodType, Class)
MethodFinds an existing call-site for a static field.
Rather than using the variable handle, this returns a method call-site. This allows the field to be treated like a method by the compiler.
Index | Type | Name |
---|---|---|
1 | Lookup | caller |
2 | String | name |
3 | MethodType | type |
4 | Class | owner |
CallSite
public static