288 |
if (parser.addComments) |
if (parser.addComments) |
289 |
execDoc.setRawCommentText(parser.getLastComment()); |
execDoc.setRawCommentText(parser.getLastComment()); |
290 |
|
|
291 |
|
parser.setLastComment(null); |
292 |
|
|
293 |
if (execDoc.isIncluded()) { |
if (execDoc.isIncluded()) { |
294 |
|
|
295 |
if (execDoc.isMethod()) { |
if (execDoc.isMethod()) { |
306 |
parser.ctx.maybeSerMethodList.add(execDoc); |
parser.ctx.maybeSerMethodList.add(execDoc); |
307 |
} |
} |
308 |
|
|
|
parser.setLastComment(null); |
|
309 |
return endIndex; |
return endIndex; |
310 |
} |
} |
311 |
|
|
437 |
parser.classOpened(source, startIndex, endIndex); |
parser.classOpened(source, startIndex, endIndex); |
438 |
if (parser.addComments) |
if (parser.addComments) |
439 |
parser.ctx.classDoc.setRawCommentText(parser.getLastComment()); |
parser.ctx.classDoc.setRawCommentText(parser.getLastComment()); |
440 |
|
parser.setLastComment(null); |
441 |
|
|
442 |
int rc=parser.parse(source, endIndex, parser.classLevelComponents); |
int rc=parser.parse(source, endIndex, parser.classLevelComponents); |
|
parser.setLastComment(null); |
|
443 |
return rc; |
return rc; |
444 |
} |
} |
445 |
|
|
505 |
|
|
506 |
private static final int READ_BUFFER_SIZE = 512; |
private static final int READ_BUFFER_SIZE = 512; |
507 |
|
|
508 |
static char[] loadFile(File file) throws IOException { |
static char[] loadFile(File file, String encoding) throws IOException { |
509 |
StringWriter writer=new StringWriter(); |
StringWriter writer = new StringWriter(); |
510 |
FileReader reader=new FileReader(file); |
FileInputStream in = new FileInputStream(file); |
511 |
|
Reader reader; |
512 |
|
if (null != encoding) { |
513 |
|
reader = new InputStreamReader(in, encoding); |
514 |
|
} |
515 |
|
else { |
516 |
|
reader = new InputStreamReader(in); |
517 |
|
} |
518 |
char[] buffer = new char[READ_BUFFER_SIZE]; |
char[] buffer = new char[READ_BUFFER_SIZE]; |
519 |
int nread; |
int nread; |
520 |
while ((nread=reader.read(buffer))>=0) { |
while ((nread=reader.read(buffer))>=0) { |
561 |
|
|
562 |
static Set processedFiles = new HashSet(); |
static Set processedFiles = new HashSet(); |
563 |
|
|
564 |
void processSourceFile(File file, boolean addComments) throws IOException, ParseException { |
void processSourceFile(File file, boolean addComments, String encoding) throws IOException, ParseException { |
565 |
|
|
566 |
this.addComments=addComments; |
this.addComments=addComments; |
567 |
|
|
579 |
|
|
580 |
currentLine = 1; |
currentLine = 1; |
581 |
|
|
582 |
char[] source = loadFile(file); |
char[] source = loadFile(file, encoding); |
583 |
parse(source, 0, sourceLevelComponents); |
parse(source, 0, sourceLevelComponents); |
584 |
|
|
585 |
ClassDoc[] importedClasses=(ClassDoc[])importedClassesList.toArray(new ClassDoc[0]); |
ClassDoc[] importedClasses=(ClassDoc[])importedClassesList.toArray(new ClassDoc[0]); |
638 |
return rc; |
return rc; |
639 |
} |
} |
640 |
|
|
641 |
public void processSourceDir(File dir) throws IOException, ParseException { |
public void processSourceDir(File dir, String encoding) throws IOException, ParseException { |
642 |
Debug.log(9,"Processing "+dir.getParentFile().getName()+"."+dir.getName()); |
Debug.log(9,"Processing "+dir.getParentFile().getName()+"."+dir.getName()); |
643 |
File[] files=dir.listFiles(); |
File[] files=dir.listFiles(); |
644 |
if (null!=files) { |
if (null!=files) { |
645 |
for (int i=0; i<files.length; ++i) { |
for (int i=0; i<files.length; ++i) { |
646 |
if (files[i].getName().toLowerCase().endsWith(".java")) { |
if (files[i].getName().toLowerCase().endsWith(".java")) { |
647 |
processSourceFile(files[i], true); |
processSourceFile(files[i], true, encoding); |
648 |
} |
} |
649 |
} |
} |
650 |
} |
} |
730 |
} |
} |
731 |
|
|
732 |
String lastComment = null; |
String lastComment = null; |
733 |
PackageDocImpl currentPackage = null; |
PackageDocImpl currentPackage = PackageDocImpl.DEFAULT_PACKAGE; |
734 |
ClassDocImpl currentClass = null; |
ClassDocImpl currentClass = null; |
735 |
List ordinaryClassesList = new ArrayList(); |
List ordinaryClassesList = new ArrayList(); |
736 |
List allClassesList = new ArrayList(); |
List allClassesList = new ArrayList(); |