Constructor for ServicePatternRecognizer.
OptionalngMorphAdapter: NgMorphAdapterOptional ng-morph adapter for Angular-specific operations
BACKWARD COMPATIBILITY: Constructor is optional - if not provided, falls back to pure ts-morph.
Classify a source file as a service pattern.
Uses ng-morph to detect @Injectable, then analyzes class structure
and naming to determine the specific service pattern.
The source file to analyze
Service classification result
Detect if a class is a service with confidence scoring.
This method provides a more detailed analysis than isService(), including confidence levels and detection methodology.
The class declaration to analyze
Service detection result with confidence and method
Get all service patterns in the source file.
Some files may contain multiple service classes.
The source file to analyze
Array of service classifications
Check if a class declaration has the @Injectable decorator.
Uses ng-morph adapter if available for enhanced detection, falls back to legacy ts-morph detection otherwise.
The class declaration to check
True if the class has @Injectable decorator
Simple check if a class is a service.
This is a convenience method that wraps detectService() for backward compatibility with existing code.
The class declaration to check
True if the class is detected as a service
Recognizes and classifies Angular service patterns.
@Injectabledecorated classes