Package Services.Dependencies
Class AtomicDependencyValidator
java.lang.Object
Services.Dependencies.AtomicDependencyValidator
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate_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).booleanevaluate_url_atomic_dep(AtomicObject atomicObject, Request request, String sub_path, StructuredObject father, String possible_name) Evaluates atomic dependency for a URL segment.booleangeneral_atomic_comparioson(AtomicObject atomicObject, String to_value, String to_name, StructuredObject father, Request request) General atomic comparison between an AtomicObject and a target value.String[]id_complention(String child, Request request) Completes a short ID using the request path.id_complention(String child, String father) Completes a short ID using the parent (father) string.lower_case(String input) Converts the input string to lowercase.porter_stamming(String input) Applies Porter stemming to the input string.
-
Constructor Details
-
AtomicDependencyValidator
public AtomicDependencyValidator()
-
-
Method Details
-
porter_stamming
Applies Porter stemming to the input string.- Parameters:
input- string to stem- Returns:
- stemmed string
-
lower_case
Converts the input string to lowercase.- Parameters:
input- string to convert- Returns:
- lowercase version of the input
-
id_complention
Completes a short ID using the parent (father) string.- Parameters:
child- short child IDfather- parent string used to complete the ID- Returns:
- completed ID string
-
id_complention
Completes a short ID using the request path.- Parameters:
child- short child IDrequest- 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 validateto_object- target object to compare againstfather- structured parent object, if anyfrom- 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 validaterequest- request containing the URLsub_path- URL sub-path to comparefather- structured parent objectpossible_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 validateto_value- target value to compareto_name- name of the target fieldfather- structured parent objectrequest- originating request- Returns:
- true if dependency is valid, false otherwise
-