Class DefaultAnalyzerImpl
- java.lang.Object
-
- nl.zerofiftyit.mdepunit.core.validation.DefaultAnalyzerImpl
-
- All Implemented Interfaces:
DefaultAnalyzer
- Direct Known Subclasses:
ModuleAnalyzer,PomAnalyzer
public class DefaultAnalyzerImpl extends Object implements DefaultAnalyzer
-
-
Constructor Summary
Constructors Constructor Description DefaultAnalyzerImpl(String givenNode, List<PomElement> pomElements, ResultCaller resultCaller, NegateNext negateNext, List<String> errorMessages)Constructs an instance of DefaultAnalyzer with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Statement<DefaultAnalyzerImpl>containValue(@NonNull String value)Checks if the given value exists within the given node of the analyzed POM elements.Statement<DefaultAnalyzerImpl>equalsValue(@NonNull String value)Checks whether the specified value exactly matches the value present in the corresponding node of the analyzed POM elements.protected List<PomElement>getPomElements()Statement<DefaultAnalyzerImpl>haveTag(@NonNull String tagName)Checks if the given tag name exists within the given node of the analyzed POM elements.
-
-
-
Constructor Detail
-
DefaultAnalyzerImpl
public DefaultAnalyzerImpl(String givenNode, List<PomElement> pomElements, ResultCaller resultCaller, NegateNext negateNext, List<String> errorMessages)
Constructs an instance of DefaultAnalyzer with the given parameters.- Parameters:
givenNode- the name of the node to be analyzed, typically representing a specific segment of a POM (Project Object Model) structure.pomElements- a list of POM elements to analyze, each containing a path and its associated value within the POM structure.resultCaller- a utility class responsible for handling and validating error states during the analysis process.negateNext- a utility flag indicating whether the next operation should be negated during the analysis.errorMessages- a list to capture and store any error messages encountered throughout the analysis.
-
-
Method Detail
-
haveTag
public Statement<DefaultAnalyzerImpl> haveTag(@NonNull @NonNull String tagName)
Checks if the given tag name exists within the given node of the analyzed POM elements.- Specified by:
haveTagin interfaceDefaultAnalyzer- Parameters:
tagName- The name of the tag to look for within the given node, e.g., "version" or "artifactId".- Returns:
- a
ResultCallerfor validating the result and handling errors.
-
containValue
public Statement<DefaultAnalyzerImpl> containValue(@NonNull @NonNull String value)
Checks if the given value exists within the given node of the analyzed POM elements. This method searches for the specified value in all elements under the given node.- Specified by:
containValuein interfaceDefaultAnalyzer- Parameters:
value- The value to search for within the given node.- Returns:
- a
ResultCallerfor validating the result and handling errors.
-
equalsValue
public final Statement<DefaultAnalyzerImpl> equalsValue(@NonNull @NonNull String value)
Description copied from interface:DefaultAnalyzerChecks whether the specified value exactly matches the value present in the corresponding node of the analyzed POM elements. This method performs a match comparison between the given value and the element's value.- Specified by:
equalsValuein interfaceDefaultAnalyzer- Parameters:
value- The value to be matched against the value of the analyzed node.- Returns:
- a
Statement<?>instance allowing for further validations or operations based on the result of this check.
-
getPomElements
protected final List<PomElement> getPomElements()
-
-