/** * SMI-1307: Java Language Adapter * * Parses Java source files and extracts imports, exports, and functions * using regex-based parsing. Handles Java-specific features including: * - Visibility modifiers (public, private, protected, package-private) * - Annotations (@Override, @Test, @Autowired, etc.) * - Generics in class and method declarations * - Interfaces, abstract classes, enums, and annotation types * * @see docs/internal/architecture/multi-language-analysis.md */ import { LanguageAdapter, type SupportedLanguage } from './base.js'; import type { ParseResult, ExportInfo, FunctionInfo, FrameworkRule } from './base.js'; export { parsePomXml, parseBuildGradle, type MavenDependency } from './java-parsers.js'; /** * Extended ExportInfo for Java with visibility support */ export interface JavaExportInfo extends ExportInfo { /** Java visibility modifier */ visibility: 'public' | 'private' | 'protected' | 'internal'; /** Line number in source */ line: number; /** Whether the class/method is abstract */ isAbstract?: boolean; /** Whether the class is final */ isFinal?: boolean; } /** * Extended FunctionInfo for Java with decorator/annotation support */ export interface JavaFunctionInfo extends FunctionInfo { /** Annotations on the method (@Override, @Test, etc.) */ decorators?: string[]; /** Whether the method is static */ isStatic?: boolean; /** Whether the method is synchronized */ isSynchronized?: boolean; } /** * Java Language Adapter * * Parses Java source files using regex-based parsing. * Handles Java's explicit visibility modifiers and annotation system. * * @example * ```typescript * const adapter = new JavaAdapter() * const result = adapter.parseFile(javaCode, 'Main.java') * console.log(result.exports) // public classes, interfaces, enums * console.log(result.functions) // public/protected methods * ``` */ export declare class JavaAdapter extends LanguageAdapter { readonly language: SupportedLanguage; readonly extensions: string[]; /** * Parse a Java source file and extract information */ parseFile(content: string, filePath: string): ParseResult; /** * Parse file incrementally (currently same as full parse) */ parseIncremental(content: string, filePath: string, _previousTree?: unknown): ParseResult; /** * Get Java framework detection rules */ getFrameworkRules(): FrameworkRule[]; /** * Clean up resources (no-op for regex-based parsing) */ dispose(): void; /** * Extract import statements from Java source * * Handles: * - Regular imports: import com.example.Class; * - Static imports: import static com.example.Class.method; * - Wildcard imports: import com.example.*; */ private extractImports; /** * Extract exports (public declarations) from Java source * * In Java, exports are determined by visibility modifiers: * - public: accessible from anywhere * - protected: accessible from subclasses * - package-private (default): accessible within package * - private: not exported */ private extractExports; /** * Extract function definitions from Java source * * Handles: * - Regular methods: public void foo(String s, int n) * - Generic methods: public List bar(T item) * - Abstract methods: protected abstract void baz(); * - Static methods: public static void main(String[] args) * - Annotated methods: @Override public String toString() */ private extractFunctions; } //# sourceMappingURL=java.d.ts.map