mirror of
https://github.com/zaaarf/lillero-processor.git
synced 2024-12-23 02:44:53 +01:00
chore: javadocs for annotations
This commit is contained in:
parent
062f8117b9
commit
f85c868e10
5 changed files with 46 additions and 1 deletions
|
@ -16,6 +16,16 @@ import java.lang.annotation.RetentionPolicy;
|
|||
@Retention(RetentionPolicy.CLASS)
|
||||
@java.lang.annotation.Target(ElementType.METHOD)
|
||||
public @interface FindField {
|
||||
/**
|
||||
* @return the {@link Class} object containing the desired field,
|
||||
* or the {@link Object} class if not specified (the {@link Class}
|
||||
* from {@link Patch#value()} is instead used)
|
||||
*/
|
||||
Class<?> parent() default Object.class;
|
||||
|
||||
/**
|
||||
* @return the name of the field, will default to the empty string
|
||||
* (the name of the annotated method will instead be used)
|
||||
*/
|
||||
String name() default "";
|
||||
}
|
||||
|
|
|
@ -17,7 +17,23 @@ import java.lang.annotation.RetentionPolicy;
|
|||
@Retention(RetentionPolicy.CLASS)
|
||||
@java.lang.annotation.Target(ElementType.METHOD)
|
||||
public @interface FindMethod {
|
||||
/**
|
||||
* @return the {@link Class} object containing the desired method,
|
||||
* or the {@link Object} class if not specified (the {@link Class}
|
||||
* from {@link Patch#value()} is instead used)
|
||||
*/
|
||||
Class<?> parent() default Object.class;
|
||||
|
||||
/**
|
||||
* @return the name of the method, will default to the empty string
|
||||
* (the name of the annotated method will instead be used)
|
||||
*/
|
||||
String name() default "";
|
||||
|
||||
/**
|
||||
* @return a list of the parameters of the method, will default to empty
|
||||
* array (in that case, an attempt will be made to match a method without
|
||||
* args first)
|
||||
*/
|
||||
Class<?>[] params() default {};
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
* as parameters. It will be discarded otherwise.
|
||||
* It will also be discarded unless the containing class is annotated with {@link Patch}
|
||||
* and another method within the class is annotated with {@link Target}.
|
||||
* This annotation may be added multiple times, in order to target multiple methods.
|
||||
* @see Patch
|
||||
* @see Target
|
||||
*/
|
||||
|
@ -18,6 +19,16 @@ import java.lang.annotation.RetentionPolicy;
|
|||
@Repeatable(MultipleInjectors.class)
|
||||
@java.lang.annotation.Target(ElementType.METHOD)
|
||||
public @interface Injector {
|
||||
/**
|
||||
* @return the name of the stub annotated with {@link Target} this is referring to.
|
||||
* @since 0.3.0
|
||||
*/
|
||||
String targetName() default "";
|
||||
|
||||
/**
|
||||
* @return the parameters of the stub annotated with {@link Target} this is referring
|
||||
* to (used to discern in case of method stubs by the same name)
|
||||
* @since 0.3.0
|
||||
*/
|
||||
Class<?>[] params() default {};
|
||||
}
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
package ftbsc.lll.processor.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/**
|
||||
* Used to support {@link Injector} as a {@link Repeatable} annotation.
|
||||
* @since 0.3.0
|
||||
*/
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@java.lang.annotation.Target(ElementType.METHOD)
|
||||
public @interface MultipleInjectors {
|
||||
/**
|
||||
* @return the {@link Injector} annotations, as an array
|
||||
*/
|
||||
Injector[] value();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public @interface Target {
|
|||
* and to only check parameters if further clarification is needed.
|
||||
* @implNote While non-strict mode is more computationally efficient, it's ultimately not
|
||||
* relevant, as it only matters at compile time. Do not set this to false unless
|
||||
* you are sure know what you're doing.
|
||||
* you know what you're doing.
|
||||
* @since 0.3.0
|
||||
*/
|
||||
boolean strict() default true;
|
||||
|
|
Loading…
Reference in a new issue