Class DTOAwareFieldResolver

java.lang.Object
in.co.akshitbansal.springwebquery.resolver.field.DTOAwareFieldResolver
All Implemented Interfaces:
FieldResolver
Direct Known Subclasses:
CachedDTOAwareFieldResolver

public class DTOAwareFieldResolver extends Object implements 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.
  • Translate the DTO path to an entity path using MapsTo, then verify that the resulting entity path exists.
  • Return the mapped entity path together with the terminal DTO field so callers can apply validation separately.
  • Field Details

    • entityClass

      @NonNull protected final @NonNull Class<?> entityClass
      Entity type used to validate the translated path.
    • dtoClass

      @NonNull protected final @NonNull Class<?> dtoClass
      DTO type used as the external selector contract.
  • Constructor Details

    • DTOAwareFieldResolver

      public DTOAwareFieldResolver()
  • Method Details

    • resolvePath

      public ResolutionResult resolvePath(@NonNull @NonNull String dtoPath)
      Resolves a DTO selector path and maps the selector to the corresponding entity path.
      Specified by:
      resolvePath in interface FieldResolver
      Parameters:
      dtoPath - selector path from the incoming request
      Returns:
      resolution result containing the mapped entity path and terminal DTO field