Skip to content

Commit

Permalink
feat: overload PluginEntry constructor to set onload property (apache…
Browse files Browse the repository at this point in the history
…#1166)

Co-authored-by: Erisu <[email protected]>
  • Loading branch information
2 people authored and wedgberto committed May 17, 2022
1 parent d124902 commit b7b3cb8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions framework/src/org/apache/cordova/PluginEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,23 @@ public final class PluginEntry {

/**
* Constructs with a CordovaPlugin already instantiated.
*
* @param service The name of the service
* @param pluginClass The plugin class name
*/
public PluginEntry(String service, CordovaPlugin plugin) {
this(service, plugin.getClass().getName(), true, plugin);
}

/**
* @param service The name of the service
* @param plugin The CordovaPlugin already instantiated
* @param onload Create plugin object when HTML page is loaded
*/
public PluginEntry(String service, CordovaPlugin plugin, boolean onload) {
this(service, plugin.getClass().getName(), onload, plugin);
}

/**
* @param service The name of the service
* @param pluginClass The plugin class name
Expand All @@ -61,6 +73,12 @@ public PluginEntry(String service, String pluginClass, boolean onload) {
this(service, pluginClass, onload, null);
}

/**
* @param service The name of the service
* @param pluginClass The plugin class name
* @param onload Create plugin object when HTML page is loaded
* @param plugin The CordovaPlugin already instantiated
*/
private PluginEntry(String service, String pluginClass, boolean onload, CordovaPlugin plugin) {
this.service = service;
this.pluginClass = pluginClass;
Expand Down

0 comments on commit b7b3cb8

Please sign in to comment.