Skip to content

Commit 5c78552

Browse files
committed
Improve docs coverage on event filters
1 parent 537f8aa commit 5c78552

File tree

5 files changed

+58
-0
lines changed

5 files changed

+58
-0
lines changed

src/main/java/org/spongepowered/api/event/filter/cause/package-info.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,12 @@
2222
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
* THE SOFTWARE.
2424
*/
25+
/**
26+
* Cause-based <em>parameter source</em> annotations for event listeners.
27+
*
28+
* <p>These annotations extract information from the event's
29+
* {@link org.spongepowered.api.event.Cause}, and if present pass that
30+
* information to event listeners as method parameters.</p>
31+
*/
2532
@org.checkerframework.framework.qual.DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
2633
package org.spongepowered.api.event.filter.cause;

src/main/java/org/spongepowered/api/event/filter/data/GetValue.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
*
3939
* <p>This value can be taken from the event cause's first {@link ValueContainer},
4040
* or any preceding parameter that inherits from {@link ValueContainer}.</p>
41+
*
42+
* <p>When looking for a value, searching will start from the parameter
43+
* immediately before the annotated one, moving backwards and checking the first
44+
* {@link ValueContainer} in the event cause last.</p>
4145
*/
4246
@Target(ElementType.PARAMETER)
4347
@Retention(RetentionPolicy.RUNTIME)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) SpongePowered <https://www.spongepowered.org>
5+
* Copyright (c) contributors
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
/**
26+
* Event filter annotations working on
27+
* {@link org.spongepowered.api.data.value.ValueContainer} parameters.
28+
*
29+
* <p>These annotations can be applied to existing parameters to filter based on
30+
* data {@link org.spongepowered.api.data.Key}s.</p>
31+
*/
32+
@org.checkerframework.framework.qual.DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
33+
package org.spongepowered.api.event.filter.data;

src/main/java/org/spongepowered/api/event/filter/package-info.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,12 @@
2222
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
* THE SOFTWARE.
2424
*/
25+
/**
26+
* Event filter annotations.
27+
*
28+
* <p>These annotations can be applied to event
29+
* {@link org.spongepowered.api.event.Listener @Listener} methods to control
30+
* which events are received and extract data from the event.</p>
31+
*/
2532
@org.checkerframework.framework.qual.DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
2633
package org.spongepowered.api.event.filter;

src/main/java/org/spongepowered/api/event/filter/type/package-info.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,12 @@
2222
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
* THE SOFTWARE.
2424
*/
25+
/**
26+
* Listener method filters based on event type.
27+
*
28+
* <p>These annotations allow {@linkplain org.spongepowered.api.event.filter.type.Exclude excluding}
29+
* and {@linkplain org.spongepowered.api.event.filter.type.Include including}
30+
* subtypes of the declared event parameter in a declarative manner.</p>
31+
*/
2532
@org.checkerframework.framework.qual.DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
2633
package org.spongepowered.api.event.filter.type;

0 commit comments

Comments
 (0)