java??????????????
???????????? ???????[ 2013/2/19 10:04:56 ] ????????
????????????????????????
public class PasswordUtils {
@UseCase(id = 47?? description = "Passwords must contain at least one numeric")
public boolean validatePassword(String password) {
return (password.matches("\w*\d\w*"));
}
@UseCase(id = 48)
public String encryptPassword(String password) {
return new StringBuilder(password).reverse().toString();
}
}
?????????????????????????????????????漰???????????
???????????????????????????????????????鷽????????????????????????????????????????
public static void main(String[] args) {
List<Integer> useCases = new ArrayList<Integer>();
Collections.addAll(useCases?? 47?? 48?? 49?? 50);
trackUseCases(useCases?? PasswordUtils.class);
}
public static void trackUseCases(List<Integer> useCases?? Class<?> cl) {
for (Method m : cl.getDeclaredMethods()) {
UseCase uc = m.getAnnotation(UseCase.class);
if (uc != null) {
System.out.println("Found Use Case:" + uc.id() + " "
+ uc.description());
useCases.remove(new Integer(uc.id()));
}
}
for (int i : useCases) {
System.out.println("Warning: Missing use case-" + i);
}
}
????Found Use Case:47 Passwords must contain at least one numeric
????Found Use Case:48 no description
????Warning: Missing use case-49
????Warning: Missing use case-50
????????????δ???????????????????????????????????
????д???????????????????????????????????????????д???????????????
??????????????????????????????????????????????????Щ????????????????????????????????????????÷??????е?????????????????????в????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11