2 * Created on 20.09.2003
4 * To change the template for this generated file go to
5 * Window>Preferences>Java>Code Generation>Code and Comments
7 package net.sourceforge.phpdt.internal.corext.phpdoc;
9 import java.io.FileReader;
10 import java.io.IOException;
12 import net.sourceforge.phpeclipse.builder.PHPIdentifierLocation;
17 * To change the template for this generated type comment go to
18 * Window>Preferences>Java>Code Generation>Code and Comments
20 public class PHPDocUtil {
23 * Generate a PHPDoc hover text if possible
25 * @param hoverInfoBuffer
29 public static void appendPHPDoc(StringBuffer hoverInfoBuffer, String filename, PHPIdentifierLocation location) {
30 hoverInfoBuffer.append(location.toString());
31 hoverInfoBuffer.append('\n');
32 if (location.getPHPDocOffset() >= 0) {
33 FileReader phpdocFileReader;
35 phpdocFileReader = new FileReader(filename);
37 char[] charArray = new char[location.getPHPDocLength()];
38 phpdocFileReader.skip(location.getPHPDocOffset());
39 phpdocFileReader.read(charArray, 0, location.getPHPDocLength());
40 PHPDocCharArrayCommentReader phpdocConverter = new PHPDocCharArrayCommentReader(charArray);
41 hoverInfoBuffer.append(phpdocConverter.getString());
42 hoverInfoBuffer.append('\n');
43 } catch (IOException e) {