Class DTOAwareFieldResolver
java.lang.Object
in.co.akshitbansal.springwebquery.resolver.field.DTOAwareFieldResolver
- All Implemented Interfaces:
FieldResolver
FieldResolver implementation that treats a DTO type as the public
query contract and maps DTO selector paths to entity selector paths.
Resolution proceeds in three steps:
- Resolve the incoming path against the DTO class structure.
- Validate the terminal DTO field via the supplied callback.
- Translate the DTO path to an entity path using
MapsTo, then verify that the resulting entity path exists.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolvePathAndValidateTerminalField(@NonNull String dtoPath, @Nullable Consumer<Field> terminalFieldValidator) Resolves a DTO selector path, validates its terminal DTO field, and maps the selector to the corresponding entity path.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface in.co.akshitbansal.springwebquery.resolver.field.FieldResolver
resolvePath
-
Constructor Details
-
DTOAwareFieldResolver
public DTOAwareFieldResolver()
-
-
Method Details
-
resolvePathAndValidateTerminalField
public String resolvePathAndValidateTerminalField(@NonNull @NonNull String dtoPath, @Nullable Consumer<Field> terminalFieldValidator) Resolves a DTO selector path, validates its terminal DTO field, and maps the selector to the corresponding entity path.- Specified by:
resolvePathAndValidateTerminalFieldin interfaceFieldResolver- Parameters:
dtoPath- selector path from the incoming requestterminalFieldValidator- callback used to validate the terminal DTO field; whennull, terminal-field validation is skipped- Returns:
- resolved entity path corresponding to the DTO selector
-