Class AtomicDependencyValidator

java.lang.Object
Services.Dependencies.AtomicDependencyValidator

public class AtomicDependencyValidator extends Object
Validates atomic dependencies between primitive values in requests and responses.

This class handles the comparison of atomic objects with different elements like Headers, Cookies, Query Parameters, and URL path segments.

It supports:

  • Lowercasing and stemming of values
  • ID completion based on short names or parent elements
  • Levenshtein / LCS-based approximate matching
  • Constructor Details

    • AtomicDependencyValidator

      public AtomicDependencyValidator()
  • Method Details

    • porter_stamming

      public String porter_stamming(String input)
      Applies Porter stemming to the input string.
      Parameters:
      input - string to stem
      Returns:
      stemmed string
    • lower_case

      public String lower_case(String input)
      Converts the input string to lowercase.
      Parameters:
      input - string to convert
      Returns:
      lowercase version of the input
    • id_complention

      public String id_complention(String child, String father)
      Completes a short ID using the parent (father) string.
      Parameters:
      child - short child ID
      father - parent string used to complete the ID
      Returns:
      completed ID string
    • id_complention

      public String[] id_complention(String child, Request request)
      Completes a short ID using the request path.
      Parameters:
      child - short child ID
      request - request containing the URL path
      Returns:
      array of possible completed ID strings
    • evaluate_atomic_dependencies

      public boolean evaluate_atomic_dependencies(AtomicObject atomicObject, Object to_object, StructuredObject father, Request from)
      Evaluates atomic dependency between an atomic object and another object (Header, QueryParam, Param, Cookie).
      Parameters:
      atomicObject - atomic object to validate
      to_object - target object to compare against
      father - structured parent object, if any
      from - request from which the object originates
      Returns:
      true if the dependency is valid, false otherwise
    • evaluate_url_atomic_dep

      public boolean evaluate_url_atomic_dep(AtomicObject atomicObject, Request request, String sub_path, StructuredObject father, String possible_name)
      Evaluates atomic dependency for a URL segment.
      Parameters:
      atomicObject - atomic object to validate
      request - request containing the URL
      sub_path - URL sub-path to compare
      father - structured parent object
      possible_name - candidate name for matching
      Returns:
      true if dependency is valid, false otherwise
    • general_atomic_comparioson

      public boolean general_atomic_comparioson(AtomicObject atomicObject, String to_value, String to_name, StructuredObject father, Request request)
      General atomic comparison between an AtomicObject and a target value.
      Parameters:
      atomicObject - atomic object to validate
      to_value - target value to compare
      to_name - name of the target field
      father - structured parent object
      request - originating request
      Returns:
      true if dependency is valid, false otherwise