parsers.java

Java regex-based parser. Extracts classes, interfaces, methods, and fields from Java source files using regular expressions (no javac/Maven dependency required).

📄 /home/runner/work/autoredocs/autoredocs/src/autoredocs/parsers/java.py

Classes

class
class JavaParser(BaseParser)
Regex-based parser for Java source files.
📍 Line 68

Methods

def
def parse_file(self, filepath: str | Path) -> ModuleDoc | None
Fetch a module's documentation from a file. Args: filepath: The path to the file containing the module's source code. Returns: A ModuleDoc object representing the module, or None if the file does not exist or cannot be read. Raises: OSError: If the file cannot be read due to a system error. UnicodeDecodeError: If the file cannot be read due to a Unicode encoding error.
def
def _build_javadoc_map(self, source: str) -> dict[int, str]
def
def _extract_methods(self, source: str, class_body_start: int) -> list[FunctionDoc]

Functions

def
def _clean_javadoc(raw: str) -> str
Clean Javadoc comment text.
📍 Line 211
def
def _parse_java_params(raw: str) -> list[ArgInfo]
Parse Java method parameters.
📍 Line 227