refactor: 优化方法名称

Signed-off-by: 502647092 <admin@yumc.pw>
merge/1/MERGE
502647092 2016-10-17 00:48:57 +08:00
parent 7ee5fc9b40
commit a596310693
1 changed files with 9 additions and 4 deletions

View File

@ -61,7 +61,7 @@ public class CommandParse {
return new CommandParse(method.getParameterTypes(), method.getParameterAnnotations(), method.getReturnType().equals(boolean.class));
}
public static void registerParse(Class clazz, Parse parse) {
public static void register(Class clazz, Parse parse) {
allparses.put(clazz, parse);
}
@ -241,9 +241,6 @@ public class CommandParse {
public StringParse() {
allparses.put(String.class, this);
if (attrs.containsKey("option")) {
options = Arrays.asList(attrs.get("option").split(","));
}
}
@Override
@ -256,5 +253,13 @@ public class CommandParse {
}
return arg;
}
@Override
public Parse<String> parseAnnotation(Annotation[] annotations) {
if (attrs.containsKey("option")) {
options = Arrays.asList(attrs.get("option").split(","));
}
return super.parseAnnotation(annotations);
}
}
}