Class EntityAwareFieldResolver

java.lang.Object
in.co.akshitbansal.springwebquery.resolver.field.EntityAwareFieldResolver
All Implemented Interfaces:
FieldResolver

public class EntityAwareFieldResolver extends Object implements FieldResolver
FieldResolver implementation that resolves selectors directly against an entity model, with optional alias support via FieldMapping.

This resolver can rewrite request selectors using declared aliases, reject access to original field names when a mapping forbids them, and return the resolved terminal entity field for caller-side validation.

  • Constructor Details

    • EntityAwareFieldResolver

      protected EntityAwareFieldResolver(@NonNull @NonNull Class<?> entityClass, @NonNull @NonNull List<FieldMapping> fieldMappings)
      Creates an entity-aware resolver from raw field-mapping declarations.

      The supplied mappings are normalized into immutable lookup maps keyed by alias name and original entity field path so callers do not need to precompute resolver-specific structures.

      Parameters:
      entityClass - entity type used for path resolution
      fieldMappings - declared alias mappings from the public API contract
  • Method Details

    • resolvePath

      public ResolutionResult resolvePath(@NonNull @NonNull String reqFieldPath)
      Resolves an entity-facing selector path.
      Specified by:
      resolvePath in interface FieldResolver
      Parameters:
      reqFieldPath - selector path from the incoming request
      Returns:
      resolution result containing the resolved entity path after alias translation and the terminal entity field
      Throws:
      QueryFieldValidationException - if the request path is blocked by mapping rules or cannot be resolved against the entity type