Class InitAnalyzer
- java.lang.Object
-
- nl.zerofiftyit.mdepunit.core.validation.InitAnalyzer
-
- All Implemented Interfaces:
CheckPom
public final class InitAnalyzer extends Object implements CheckPom
ThePomAnalyzerclass provides functionality for analyzing and validating Maven POM (Project Object Model) files. This class is designed to read and process the structure of a POM file and identify potential issues or discrepancies in its configuration.It supports operations for extracting POM content and performing validations as defined by the
CheckPominterface. The class is immutable and safe for concurrent use.Instances of
PomAnalyzerare created through static factory methods, which allow analysis of default or custom POM file paths.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static InitAnalyzeranalyzePom()Analyzes the POM file located at the default path "pom.xml" and returns an instance of PomAnalyzer to facilitate further checks or validations.static InitAnalyzeranalyzePom(String pomPath)Analyzes the specified POM file and returns an instance of PomAnalyzer to facilitate further checks or validations on the POM file's content.Inclusion<PomAnalyzer>checking(String givenNode)Analyzes the provided POM structure from the given node and returns anInclusionobject containing aPomAnalyzerinstance for further validation or analysis.Inclusion<ModuleAnalyzer>checkingModule()Provides anInclusion<ModuleAnalyzer>instance for analyzing and validating modules defined in a Maven POM file.
-
-
-
Method Detail
-
analyzePom
public static InitAnalyzer analyzePom() throws IOException
Analyzes the POM file located at the default path "pom.xml" and returns an instance of PomAnalyzer to facilitate further checks or validations.- Returns:
- an instance of
PomAnalyzerfor analyzing and validating the contents of the "pom.xml" file. - Throws:
IOException- if the POM file cannot be read or accessed.
-
analyzePom
public static InitAnalyzer analyzePom(String pomPath) throws IOException
Analyzes the specified POM file and returns an instance of PomAnalyzer to facilitate further checks or validations on the POM file's content.- Parameters:
pomPath- the path to the POM file to be analyzed- Returns:
- an instance of PomAnalyzer for analyzing and validating the specified POM file
- Throws:
IOException- if the specified POM file cannot be read or accessed
-
checking
public Inclusion<PomAnalyzer> checking(String givenNode)
Analyzes the provided POM structure from the given node and returns anInclusionobject containing aPomAnalyzerinstance for further validation or analysis. This is the most generic method for analysis.- Specified by:
checkingin interfaceCheckPom- Parameters:
givenNode- the initial node within the POM structure where analysis should begin- Returns:
- an
Inclusion<PomAnalyzer>instance that wraps aPomAnalyzerconfigured to analyze the specified POM node with the current state of negation and error handling logic
-
checkingModule
public Inclusion<ModuleAnalyzer> checkingModule()
Provides anInclusion<ModuleAnalyzer>instance for analyzing and validating modules defined in a Maven POM file. This method enables checking whether modules exist, ensuring they contain a `pom.xml` file, and performing additional validations on the specified modules.- Specified by:
checkingModulein interfaceCheckPom- Returns:
- an
Inclusion<ModuleAnalyzer>instance, allowing for further validation, checks, or operations related to the defined modules.
-
-