Class JavaSourceCodeReaderLowlevel

java.lang.Object
io.github.mmm.scanner.AbstractCharStreamScanner
io.github.mmm.scanner.CharReaderScanner
io.github.mmm.code.impl.java.parser.JavaSourceCodeReaderLowlevel
All Implemented Interfaces:
io.github.mmm.base.text.TextFormatProcessor, io.github.mmm.base.text.TextPosition, CharStreamScanner
Direct Known Subclasses:
JavaSourceCodeReaderHighlevel

public abstract class JavaSourceCodeReaderLowlevel extends CharReaderScanner
Wrapper for a Reader with internal char buffer to read and parse textual data.
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Field Details

    • javaDocLines

      protected final List<String> javaDocLines
      List of plain JavaDoc lines collected whilst parsing.
    • comments

      protected final List<io.github.mmm.code.api.comment.CodeComment> comments
      List of CodeComments collected whilst parsing.
    • elementComment

      protected io.github.mmm.code.api.comment.CodeComment elementComment
      See Also:
    • annotations

      protected final List<io.github.mmm.code.api.annotation.CodeAnnotation> annotations
    • file

      protected BaseFile file
      The current BaseFile to parse.
  • Constructor Details

    • JavaSourceCodeReaderLowlevel

      public JavaSourceCodeReaderLowlevel()
      The constructor.
    • JavaSourceCodeReaderLowlevel

      public JavaSourceCodeReaderLowlevel(int capacity)
      The constructor.
      Parameters:
      capacity - the buffer capacity.
  • Method Details

    • reset

      protected void reset()
      Overrides:
      reset in class AbstractCharStreamScanner
    • clearConsumeState

      protected void clearConsumeState()
      Clears all collected comments, annotations and javaDocs.
    • getComments

      public List<io.github.mmm.code.api.comment.CodeComment> getComments()
      Returns:
      the (last) comments that have been parsed by the last invocation of consume(). Will be empty for none.
      See Also:
    • getElementComment

      public io.github.mmm.code.api.comment.CodeComment getElementComment()
      Returns:
      the CodeComment for the currently parsed "element" (type, member, etc.) parsed by the last invocation of consume().
    • getJavaDocLines

      public List<String> getJavaDocLines()
      Returns:
      the plain JavaDoc lines that have been parsed by the last invocation of consume(). Will be empty for no JavaDoc.
    • getAnnotations

      public List<io.github.mmm.code.api.annotation.CodeAnnotation> getAnnotations()
      Returns:
      the List of CodeAnnotations that have been parsed by the last invocation of consume().
    • consume

      public void consume()
      Consumes all standard text like spaces, comments, JavaDoc and annotations
    • parseWhitespacesAndComments

      protected void parseWhitespacesAndComments()
      Skips all whitespaces and parses all CodeComments.
    • parseIdentifier

      protected String parseIdentifier()
      Returns:
      the current identifier or null if not pointing to such.
    • parseQName

      protected String parseQName()
      Returns:
      the current (qualified) name or null if not pointing to such.
    • parseModifiers

      protected io.github.mmm.code.api.modifier.CodeModifiers parseModifiers(boolean inInterface)
      Parameters:
      inInterface - - true if in the context of an interface (where public is the default), false otherwise.
      Returns:
      the parsed CodeModifiers.