diff options
Diffstat (limited to 'src/main/java/ftbsc/lll/processor/annotations')
-rw-r--r-- | src/main/java/ftbsc/lll/processor/annotations/Find.java | 26 | ||||
-rw-r--r-- | src/main/java/ftbsc/lll/processor/annotations/Target.java | 9 |
2 files changed, 30 insertions, 5 deletions
diff --git a/src/main/java/ftbsc/lll/processor/annotations/Find.java b/src/main/java/ftbsc/lll/processor/annotations/Find.java index 384fb60..8d28671 100644 --- a/src/main/java/ftbsc/lll/processor/annotations/Find.java +++ b/src/main/java/ftbsc/lll/processor/annotations/Find.java @@ -26,10 +26,10 @@ public @interface Find { Class<?> value() default Object.class; /** - * For a {@link TypeProxy}, this can be either the fully-qualified name - * to be used in place of {@link #value()} or an inner class name to append - * after a $ symbol to the already acquired fully-qualified name. - * For others, this is refers to the parent class. + * This can be either the fully-qualified name to be used in place of {@link #value()} to + * represent the parent class or an inner class name to append after a $ symbol to the + * already acquired fully-qualified name. + * For a {@link TypeProxy}, this refers to the class itself rather than the parent. * @return the name of the inner class that contains the target, * defaults to empty string (not an inner class) * @since 0.5.0 @@ -50,4 +50,22 @@ public @interface Find { * @since 0.5.0 */ String name() default ""; + + /** + * This overrules the type of a field. Only to be used in the case (such as fields of + * anonymous classes) of fields whose parents cannot be reached at processing time. + * @return a {@link Class} representing the type. + * @deprecated This is only meant as a temporary solution until a better handling + * is implemented; only use this if strictly necessary as it may be + * removed or changed even across revisions. + */ + @Deprecated + Class<?> type() default Object.class; + + /** + * @return the inner class name to be used with {@link #type()} + * @deprecated See {@link #type()}'s deprecation notice for more info. + */ + @Deprecated + String typeInner() default ""; } diff --git a/src/main/java/ftbsc/lll/processor/annotations/Target.java b/src/main/java/ftbsc/lll/processor/annotations/Target.java index ed5cc0f..e1e69f7 100644 --- a/src/main/java/ftbsc/lll/processor/annotations/Target.java +++ b/src/main/java/ftbsc/lll/processor/annotations/Target.java @@ -25,7 +25,14 @@ public @interface Target { * @return the name of the element this is supposed to apply to * @since 0.5.0 */ - String of() default ""; + String of(); + + /** + * @return a name which overrides the name of the annotated one, may be used in + * cases such as constructors + * @since 0.5.0 + */ + String methodName() default ""; /** * When set to false, tells the processor to first try to match a single method by name, |