Regain 2.1.0-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, Thomas Tesche

Field Summary
private  JClassEnum _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(JClassEnum cls, org.eclipse.jdt.core.dom.TypeDeclaration object)
           
 List getComments()
           
 JClassEnum getDeclaredClass()
           
 ArrayList getImportDeclarations()
           
private  void setClassInformation(JClassEnum cls, org.eclipse.jdt.core.dom.TypeDeclaration declaration)
           
private  void setEnumInformation(JClassEnum cls, org.eclipse.jdt.core.dom.EnumDeclaration declaration)
           
 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 JClassEnum _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 List getComments()

getDeclaredClass

public JClassEnum getDeclaredClass()

setEnumInformation

private void setEnumInformation(JClassEnum cls,
                                org.eclipse.jdt.core.dom.EnumDeclaration declaration)

setClassInformation

private void setClassInformation(JClassEnum cls,
                                 org.eclipse.jdt.core.dom.TypeDeclaration declaration)

addMethods

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

Regain 2.1.0-STABLE API

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