Class ValueResolvers.CollectionResolver

java.lang.Object
io.quarkus.qute.ValueResolvers.CollectionResolver
All Implemented Interfaces:
Resolver, ValueResolver, WithPriority
Enclosing class:
ValueResolvers

public static final class ValueResolvers.CollectionResolver extends Object
  • Constructor Details

    • CollectionResolver

      public CollectionResolver()
  • Method Details

    • appliesTo

      public boolean appliesTo(EvalContext context)
      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.
      Parameters:
      context -
      Returns:
      the result
    • getSupportedProperties

      public Set<String> getSupportedProperties()
      Description copied from interface: ValueResolver
      Returns the set of property names supported by this value resolver for code completion in the Qute debugger.

      These properties are suggested when evaluating expressions on a base object. For example, if the user invokes completion at myList.|, the evaluation context will be initialized with myList as the base object, and appliesTo will be called with that context. Only if it returns true will the properties from this set be proposed.

      Completion examples:

      • "length" → inserts as-is: myList.length|
      • "size" → inserts as-is: myList.size|

      Example:

      
       @Override
       public Set<String> getSupportedProperties() {
           return Set.of("length", "size");
       }
       
      Specified by:
      getSupportedProperties in interface ValueResolver
      Returns:
      a set of supported property names to be shown in the debugger's code completion
    • getSupportedMethods

      public Set<String> getSupportedMethods()
      Description copied from interface: ValueResolver
      Returns the set of method signatures supported by this value resolver for code completion in the Qute debugger.

      These methods are suggested when evaluating expressions on a base object. For example, if the user invokes completion at myList.|, the evaluation context will be initialized with myList as the base object, and appliesTo will be called with that context. Only if it returns true will the methods from this set be proposed.

      Completion examples:

      • "take(index)" → inserts as-is: myList.take(index)|
      • "takeLast(${index})" → inserts with the parameter selected: myList.takeLast(|[index])

      The ${param} syntax indicates that the debugger selects the parameter so the user can type it immediately.

      Example:

      
       @Override
       public Set<String> getSupportedMethods() {
           return Set.of("take(index)", "takeLast(${index})");
       }
       
      Specified by:
      getSupportedMethods in interface ValueResolver
      Returns:
      a set of supported method signatures to be shown in the debugger's code completion