Interface SourceCodeParser


public interface SourceCodeParser
Interface for a parser of Java source code.
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Method Details

    • parseType

      BaseType parseType(Reader reader, BaseFile file)
      Parameters:
      reader - the Reader with the source-code (e.g. from *.java file).
      file - the BaseFile where to add the elements from the parsed source-code. In case an element already exists, it shall be merged with the information from the source-code. Otherwise it will be created.
      Returns:
      the main type (e.g. when Foo.java was parsed, this should be the top-level type Foo). The canonical simple name for that type can be determined via BaseElementWithQualifiedName.getSimpleName(). In case of "odd" Java source-code where no such canonical type exists, the first top-level BaseType should be returned. If the source-code is entirely odd and no (valid) type is present at all, then null may be returned.
    • parsePackage

      void parsePackage(Reader reader, BasePackage pkg)
      Parameters:
      reader - the Reader with the source-code (e.g. from package-info.java file).
      pkg - the BasePackage where to add doc, annotations, and comments from the source-code.