@FunctionalInterface
public interface DocConverter<T extends java.lang.annotation.Annotation>
T
into a String to be
collected with other conversions into a single String documenting a class or
method representing a command for a bot.
These are the fundamental building blocks behind command doc annotations, and can
be applied using the @ConvertedBy
annotation:
@ConvertedBy(MyCommandDocAnn.Converter.class) @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface MyCommandDocAnn { String value(); class Converter implements DocConverter <MyCommandDocAnn> { public String read(MyCommandDocAnn annotation) { return "**"+annotation.value()+"**"; } } }It is also notably recommended you follow the standards for DocConverters listed below:
read(java.lang.annotation.Annotation)
should not throw any exceptions,
nor otherwise halt a process due to one being thrown.@interface
they are used to convert
(the example above demonstrates this).ConvertedBy
Modifier and Type | Method and Description |
---|---|
java.lang.String |
read(T annotation)
Returns a String processed from the contents of the provided
Annotation . |
java.lang.String read(T annotation)
Annotation
.
annotation
- The annotation to process.