Regain 1.7.7-STABLE API

net.sf.regain.crawler.preparator.java
Class JavaParser

java.lang.Object
  extended by net.sf.regain.crawler.preparator.java.JavaParser

public class JavaParser
extends Object

Parses Java source code for indexing

The following information will be extracted: class name, member names, comments (javadoc)

Author:
Renuka Sindhgatta, http://www.oreillynet.com/pub/au/2554 Modifications by Thomas Tesche, http://clusterconsult.thtesche.com/

Field Summary
private  JClass _class
           
private  org.eclipse.jdt.core.dom.ASTParser _parser
           
private  org.eclipse.jdt.core.dom.CompilationUnit _unit
           
 
Constructor Summary
JavaParser()
           
 
Method Summary
private  void addMethods(JClass cls, org.eclipse.jdt.core.dom.TypeDeclaration object)
           
 ArrayList getComments()
           
 JClass getDeclaredClass()
           
 ArrayList getImportDeclarations()
           
private  void setClassInformation(JClass cls, org.eclipse.jdt.core.dom.TypeDeclaration object)
           
 void setSource(String sourceStr)
          Member sets the source for the parser and creates a compilation unit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_parser

private org.eclipse.jdt.core.dom.ASTParser _parser

_unit

private org.eclipse.jdt.core.dom.CompilationUnit _unit

_class

private JClass _class
Constructor Detail

JavaParser

public JavaParser()
Method Detail

setSource

public void setSource(String sourceStr)
               throws RegainException
Member sets the source for the parser and creates a compilation unit

Parameters:
sourceStr - the source code
Throws:
RegainException - if building of a compilation unit failed

getImportDeclarations

public ArrayList getImportDeclarations()

getComments

public ArrayList getComments()

getDeclaredClass

public JClass getDeclaredClass()

setClassInformation

private void setClassInformation(JClass cls,
                                 org.eclipse.jdt.core.dom.TypeDeclaration object)

addMethods

private void addMethods(JClass cls,
                        org.eclipse.jdt.core.dom.TypeDeclaration object)

Regain 1.7.7-STABLE API

Regain 1.7.7-STABLE, Copyright (C) 2004-2010 Til Schneider, www.murfman.de, Thomas Tesche, www.clustersystems.info