Skip to content

ISignalReplayBridge

interface ISignalReplayBridge
Extends: IBridge
Package: dev.joid.lib.bridge.signal · Module: core · Source: ISignalReplayBridge.java

The bridge that maps the class, field and method names compiled in a reactive expression to the names that exist at run time.

The signal replay reads the bytecode of an expression given to a reactive setter and looks up what it reads by name. A host that renames classes or members when the application loads registers this bridge in BridgeHandler.SIGNAL_REPLAY; every method returns the name unchanged by default. This bridge reads the names of the run time from two tables that the host provides:

public final class EngineSignalReplayBridge implements ISignalReplayBridge {
private final Map<String, String> classes;
private final Map<String, String> members;
public EngineSignalReplayBridge(final Map<String, String> classes, final Map<String, String> members) {
this.classes = classes;
this.members = members;
}
@Override
public String mapClass(final String name) {
return this.classes.getOrDefault(name, name);
}
@Override
public String mapField(final String owner, final String name, final String descriptor) {
return this.members.getOrDefault(owner + "." + name, name);
}
@Override
public String mapMethod(final String owner, final String name, final String descriptor) {
return this.members.getOrDefault(owner + "." + name + descriptor, name);
}
}

Full file: EngineSignalReplayBridge.java

ReturnsSignatureSummary
StringmapClass(String name) defaultReturns the run-time internal name, with / separators, of the class compiled under that internal name.
StringmapField(String owner, String name, String descriptor) defaultReturns the run-time name of the field compiled with that owner, name and descriptor.
StringmapMethod(String owner, String name, String descriptor) defaultReturns the run-time name of the method compiled with that owner, name and descriptor.

String mapClass(String name) default

Returns the run-time internal name, with / separators, of the class compiled under that internal name.

String mapField(String owner, String name, String descriptor) default

Returns the run-time name of the field compiled with that owner, name and descriptor.

String mapMethod(String owner, String name, String descriptor) default

Returns the run-time name of the method compiled with that owner, name and descriptor.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page