Class DefaultAnalyzerImpl

    • 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:
        haveTag in interface DefaultAnalyzer
        Parameters:
        tagName - The name of the tag to look for within the given node, e.g., "version" or "artifactId".
        Returns:
        a ResultCaller for 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:
        containValue in interface DefaultAnalyzer
        Parameters:
        value - The value to search for within the given node.
        Returns:
        a ResultCaller for validating the result and handling errors.
      • equalsValue

        public final Statement<DefaultAnalyzerImpl> equalsValue​(@NonNull
                                                                @NonNull String value)
        Description copied from interface: DefaultAnalyzer
        Checks 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:
        equalsValue in interface DefaultAnalyzer
        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.