Plan/all/com/djrapitops/plan/extension/ExtensionService.html

225 lines
15 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML>
<html lang="en">
2019-08-05 11:13:19 +02:00
<head>
<!-- Generated by javadoc (17) -->
<title>ExtensionService (Plan 5.4-SNAPSHOT API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="declaration: package: com.djrapitops.plan.extension, interface: ExtensionService">
<meta name="generator" content="javadoc/ClassWriterImpl">
2019-08-05 11:13:19 +02:00
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style">
2019-08-05 11:13:19 +02:00
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script>
2019-08-05 11:13:19 +02:00
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "../../../../";
loadScripts(document, 'script');</script>
2019-08-05 11:13:19 +02:00
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
2019-08-05 11:13:19 +02:00
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
2019-08-05 11:13:19 +02:00
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
2019-08-05 11:13:19 +02:00
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html#class">Help</a></li>
2019-08-05 11:13:19 +02:00
</ul>
</div>
<div class="sub-nav">
2019-08-05 11:13:19 +02:00
<div>
<ul class="sub-nav-list">
2019-08-05 11:13:19 +02:00
<li>Summary:&nbsp;</li>
<li><a href="#nested-class-summary">Nested</a>&nbsp;|&nbsp;</li>
2019-08-05 11:13:19 +02:00
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
2019-08-05 11:13:19 +02:00
</ul>
<ul class="sub-nav-list">
2019-08-05 11:13:19 +02:00
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
2019-08-05 11:13:19 +02:00
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
2019-08-05 11:13:19 +02:00
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">com.djrapitops.plan.extension</a></div>
<h1 title="Interface ExtensionService" class="title">Interface ExtensionService</h1>
2019-08-05 11:13:19 +02:00
</div>
<section class="class-description" id="class-description">
<dl class="notes">
2019-08-05 11:13:19 +02:00
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="ExtensionSvc.html" title="class in com.djrapitops.plan.extension">ExtensionSvc</a></code></dd>
2019-08-05 11:13:19 +02:00
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public interface </span><span class="element-name type-name-label">ExtensionService</span></div>
<div class="block">Interface for registering <a href="DataExtension.html" title="interface in com.djrapitops.plan.extension"><code>DataExtension</code></a>s.
2019-08-05 11:13:19 +02:00
<p>
Obtaining instance:
- Obtain instance with <a href="#getInstance()"><code>getInstance()</code></a>.
2019-08-05 11:13:19 +02:00
- Make sure to catch a possible NoClassDefFoundError in case Plan is not installed
- Catch IllegalStateException in case ExtensionService is not enabled
<p>
Registering <a href="DataExtension.html" title="interface in com.djrapitops.plan.extension"><code>DataExtension</code></a>:
- Register your <a href="DataExtension.html" title="interface in com.djrapitops.plan.extension"><code>DataExtension</code></a> with <a href="#register(com.djrapitops.plan.extension.DataExtension)"><code>register(DataExtension)</code></a>
2019-08-05 11:13:19 +02:00
- Catch a possible IllegalArgumentException in case the DataExtension implementation is invalid.</div>
</section>
<section class="summary">
<ul class="summary-list">
2019-08-05 11:13:19 +02:00
<!-- ======== NESTED CLASS SUMMARY ======== -->
<li>
<section class="nested-class-summary" id="nested-class-summary">
<h2>Nested Class Summary</h2>
<div class="caption"><span>Nested Classes</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Interface</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static class&nbsp;</code></div>
<div class="col-second even-row-color"><code><a href="ExtensionService.Holder.html" class="type-name-link" title="class in com.djrapitops.plan.extension">ExtensionService.Holder</a></code></div>
<div class="col-last even-row-color">&nbsp;</div>
</div>
</section>
</li>
2019-08-05 11:13:19 +02:00
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1"><code>static <a href="ExtensionService.html" title="interface in com.djrapitops.plan.extension">ExtensionService</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1"><code><a href="#getInstance()" class="member-name-link">getInstance</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1">
2019-08-05 11:13:19 +02:00
<div class="block">Obtain instance of ExtensionService.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="builder/ExtensionDataBuilder.html" title="interface in com.djrapitops.plan.extension.builder">ExtensionDataBuilder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#newExtensionDataBuilder(com.djrapitops.plan.extension.DataExtension)" class="member-name-link">newExtensionDataBuilder</a><wbr>(<a href="DataExtension.html" title="interface in com.djrapitops.plan.extension">DataExtension</a>&nbsp;extension)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Obtain a new <a href="builder/ExtensionDataBuilder.html" title="interface in com.djrapitops.plan.extension.builder"><code>ExtensionDataBuilder</code></a>, it is recommended to use <a href="DataExtension.html#newExtensionDataBuilder()"><code>DataExtension.newExtensionDataBuilder()</code></a>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Optional.html" title="class or interface in java.util" class="external-link">Optional</a>&lt;<a href="Caller.html" title="interface in com.djrapitops.plan.extension">Caller</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#register(com.djrapitops.plan.extension.DataExtension)" class="member-name-link">register</a><wbr>(<a href="DataExtension.html" title="interface in com.djrapitops.plan.extension">DataExtension</a>&nbsp;extension)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Register your <a href="DataExtension.html" title="interface in com.djrapitops.plan.extension"><code>DataExtension</code></a> implementation.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#unregister(com.djrapitops.plan.extension.DataExtension)" class="member-name-link">unregister</a><wbr>(<a href="DataExtension.html" title="interface in com.djrapitops.plan.extension">DataExtension</a>&nbsp;extension)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Unregister your <a href="DataExtension.html" title="interface in com.djrapitops.plan.extension"><code>DataExtension</code></a> implementation.</div>
</div>
</div>
</div>
</div>
</section>
2019-08-05 11:13:19 +02:00
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
2019-08-05 11:13:19 +02:00
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="getInstance()">
<h3>getInstance</h3>
<div class="member-signature"><span class="modifiers">static</span>&nbsp;<span class="return-type"><a href="ExtensionService.html" title="interface in com.djrapitops.plan.extension">ExtensionService</a></span>&nbsp;<span class="element-name">getInstance</span>()</div>
2019-08-05 11:13:19 +02:00
<div class="block">Obtain instance of ExtensionService.</div>
<dl class="notes">
<dt>Returns:</dt>
2019-08-05 11:13:19 +02:00
<dd>ExtensionService implementation.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NoClassDefFoundError.html" title="class or interface in java.lang" class="external-link">NoClassDefFoundError</a></code> - If Plan is not installed and this class can not be found or if older Plan version is installed.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">IllegalStateException</a></code> - If Plan is installed, but not enabled.</dd>
2019-08-05 11:13:19 +02:00
</dl>
</section>
2019-08-05 11:13:19 +02:00
</li>
<li>
<section class="detail" id="register(com.djrapitops.plan.extension.DataExtension)">
<h3>register</h3>
<div class="member-signature"><span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Optional.html" title="class or interface in java.util" class="external-link">Optional</a>&lt;<a href="Caller.html" title="interface in com.djrapitops.plan.extension">Caller</a>&gt;</span>&nbsp;<span class="element-name">register</span><wbr><span class="parameters">(<a href="DataExtension.html" title="interface in com.djrapitops.plan.extension">DataExtension</a>&nbsp;extension)</span></div>
<div class="block">Register your <a href="DataExtension.html" title="interface in com.djrapitops.plan.extension"><code>DataExtension</code></a> implementation.
2019-08-05 11:13:19 +02:00
<p>
You can use <a href="extractor/ExtensionExtractor.html#validateAnnotations()"><code>ExtensionExtractor.validateAnnotations()</code></a> in your Unit Tests to prevent IllegalArgumentExceptions here at runtime.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>extension</code> - Your DataExtension implementation, see <a href="DataExtension.html" title="interface in com.djrapitops.plan.extension"><code>DataExtension</code></a> for requirements.</dd>
<dt>Returns:</dt>
<dd>Optional <a href="Caller.html" title="interface in com.djrapitops.plan.extension"><code>Caller</code></a> that can be used to call for data update in Plan database manually - If the Optional is not present the user has disabled the extension in Plan config.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - If an implementation violation is found.</dd>
2019-08-05 11:13:19 +02:00
</dl>
</section>
2019-08-05 11:13:19 +02:00
</li>
<li>
<section class="detail" id="newExtensionDataBuilder(com.djrapitops.plan.extension.DataExtension)">
<h3>newExtensionDataBuilder</h3>
<div class="member-signature"><span class="return-type"><a href="builder/ExtensionDataBuilder.html" title="interface in com.djrapitops.plan.extension.builder">ExtensionDataBuilder</a></span>&nbsp;<span class="element-name">newExtensionDataBuilder</span><wbr><span class="parameters">(<a href="DataExtension.html" title="interface in com.djrapitops.plan.extension">DataExtension</a>&nbsp;extension)</span></div>
<div class="block">Obtain a new <a href="builder/ExtensionDataBuilder.html" title="interface in com.djrapitops.plan.extension.builder"><code>ExtensionDataBuilder</code></a>, it is recommended to use <a href="DataExtension.html#newExtensionDataBuilder()"><code>DataExtension.newExtensionDataBuilder()</code></a>.
<p>
Requires Capability DATA_EXTENSION_BUILDER_API</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>extension</code> - Extension for which this builder is.</dd>
<dt>Returns:</dt>
<dd>a new builder.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="unregister(com.djrapitops.plan.extension.DataExtension)">
<h3>unregister</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">unregister</span><wbr><span class="parameters">(<a href="DataExtension.html" title="interface in com.djrapitops.plan.extension">DataExtension</a>&nbsp;extension)</span></div>
<div class="block">Unregister your <a href="DataExtension.html" title="interface in com.djrapitops.plan.extension"><code>DataExtension</code></a> implementation.
2019-08-05 11:13:19 +02:00
<p>
This method should be used if calling methods on the DataExtension suddenly becomes unavailable, due to
plugin disable for example.</div>
<dl class="notes">
<dt>Parameters:</dt>
2019-08-05 11:13:19 +02:00
<dd><code>extension</code> - Your DataExtension implementation that was registered before.</dd>
</dl>
</section>
2019-08-05 11:13:19 +02:00
</li>
</ul>
</section>
2019-08-05 11:13:19 +02:00
</li>
</ul>
</section>
2019-08-05 11:13:19 +02:00
<!-- ========= END OF CLASS DATA ========= -->
</main>
2019-08-05 11:13:19 +02:00
</div>
</div>
</body>
</html>