public static void main(String[] args) {
File u =new File("D:/text1.txt");
String tx=New_Api.txt2String(u);
String[] str= tx.split("\\*/");
List<String> ls=new ArrayList<String>();
for (int i = 0; i < str.length; i++) {
if(i == str.length-1){
continue;
}else{
ls.add(str[i]+"*/");
}
}
List<String> ls2=new ArrayList<String>();
List<MethodVo> list = new ArrayList<MethodVo>();
//System.out.println(ls.size());
for (String st : ls) {
String ss=st.substring(st.lastIndexOf("/**")+1, st.lastIndexOf("*/"));
String[] h=st.split("@");
MethodVo vo = new MethodVo();
for (int j = 0; j < h.length; j++) {
//System.out.println("-----------"+h[j]);
if(h[j].contains("Title")){
String s=h[j].substring(h[j].indexOf("Title")+5,h[j].length());
String title=s.replace("*"," ");
vo.setTitle(title);
}else if(h[j].contains("author")){
String s=h[j].substring(h[j].indexOf("author")+6,h[j].length());
String author=s.replace("*"," ");
vo.setAuthor(author);
}
else if(h[j].contains("Date")){
String s=h[j].substring(h[j].indexOf("Date")+7,h[j].length());
String date=s.replace("*"," ");
vo.setDate(date);
}
else if(h[j].contains("Description")){
String s=h[j].substring(h[j].indexOf("Description")+11,h[j].length());
String description=s.replace("*"," ");
vo.setDescription(description);
}
else if(h[j].contains("param")){
String s=h[j].substring(h[j].indexOf("param")+5,h[j].length());
String par=s.replace("*"," ");
vo.setParam(par);
}
else if(h[j].contains("return")){
String s=h[j].substring(h[j].indexOf("return")+6,h[j].length());
String ret=s.replace("*"," ");
vo.setRet(ret);
}
}
list.add(vo);
//ls2.add(ss);
}
//list.add(vo);
//ls2.add(ss);
System.out.println(list.toString());