Add SWCommand.ClassMapper
Dieser Commit ist enthalten in:
Ursprung
7e733fca7c
Commit
2ad2dc29e4
@ -89,6 +89,15 @@ public abstract class SWCommand {
|
|||||||
throw new SecurityException(e.getMessage(), e);
|
throw new SecurityException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
add(ClassMapper.class, method, i -> i != 0, false, TypeMapper.class, (anno, parameters) -> {
|
||||||
|
try {
|
||||||
|
method.setAccessible(true);
|
||||||
|
Object object = method.invoke(this);
|
||||||
|
SWCommandUtils.addMapper(anno.value().getTypeName(), (TypeMapper<?>) object);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new SecurityException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
});
|
||||||
add(RegisterHelp.class, method, i -> i != 1, true, null, (anno, parameters) -> {
|
add(RegisterHelp.class, method, i -> i != 1, true, null, (anno, parameters) -> {
|
||||||
if (!parameters[parameters.length - 1].isVarArgs()) {
|
if (!parameters[parameters.length - 1].isVarArgs()) {
|
||||||
return;
|
return;
|
||||||
@ -167,4 +176,11 @@ public abstract class SWCommand {
|
|||||||
String value();
|
String value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target({ElementType.METHOD})
|
||||||
|
protected @interface ClassMapper {
|
||||||
|
Class<?> value();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren