Class EntityAwareFieldResolver
java.lang.Object
in.co.akshitbansal.springwebquery.resolver.field.EntityAwareFieldResolver
- All Implemented Interfaces:
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 Summary
ConstructorsModifierConstructorDescriptionprotectedEntityAwareFieldResolver(@NonNull Class<?> entityClass, @NonNull List<FieldMapping> fieldMappings) Creates an entity-aware resolver from raw field-mapping declarations. -
Method Summary
Modifier and TypeMethodDescriptionresolvePath(@NonNull String reqFieldPath) Resolves an entity-facing selector path.
-
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 resolutionfieldMappings- declared alias mappings from the public API contract
-
-
Method Details
-
resolvePath
Resolves an entity-facing selector path.- Specified by:
resolvePathin interfaceFieldResolver- 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
-