Class ReflectionValueResolver

java.lang.Object
io.quarkus.qute.ReflectionValueResolver
All Implemented Interfaces:
Resolver, ValueResolver, WithPriority

public class ReflectionValueResolver extends Object implements ValueResolver
This value resolver can be used to access public members of classes via reflection.
  • Field Details

  • Constructor Details

    • ReflectionValueResolver

      public ReflectionValueResolver()
  • Method Details

    • getPriority

      public int getPriority()
      Description copied from interface: ValueResolver
      Value resolvers with higher priority take precedence.
      Specified by:
      getPriority in interface ValueResolver
      Specified by:
      getPriority in interface WithPriority
      Returns:
      the priority value
    • appliesTo

      public boolean appliesTo(EvalContext context)
      Specified by:
      appliesTo in interface ValueResolver
      Parameters:
      context -
      Returns:
      true if this resolver applies to the given context
    • resolve

      public CompletionStage<Object> resolve(EvalContext context)
      Description copied from interface: Resolver
      This method should return an instance of
      invalid reference
      Results#NotFound
      if it's not possible to resolve the context. Any other value is considered a valid result, including null.
      Specified by:
      resolve in interface Resolver
      Parameters:
      context -
      Returns:
      the result
    • getCachedResolver

      public ValueResolver getCachedResolver(EvalContext context)
      Description copied from interface: ValueResolver
      When ValueResolver.appliesTo(EvalContext) returns true for a specific EvalContext and the subsequent invocation of Resolver.resolve(EvalContext) does not return
      invalid reference
      Results#NotFound
      the value resolver returned from this method is cached for the specific part of an expression.

      By default, the resolver itself is cached. However, it is also possible to return an optimized version.

      Specified by:
      getCachedResolver in interface ValueResolver
      Parameters:
      context -
      Returns:
      the resolver that should be cached
    • clearCache

      public void clearCache()