// Step 1: Obtain icompilationunit iworkspaceroot root = resourcesplugin. getworkspace (). getroot (); iproject project = root. getproject ("test"); try {project. open (null/* iprogressmonitor */);} catch (coreexception e) {// todo auto-generated catch blocke. printstacktrace ();} ijavaproject javaproject = javacore. create (project); itype lwtype = NULL; try {lwtype = javaproject. findtype ("net. chenxs. test ");} catch (Jav Amodelexception e) {e. printstacktrace ();} // Step 2: extract javadocicompilationunit lwcompilationunit = lwtype. getcompilationunit (); try {sourcetype type = (sourcetype) lwcompilationunit. getalltypes () [0]; ibuffer buffer = lwcompilationunit. getbuffer (); imethod [] Methods = type. getmethods (); ibuffer buffer1 = lwcompilationunit. getbuffer (); For (INT I = 0; I <methods. length; I ++) {imethod method = methods [I]; isourceran GE range = method. getjavadocrange (); // obtain the javadoc range if (range! = NULL) {system. out. println (range. getoffset () + "" + range. getlength (); system. out. println (buffer1.gettext (range. getoffset (), range. getlength () ;}}} catch (javamodelexception e) {e. printstacktrace ();} Note: it is also possible to use AST; astparser = astparser. newparser (AST. jls3); astparser. setkind (astparser. k_compilation_unit); astparser. setsource (lwcompilationunit); compilationunit = (compilationunit) astpars Er. createast (null); typedeclaration type = (typedeclaration) unit. types (). get (0); methoddeclaration [] Methods = type. getmethods (); For (INT I = 0; I <methods. length; I ++) {methoddeclaration method = methods [I]; javadoc Doc = method. getjavadoc (); If (Doc! = NULL) {system. Out. println (DOC );}}