Class PomAnalyzer
- java.lang.Object
-
- nl.zerofiftyit.mdepunit.core.validation.DefaultAnalyzerImpl
-
- nl.zerofiftyit.mdepunit.core.validation.PomAnalyzer
-
- All Implemented Interfaces:
DefaultAnalyzer
public final class PomAnalyzer extends DefaultAnalyzerImpl
-
-
Constructor Summary
Constructors Constructor Description PomAnalyzer(String givenNode, List<PomElement> pomElements, ResultCaller resultCaller, NegateNext negateNext, List<String> errorMessages)Constructs a new instance of thePomAnalyzerclass, which extends the functionality ofDefaultAnalyzerwith additional convenience methods for analyzing and validating.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Statement<PomAnalyzer>haveProperty(String propertyName)Checks whether the Maven POM contains a specific property.-
Methods inherited from class nl.zerofiftyit.mdepunit.core.validation.DefaultAnalyzerImpl
containValue, equalsValue, getPomElements, haveTag
-
-
-
-
Constructor Detail
-
PomAnalyzer
public PomAnalyzer(String givenNode, List<PomElement> pomElements, ResultCaller resultCaller, NegateNext negateNext, List<String> errorMessages)
Constructs a new instance of thePomAnalyzerclass, which extends the functionality ofDefaultAnalyzerwith additional convenience methods for analyzing and validating.- Parameters:
givenNode- the initial node within the POM structure where analysis should beginpomElements- a set ofPomElementobjects representing POM nodes for analysisresultCaller- aResultCallerinstance used for validation and error managementnegateNext- aNegateNextutility class controlling conditional negation logicerrorMessages- a set of error messages for recording validation errors during analysis
-
-
Method Detail
-
haveProperty
public Statement<PomAnalyzer> haveProperty(String propertyName)
Checks whether the Maven POM contains a specific property. Depending on the current state of `should` or `shouldNot`, it determines if the property is expected to exist or not and records an error message if the condition is violated.Example usage: XML:
<properties> <java.version>11</java.version> </properties>Java:should().haveProperty("java.version")- Parameters:
propertyName- the name of the property to check for in the POM.- Returns:
- the current instance of
ResultCaller, allowing further method chaining.
-
-