1 16 17 package de.gulden.util.javasource; 18 19 import de.gulden.util.javasource.jjt.Node; 20 import de.gulden.util.javasource.jjt.*; 21 import de.gulden.util.xml.XMLToolbox; 22 import javax.xml.parsers.*; 23 import org.w3c.dom.*; 24 import java.io.*; 25 import java.util.*; 26 27 33 public class Exception extends SourceObjectDeclared { 34 35 41 public MemberExecutable myMemberExecutable; 42 43 44 50 public Exception(MemberExecutable parent) { 51 myMemberExecutable=parent; 52 } 53 54 55 64 public Element buildXML(Document d) { 65 Element e=d.createElement("throws"); 66 e.setAttribute("exception",getName()); 67 return e; 68 } 69 70 73 public Documentation getDocumentation() { 74 DocumentationDeclared dd=(DocumentationDeclared)myMemberExecutable.getDocumentation(); 75 if (dd!=null) { 76 return dd.findTag("@exception",myMemberExecutable.getDeclaringClass().qualify(this.getName())); 77 } 78 else { 79 return null; 80 } 81 } 82 83 89 public void initFromXML(Element element) throws IOException { 90 super.initFromXML(element); 92 name=element.getAttribute("exception"); 93 Parameter.addDocumentationToMember((DocumentationDeclared)getDocumentation(),myMemberExecutable); 94 } 95 96 99 void initFromAST(Node namenode) { 100 String name=namenode.retrieveName(); 101 setName(myMemberExecutable.getDeclaringClass().qualify(name)); 102 } 103 104 } | Popular Tags |