26 |
|
|
27 |
public class ThrowsTagImpl extends AbstractTagImpl implements ThrowsTag { |
public class ThrowsTagImpl extends AbstractTagImpl implements ThrowsTag { |
28 |
|
|
29 |
|
private ClassDoc exception; |
30 |
|
private String exceptionName; |
31 |
|
private String exceptionComment; |
32 |
|
|
33 |
public ThrowsTagImpl(String text, |
public ThrowsTagImpl(String text, |
34 |
ClassDocImpl contextClass, |
ClassDocImpl contextClass, |
35 |
MemberDocImpl contextMember) { |
MemberDocImpl contextMember) { |
47 |
break; |
break; |
48 |
} |
} |
49 |
} |
} |
50 |
if (contextClass==null) { |
if (null != exceptionName) { |
51 |
this.exception=(ClassDocImpl)Main.getRootDoc().classNamed(exceptionName); |
if (contextClass==null) { |
52 |
|
this.exception=Main.getRootDoc().classNamed(exceptionName); |
53 |
|
} |
54 |
|
else { |
55 |
|
this.exception=contextClass.findClass(exceptionName); |
56 |
|
} |
57 |
|
if (exception!=null) |
58 |
|
this.exceptionName=exception.qualifiedName(); |
59 |
|
else { |
60 |
|
if (text.trim().startsWith("<")) { |
61 |
|
Main.getRootDoc().printWarning("Expected exception name but got '"+text+"' in class "+contextClass.getClassName()); |
62 |
|
} |
63 |
|
} |
64 |
} |
} |
65 |
else { |
else { |
66 |
this.exception=(ClassDocImpl)contextClass.findClass(exceptionName); |
Main.getRootDoc().printWarning("@throws tag in comment for " + contextClass.qualifiedName() + "." + contextMember.name() + " doesn't specify an exception."); |
67 |
} |
} |
|
if (exception!=null) |
|
|
this.exceptionName=exception.qualifiedName(); |
|
|
else { |
|
|
if (text.trim().startsWith("<")) { |
|
|
Main.getRootDoc().printWarning("Expected exception name but got '"+text+"' in class "+contextClass.getClassName()); |
|
|
} |
|
|
} |
|
|
|
|
68 |
if (this.exceptionComment!=null) { |
if (this.exceptionComment!=null) { |
69 |
setBody(this.exceptionComment, contextClass, contextMember); |
setBody(this.exceptionComment, contextClass, contextMember); |
70 |
} |
} |
85 |
public String kind() { |
public String kind() { |
86 |
return "@throws"; |
return "@throws"; |
87 |
} |
} |
|
|
|
|
private ClassDocImpl exception; |
|
|
private String exceptionName; |
|
|
private String exceptionComment; |
|
88 |
} |
} |